pub struct ExtSpace(/* private fields */);Expand description
Ext^k(M, N) as an explicit vector space: the resolution prefix, RREF
cocycle and coboundary bases in generator-block coordinates, the
deterministic complement of the coboundaries inside the cocycles, and one
representative cocycle per complement row.
Two spaces are compatible when their sources are Module::ptr_eq, their
targets are Module::ptr_eq, and their degrees are equal. Every stored
matrix is deterministic, so recomputed compatible spaces carry identical
bases and class coordinates transport verbatim.
Cloning is cheap (a reference count bump).
Implementations§
Source§impl ExtSpace
impl ExtSpace
Sourcepub fn new(m: &Module, n: &Module, k: usize) -> Result<ExtSpace, ExtError>
pub fn new(m: &Module, n: &Module, k: usize) -> Result<ExtSpace, ExtError>
Builds Ext^k(m, n) from the minimal resolution prefix
resolve(m, k + 1). Zero modules give zero spaces. A finite resolution
that ends before degree k gives the zero space with the zero module
as cochain term. Errors when the modules do not share one algebra or
k + 1 is not representable.
Sourcepub fn dim(&self) -> usize
pub fn dim(&self) -> usize
dim_Fp Ext^k(M, N): the number of complement rows. Equals
crate::ext::ext_dim(m, n, k).
Sourcepub fn cochain_term(&self) -> &Module
pub fn cochain_term(&self) -> &Module
The source of degree-k cochains: P_k of the minimal resolution, or
the zero module when the finite resolution ends before k.
Sourcepub fn representatives(&self) -> &[Morphism]
pub fn representatives(&self) -> &[Morphism]
One representative cocycle P_k -> N per complement row, in row order.
Sourcepub fn cocycle_basis(&self) -> &DenseMat
pub fn cocycle_basis(&self) -> &DenseMat
The RREF basis of Z^k = ker delta^k in generator-block coordinates,
one vector per row.
Sourcepub fn coboundary_basis(&self) -> &DenseMat
pub fn coboundary_basis(&self) -> &DenseMat
The RREF basis of B^k = im delta^{k-1} in generator-block
coordinates, one vector per row; no rows at degree 0.
Sourcepub fn complement_basis(&self) -> &DenseMat
pub fn complement_basis(&self) -> &DenseMat
The complement of B^k in Z^k, in scan order. Class coordinates
index these rows.
Sourcepub fn is_compatible(&self, other: &ExtSpace) -> bool
pub fn is_compatible(&self, other: &ExtSpace) -> bool
Whether class coordinates transport verbatim between the two spaces: sources pointer-equal, targets pointer-equal, degrees equal.
Sourcepub fn matches(&self, other: &ExtSpace) -> bool
pub fn matches(&self, other: &ExtSpace) -> bool
Whether the two compatible spaces carry the same stored data: the resolution prefix term by term and differential by differential, the cochain term, the cocycle, coboundary and complement bases, and the representatives.
Incompatible spaces are never equal. Terms and representatives are compared entry by entry, because a recomputed space owns fresh module values that no pointer test can match.
Sourcepub fn matches_recomputation(&self) -> bool
pub fn matches_recomputation(&self) -> bool
Whether every stored matrix equals a fresh ExtSpace::new over the
live endpoint modules, by ExtSpace::matches.
Rechecks that read this space (action matrices, socle, cocycle reduction) use the stored resolution and bases, so a tampered space would otherwise certify itself.
Sourcepub fn zero_class(&self) -> ExtClass
pub fn zero_class(&self) -> ExtClass
The zero class of this space.
Sourcepub fn identity_class(&self) -> Result<ExtClass, ExtClassError>
pub fn identity_class(&self) -> Result<ExtClass, ExtClassError>
The Yoneda unit: the class of the augmentation in Ext^0(M, M).
Errors unless the space has degree 0 and pointer-equal endpoints.
Sourcepub fn class_from_cocycle(
&self,
f: &Morphism,
) -> Result<ExtClass, ExtClassError>
pub fn class_from_cocycle( &self, f: &Morphism, ) -> Result<ExtClass, ExtClassError>
The class of the cocycle f: P_k -> N: checks both endpoints by
Module::ptr_eq, checks d_{k+1}.then(f) = 0, then reduces modulo
B^k by solving f against the complement rows stacked above the
coboundary basis and keeping the complement part.
Sourcepub fn class_from_coordinates(
&self,
coords: &[Fp],
) -> Result<ExtClass, ExtClassError>
pub fn class_from_coordinates( &self, coords: &[Fp], ) -> Result<ExtClass, ExtClassError>
The class with the given coordinates over the complement basis. Errors on a wrong length and on entries that are not canonical elements of the modules’ field.