SimplicialComplex

Struct SimplicialComplex 

Source
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

Source

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

Source

pub fn elementary_collapses(&self) -> Vec<ElementaryCollapse>

All elementary free-face collapses available in this complex.

Source

pub fn elementary_collapse( &self, step: &ElementaryCollapse, ) -> Result<Self, TopologyError>

Replay one proposed elementary collapse after verifying freeness.

Source

pub fn collapse_sequence( &self, steps: Vec<ElementaryCollapse>, ) -> Result<SimplicialCollapseSequence, TopologyError>

Replay and retain a checked sequence of elementary collapses.

Source

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.

Source

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

Source

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.

Source

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

Source

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.

Source

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

Source

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.

Source

pub fn strong_collapse( &self, step: DominatedVertex, ) -> Result<Self, TopologyError>

Delete a currently dominated vertex and verify the supplied dominator.

Source

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.

Source

pub fn strong_core(&self) -> Result<Self, TopologyError>

Canonical representative of the strong-homotopy core.

Source§

impl SimplicialComplex

Source

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.

Source

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

Source

pub fn from_facets(facets: &[Vec<u32>]) -> Self

Construct the downward closure of a collection of facets.

Source

pub fn to_json(&self) -> Result<String, NoetherError>

Serialize the canonical facet presentation as typed JSON.

Source

pub fn from_json(value: &str) -> Result<Self, NoetherError>

Deserialize and normalize a typed facet presentation.

Source

pub fn is_empty(&self) -> bool

Whether the complex has no simplices.

Source

pub fn dimension(&self) -> i64

Top dimension, with the empty complex assigned dimension -1.

Source

pub fn count(&self, dimension: usize) -> usize

Number of simplices in dimension dimension.

Source

pub fn total_cells(&self) -> usize

Total number of nonempty simplices.

Source

pub fn simplices(&self, dimension: usize) -> &[Simplex]

Simplices of one dimension, in canonical index order.

Source

pub fn facets(&self) -> Vec<&Simplex>

Maximal simplices in lexicographic order.

Source

pub fn position(&self, simplex: &Simplex) -> Option<usize>

Index of a simplex within its dimension.

Source

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.

Source

pub fn boundary_columns_f2(&self, degree: usize) -> Vec<Vec<u32>>

Boundary d_k over F_2 as sparse columns of row indices.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn morse_chain_complex<R: Ring>( &self, ring: R, ) -> Result<ChainComplex<R>, TopologyError>

Construct only the chain complex carried by the critical cells.

Source

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.

Source

pub fn homology<R: Field>( &self, field: R, degree: usize, ) -> Result<HomologyGroup<R>, TopologyError>

Compute one field-homology group through the canonical chain complex.

Source

pub fn graded_homology<R: Field>( &self, field: R, ) -> Result<GradedHomology<R>, TopologyError>

Compute field homology in every nonzero chain degree.

Source

pub fn integral_homology( &self, degree: usize, ) -> Result<HomologyGroup<IntegerRing>, TopologyError>

Compute one integral homology group, including torsion.

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> SimplicialComplex

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SimplicialComplex

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for SimplicialComplex

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for SimplicialComplex

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for SimplicialComplex

Source§

fn eq(&self, other: &SimplicialComplex) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl SemanticType for SimplicialComplex

Source§

const TYPE_ID: &'static str = "noether/topology/SimplicialComplex@1"

Versioned, language-neutral semantic identity.
Source§

fn canonical_bytes(&self) -> Result<Vec<u8>, NoetherError>

Serialize without backend- or language-specific identity.
Source§

fn describe() -> &'static TypeDescription

Return static discovery metadata for the type.
Source§

impl Serialize for SimplicialComplex

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for SimplicialComplex

Source§

impl StructuralPartialEq for SimplicialComplex

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,