Chains and cochains¶
This module implements formal linear combinations of cells of a given
cell complex (Chains
) and their dual (Cochains
). It
is closely related to the sage.homology.chain_complex
module. The main differences are that chains and cochains here are of
homogeneous dimension only, and that they reference their cell
complex.
-
class
sage.homology.chains.
CellComplexReference
(cell_complex, degree, cells=None)¶ Bases:
object
Auxiliary base class for chains and cochains
INPUT:
cell_complex
– The cell complex to referencedegree
– integer. The degree of the (co)chainscells
– tuple of cells orNone
. Does not necessarily have to be the cells in the given degree, for computational purposes this could also be any collection that is in one-to-one correspondence with the cells. IfNone
, the cells of the complex in the given degree are used.
EXAMPLES:
sage: X = simplicial_complexes.Simplex(2) sage: from sage.homology.chains import CellComplexReference sage: c = CellComplexReference(X, 1) sage: c.cell_complex() is X True
-
cell_complex
()¶ Return the underlying cell complex
OUTPUT:
A cell complex.
EXAMPLES:
sage: X = simplicial_complexes.Simplex(2) sage: X.n_chains(1).cell_complex() is X True
-
degree
()¶ Return the dimension of the cells
OUTPUT:
Integer. The dimension of the cells.
EXAMPLES:
sage: X = simplicial_complexes.Simplex(2) sage: X.n_chains(1).degree() 1
-
sage.homology.chains.
Chains
¶ Class for the free module of chains in a given degree.
INPUT:
n_cells
– tuple of \(n\)-cells, which thus forms a basis for this modulebase_ring
– optional (default \(\ZZ\))
One difference between chains and cochains is notation. In a simplicial complex, for example, a simplex
(0,1,2)
is written as “(0,1,2)” in the group of chains but as “\chi_(0,1,2)” in the group of cochains.Also, since the free modules of chains and cochains are dual, there is a pairing \(\langle c, z \rangle\), sending a cochain \(c\) and a chain \(z\) to a scalar.
EXAMPLES:
sage: S2 = simplicial_complexes.Sphere(2) sage: C_2 = S2.n_chains(1) sage: C_2_co = S2.n_chains(1, cochains=True) sage: x = C_2.basis()[Simplex((0,2))] sage: y = C_2.basis()[Simplex((1,3))] sage: z = x+2*y sage: a = C_2_co.basis()[Simplex((1,3))] sage: b = C_2_co.basis()[Simplex((0,3))] sage: c = 3*a-2*b sage: z (0, 2) + 2*(1, 3) sage: c -2*\chi_(0, 3) + 3*\chi_(1, 3) sage: c.eval(z) 6
-
sage.homology.chains.
Cochains
¶ Class for the free module of cochains in a given degree.
INPUT:
n_cells
– tuple of \(n\)-cells, which thus forms a basis for this modulebase_ring
– optional (default \(\ZZ\))
One difference between chains and cochains is notation. In a simplicial complex, for example, a simplex
(0,1,2)
is written as “(0,1,2)” in the group of chains but as “\chi_(0,1,2)” in the group of cochains.Also, since the free modules of chains and cochains are dual, there is a pairing \(\langle c, z \rangle\), sending a cochain \(c\) and a chain \(z\) to a scalar.
EXAMPLES:
sage: S2 = simplicial_complexes.Sphere(2) sage: C_2 = S2.n_chains(1) sage: C_2_co = S2.n_chains(1, cochains=True) sage: x = C_2.basis()[Simplex((0,2))] sage: y = C_2.basis()[Simplex((1,3))] sage: z = x+2*y sage: a = C_2_co.basis()[Simplex((1,3))] sage: b = C_2_co.basis()[Simplex((0,3))] sage: c = 3*a-2*b sage: z (0, 2) + 2*(1, 3) sage: c -2*\chi_(0, 3) + 3*\chi_(1, 3) sage: c.eval(z) 6