pub struct SimplicialComplex { /* private fields */ }Expand description
A finite abstract simplicial complex stored in deterministic index order.
from_facets takes the downward closure, sorts every
dimension lexicographically, and fixes that indexing for all subsequent
boundary matrices. Empty facets are ignored; an empty facet list creates
the empty complex.
§Examples
use noether::topology::SimplicialComplex;
use noether::Q;
let circle = SimplicialComplex::from_facets(&[
vec![0, 1], vec![1, 2], vec![0, 2],
]);
assert_eq!(circle.euler_characteristic(), 0);
assert_eq!(circle.homology(Q, 1)?.dimension(), 1);Implementations§
Source§impl SimplicialComplex
impl SimplicialComplex
Sourcepub fn cohomology_ring(
&self,
field: FiniteField,
) -> Result<SimplicialCohomologyRing, TopologyError>
pub fn cohomology_ring( &self, field: FiniteField, ) -> Result<SimplicialCohomologyRing, TopologyError>
Compute the complete finite-dimensional cohomology algebra over
field, including canonical cocycles and every basis product.
Source§impl SimplicialComplex
impl SimplicialComplex
Sourcepub fn elementary_collapses(&self) -> Vec<ElementaryCollapse>
pub fn elementary_collapses(&self) -> Vec<ElementaryCollapse>
All elementary free-face collapses available in this complex.
Sourcepub fn elementary_collapse(
&self,
step: &ElementaryCollapse,
) -> Result<Self, TopologyError>
pub fn elementary_collapse( &self, step: &ElementaryCollapse, ) -> Result<Self, TopologyError>
Replay one proposed elementary collapse after verifying freeness.
Sourcepub fn collapse_sequence(
&self,
steps: Vec<ElementaryCollapse>,
) -> Result<SimplicialCollapseSequence, TopologyError>
pub fn collapse_sequence( &self, steps: Vec<ElementaryCollapse>, ) -> Result<SimplicialCollapseSequence, TopologyError>
Replay and retain a checked sequence of elementary collapses.
Sourcepub fn simple_homotopy_zigzag(
&self,
moves: Vec<SimplicialSimpleHomotopyMove>,
) -> Result<SimplicialSimpleHomotopyZigzag, TopologyError>
pub fn simple_homotopy_zigzag( &self, moves: Vec<SimplicialSimpleHomotopyMove>, ) -> Result<SimplicialSimpleHomotopyZigzag, TopologyError>
Replay and retain a checked zigzag of elementary expansions and collapses beginning at this complex.
Sourcepub fn greedy_collapse_reduction(
&self,
) -> Result<SimplicialCollapseSequence, TopologyError>
pub fn greedy_collapse_reduction( &self, ) -> Result<SimplicialCollapseSequence, TopologyError>
Deterministically collapse the least available free-face pair until no elementary collapse remains.
Unlike a strong-homotopy core, this terminal target need not be unique up to isomorphism. The returned sequence is the mathematical evidence; callers must not treat the target as a canonical simple-homotopy type.
Source§impl SimplicialComplex
impl SimplicialComplex
Sourcepub fn cup_i(
&self,
cup_index: usize,
left_degree: usize,
left: &Vector<FiniteField>,
right_degree: usize,
right: &Vector<FiniteField>,
) -> Result<Vector<FiniteField>, TopologyError>
pub fn cup_i( &self, cup_index: usize, left_degree: usize, left: &Vector<FiniteField>, right_degree: usize, right: &Vector<FiniteField>, ) -> Result<Vector<FiniteField>, TopologyError>
Chain-level cup-i product on normalized cochains in characteristic 2.
This uses the subset formula of Medina-Mardones. Inputs need not be
cocycles. The output has degree left_degree + right_degree - i.
Sourcepub fn steenrod_square(
&self,
square: usize,
degree: usize,
cocycle: &Vector<FiniteField>,
) -> Result<Vector<FiniteField>, TopologyError>
pub fn steenrod_square( &self, square: usize, degree: usize, cocycle: &Vector<FiniteField>, ) -> Result<Vector<FiniteField>, TopologyError>
Steenrod square of a checked normalized cocycle over a field of characteristic 2.
Source§impl SimplicialComplex
impl SimplicialComplex
Sourcepub fn steenrod_reduced_power(
&self,
power: usize,
degree: usize,
cocycle: &Vector<FiniteField>,
) -> Result<Vector<FiniteField>, TopologyError>
pub fn steenrod_reduced_power( &self, power: usize, degree: usize, cocycle: &Vector<FiniteField>, ) -> Result<Vector<FiniteField>, TopologyError>
The odd-primary Steenrod reduced power P^power of a checked
normalized cocycle over a prime field.
A degree-q input produces a degree-q + 2 power (p-1) cocycle.
The implementation uses the effective May–Steenrod structure on
normalized simplicial cochains.
Sourcepub fn bockstein_reduced_power(
&self,
power: usize,
degree: usize,
cocycle: &Vector<FiniteField>,
) -> Result<Vector<FiniteField>, TopologyError>
pub fn bockstein_reduced_power( &self, power: usize, degree: usize, cocycle: &Vector<FiniteField>, ) -> Result<Vector<FiniteField>, TopologyError>
The odd-primary operation beta P^power of a checked normalized
cocycle over a prime field.
A degree-q input produces a degree-q + 2 power (p-1) + 1
cocycle. Here beta is the mod-p Bockstein belonging to the
standard Steenrod-algebra convention.
Source§impl SimplicialComplex
impl SimplicialComplex
Sourcepub fn dominated_vertices(&self) -> Vec<DominatedVertex>
pub fn dominated_vertices(&self) -> Vec<DominatedVertex>
Every currently dominated vertex, with its least-label dominator.
A vertex v is dominated by w precisely when every maximal simplex
containing v also contains w.
Sourcepub fn strong_collapse(
&self,
step: DominatedVertex,
) -> Result<Self, TopologyError>
pub fn strong_collapse( &self, step: DominatedVertex, ) -> Result<Self, TopologyError>
Delete a currently dominated vertex and verify the supplied dominator.
Sourcepub fn strong_core_reduction(
&self,
) -> Result<StrongCoreReduction, TopologyError>
pub fn strong_core_reduction( &self, ) -> Result<StrongCoreReduction, TopologyError>
Deterministically delete dominated vertices until none remain.
The replayed reduced complex retains surviving labels. The published
core is its exact canonical form, so isomorphic inputs have equal
core values even when their deterministic deletion sequences differ.
Sourcepub fn strong_core(&self) -> Result<Self, TopologyError>
pub fn strong_core(&self) -> Result<Self, TopologyError>
Canonical representative of the strong-homotopy core.
Source§impl SimplicialComplex
impl SimplicialComplex
Sourcepub fn canonical_form(&self) -> Result<Self, TopologyError>
pub fn canonical_form(&self) -> Result<Self, TopologyError>
Canonically relabel the used vertices as 0,...,n-1.
The labeling is induced by exact canonicalization of the colored
vertex–facet incidence graph. Vertex and facet nodes have distinct
loop colors, so graph isomorphisms are exactly simplicial
isomorphisms. This operation and Self::automorphism_group share the
same individualization/refinement search.
Sourcepub fn automorphism_group(&self) -> Result<PermutationGroup, TopologyError>
pub fn automorphism_group(&self) -> Result<PermutationGroup, TopologyError>
Compute the exact automorphism group acting on the original vertex ids.
Missing ids below the largest used label are fixed. Automorphisms are projected from the exact colored incidence-graph group and reverified against the facet set.
Source§impl SimplicialComplex
impl SimplicialComplex
Sourcepub fn from_facets(facets: &[Vec<u32>]) -> Self
pub fn from_facets(facets: &[Vec<u32>]) -> Self
Construct the downward closure of a collection of facets.
Sourcepub fn to_json(&self) -> Result<String, NoetherError>
pub fn to_json(&self) -> Result<String, NoetherError>
Serialize the canonical facet presentation as typed JSON.
Sourcepub fn from_json(value: &str) -> Result<Self, NoetherError>
pub fn from_json(value: &str) -> Result<Self, NoetherError>
Deserialize and normalize a typed facet presentation.
Sourcepub fn total_cells(&self) -> usize
pub fn total_cells(&self) -> usize
Total number of nonempty simplices.
Sourcepub fn simplices(&self, dimension: usize) -> &[Simplex]
pub fn simplices(&self, dimension: usize) -> &[Simplex]
Simplices of one dimension, in canonical index order.
Sourcepub fn position(&self, simplex: &Simplex) -> Option<usize>
pub fn position(&self, simplex: &Simplex) -> Option<usize>
Index of a simplex within its dimension.
Sourcepub fn euler_characteristic(&self) -> i64
pub fn euler_characteristic(&self) -> i64
Euler characteristic from cell counts.
This is independent of homology and therefore provides a useful cross-check against the alternating sum of field-homology dimensions.
Sourcepub fn boundary_columns_f2(&self, degree: usize) -> Vec<Vec<u32>>
pub fn boundary_columns_f2(&self, degree: usize) -> Vec<Vec<u32>>
Boundary d_k over F_2 as sparse columns of row indices.
Sourcepub fn boundary_matrix<R: Ring>(
&self,
ring: R,
degree: usize,
) -> Result<Matrix<R>, LinalgError>
pub fn boundary_matrix<R: Ring>( &self, ring: R, degree: usize, ) -> Result<Matrix<R>, LinalgError>
Signed boundary d_k: C_k -> C_(k-1) over an arbitrary ring.
Sourcepub fn chain_complex<R: Ring>(
&self,
ring: R,
) -> Result<ChainComplex<R>, TopologyError>
pub fn chain_complex<R: Ring>( &self, ring: R, ) -> Result<ChainComplex<R>, TopologyError>
Construct the canonical checked chain complex over ring.
A zero-dimensional complex includes d_0: C_0 -> 0, because no
adjacent nonzero differential exists from which C_0 could otherwise
be inferred.
Sourcepub fn cochain_complex<R: Ring>(
&self,
ring: R,
) -> Result<ChainComplex<R>, TopologyError>
pub fn cochain_complex<R: Ring>( &self, ring: R, ) -> Result<ChainComplex<R>, TopologyError>
Construct the canonical simplicial cochain complex over ring.
Each coboundary is the transpose of the signed boundary in the fixed lexicographic simplex bases.
Sourcepub fn alexander_whitney_diagonal(
&self,
dimension: usize,
simplex: usize,
) -> Result<Vec<(Simplex, Simplex)>, TopologyError>
pub fn alexander_whitney_diagonal( &self, dimension: usize, simplex: usize, ) -> Result<Vec<(Simplex, Simplex)>, TopologyError>
Alexander–Whitney front/back faces of one simplex, from split degree zero through its full dimension.
Sourcepub fn cup_product<R: Ring>(
&self,
left_degree: usize,
left: &Vector<R>,
right_degree: usize,
right: &Vector<R>,
) -> Result<Vector<R>, TopologyError>
pub fn cup_product<R: Ring>( &self, left_degree: usize, left: &Vector<R>, right_degree: usize, right: &Vector<R>, ) -> Result<Vector<R>, TopologyError>
Alexander–Whitney cup product of two simplicial cochains.
Inputs and output use the same lexicographic simplex bases as the boundary and cochain complexes. This is a chain-level operation: inputs need not be cocycles.
Sourcepub fn morse_reduction<R: Ring>(
&self,
ring: R,
) -> Result<SimplicialMorseReduction<R>, TopologyError>
pub fn morse_reduction<R: Ring>( &self, ring: R, ) -> Result<SimplicialMorseReduction<R>, TopologyError>
Construct a smaller chain model through verified discrete Morse theory.
Matching uses only elementary free-face collapses, interspersed with deterministic critical-cell choices. The resulting signed Morse boundary is valid over every coefficient ring.
Sourcepub fn morse_chain_complex<R: Ring>(
&self,
ring: R,
) -> Result<ChainComplex<R>, TopologyError>
pub fn morse_chain_complex<R: Ring>( &self, ring: R, ) -> Result<ChainComplex<R>, TopologyError>
Construct only the chain complex carried by the critical cells.
Sourcepub fn betti_number<R: Field>(
&self,
field: R,
degree: usize,
) -> Result<usize, TopologyError>
pub fn betti_number<R: Field>( &self, field: R, degree: usize, ) -> Result<usize, TopologyError>
Return one Betti number over an exact field.
This invariants-only path constructs and ranks only d_n and
d_(n+1). It does not construct the full chain complex or explicit
cycle and quotient bases; use Self::homology when those witnesses
are needed.
Sourcepub fn homology<R: Field>(
&self,
field: R,
degree: usize,
) -> Result<HomologyGroup<R>, TopologyError>
pub fn homology<R: Field>( &self, field: R, degree: usize, ) -> Result<HomologyGroup<R>, TopologyError>
Compute one field-homology group through the canonical chain complex.
Sourcepub fn graded_homology<R: Field>(
&self,
field: R,
) -> Result<GradedHomology<R>, TopologyError>
pub fn graded_homology<R: Field>( &self, field: R, ) -> Result<GradedHomology<R>, TopologyError>
Compute field homology in every nonzero chain degree.
Sourcepub fn integral_homology(
&self,
degree: usize,
) -> Result<HomologyGroup<IntegerRing>, TopologyError>
pub fn integral_homology( &self, degree: usize, ) -> Result<HomologyGroup<IntegerRing>, TopologyError>
Compute one integral homology group, including torsion.
Sourcepub fn homology_invariants(
&self,
degree: usize,
) -> Result<FinitelyGeneratedAbelianGroup, TopologyError>
pub fn homology_invariants( &self, degree: usize, ) -> Result<FinitelyGeneratedAbelianGroup, TopologyError>
Compute integral homology as a lean finitely generated abelian group.
Only sparse ranks and Smith invariant factors are retained. Use
Self::integral_homology when the result must carry adjacent dense
boundary matrices for an independent later verification.
Sourcepub fn graded_homology_invariants(
&self,
) -> Result<Vec<FinitelyGeneratedAbelianGroup>, TopologyError>
pub fn graded_homology_invariants( &self, ) -> Result<Vec<FinitelyGeneratedAbelianGroup>, TopologyError>
Compute lean integral homology invariants in every chain degree.
Each sparse boundary is constructed and Smith-reduced exactly once. The returned vector is indexed by homological degree and retains no boundary matrices or cycle representatives. The empty complex returns an empty vector.
Sourcepub fn graded_integral_homology(
&self,
) -> Result<GradedHomology<IntegerRing>, TopologyError>
pub fn graded_integral_homology( &self, ) -> Result<GradedHomology<IntegerRing>, TopologyError>
Compute integral homology, including torsion, in every chain degree.
Trait Implementations§
Source§impl Clone for SimplicialComplex
impl Clone for SimplicialComplex
Source§fn clone(&self) -> SimplicialComplex
fn clone(&self) -> SimplicialComplex
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SimplicialComplex
impl Debug for SimplicialComplex
Source§impl<'de> Deserialize<'de> for SimplicialComplex
impl<'de> Deserialize<'de> for SimplicialComplex
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Source§impl Display for SimplicialComplex
impl Display for SimplicialComplex
Source§impl PartialEq for SimplicialComplex
impl PartialEq for SimplicialComplex
Source§impl SemanticType for SimplicialComplex
impl SemanticType for SimplicialComplex
Source§const TYPE_ID: &'static str = "noether/topology/SimplicialComplex@1"
const TYPE_ID: &'static str = "noether/topology/SimplicialComplex@1"
Source§fn canonical_bytes(&self) -> Result<Vec<u8>, NoetherError>
fn canonical_bytes(&self) -> Result<Vec<u8>, NoetherError>
Source§fn describe() -> &'static TypeDescription
fn describe() -> &'static TypeDescription
Source§impl Serialize for SimplicialComplex
impl Serialize for SimplicialComplex
impl Eq for SimplicialComplex
impl StructuralPartialEq for SimplicialComplex
Auto Trait Implementations§
impl Freeze for SimplicialComplex
impl RefUnwindSafe for SimplicialComplex
impl Send for SimplicialComplex
impl Sync for SimplicialComplex
impl Unpin for SimplicialComplex
impl UnwindSafe for SimplicialComplex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more