Category of chain complexes¶
- class sage.categories.chain_complexes.ChainComplexes(base, name=None)[source]¶
Bases:
Category_moduleThe category of all chain complexes over a base ring.
EXAMPLES:
sage: ChainComplexes(RationalField()) Category of chain complexes over Rational Field sage: ChainComplexes(Integers(9)) Category of chain complexes over Ring of integers modulo 9
>>> from sage.all import * >>> ChainComplexes(RationalField()) Category of chain complexes over Rational Field >>> ChainComplexes(Integers(Integer(9))) Category of chain complexes over Ring of integers modulo 9
- class ParentMethods[source]¶
Bases:
object- differential(*args, **kwargs)[source]¶
Return the differentials (or boundary maps) of the chain complex.
EXAMPLES:
sage: C = ChainComplex({0: matrix(ZZ, 2, 3, [3, 0, 0, 0, 0, 0])}) # needs sage.modules sage: C.differential(0) # needs sage.modules [3 0 0] [0 0 0]
>>> from sage.all import * >>> C = ChainComplex({Integer(0): matrix(ZZ, Integer(2), Integer(3), [Integer(3), Integer(0), Integer(0), Integer(0), Integer(0), Integer(0)])}) # needs sage.modules >>> C.differential(Integer(0)) # needs sage.modules [3 0 0] [0 0 0]
sage: A.<x,y,z> = GradedCommutativeAlgebra(QQ, degrees=(2, 2, 3)) # needs sage.combinat sage.libs.singular sage.modules sage: C = A.cdg_algebra({z: x*y}) # needs sage.combinat sage.libs.singular sage.modules sage: C.differential() # needs sage.combinat sage.modules Differential of Commutative Differential Graded Algebra with generators ('x', 'y', 'z') in degrees (2, 2, 3) over Rational Field Defn: x --> 0 y --> 0 z --> x*y
>>> from sage.all import * >>> A = GradedCommutativeAlgebra(QQ, degrees=(Integer(2), Integer(2), Integer(3)), names=('x', 'y', 'z',)); (x, y, z,) = A._first_ngens(3)# needs sage.combinat sage.libs.singular sage.modules >>> C = A.cdg_algebra({z: x*y}) # needs sage.combinat sage.libs.singular sage.modules >>> C.differential() # needs sage.combinat sage.modules Differential of Commutative Differential Graded Algebra with generators ('x', 'y', 'z') in degrees (2, 2, 3) over Rational Field Defn: x --> 0 y --> 0 z --> x*y
- homology(n=None)[source]¶
Return the homology of the chain complex.
INPUT:
n– (default:None) degree of the homology; if none is provided, the direct sum homology will be used
EXAMPLES:
sage: # needs sage.modules sage: C = ChainComplex({0: matrix(ZZ, 2, 3, [3, 0, 0, 0, 0, 0])}) sage: C.homology(0) Z x Z sage: C.homology(1) Z x C3 sage: C.homology(2) 0
>>> from sage.all import * >>> # needs sage.modules >>> C = ChainComplex({Integer(0): matrix(ZZ, Integer(2), Integer(3), [Integer(3), Integer(0), Integer(0), Integer(0), Integer(0), Integer(0)])}) >>> C.homology(Integer(0)) Z x Z >>> C.homology(Integer(1)) Z x C3 >>> C.homology(Integer(2)) 0
sage: # needs sage.combinat sage.modules sage: A.<x,y,z> = GradedCommutativeAlgebra(QQ, degrees=(2, 2, 3)) # needs sage.libs.singular sage: C = A.cdg_algebra({z: x*y}) # needs sage.libs.singular sage: C.homology(0) Free module generated by {[1]} over Rational Field sage: C.homology(1) Free module generated by {} over Rational Field sage: C.homology(2) Free module generated by {[x], [y]} over Rational Field sage: C.homology(3) Free module generated by {} over Rational Field sage: C.homology(4) Free module generated by {[x^2], [y^2]} over Rational Field
>>> from sage.all import * >>> # needs sage.combinat sage.modules >>> A = GradedCommutativeAlgebra(QQ, degrees=(Integer(2), Integer(2), Integer(3)), names=('x', 'y', 'z',)); (x, y, z,) = A._first_ngens(3)# needs sage.libs.singular >>> C = A.cdg_algebra({z: x*y}) # needs sage.libs.singular >>> C.homology(Integer(0)) Free module generated by {[1]} over Rational Field >>> C.homology(Integer(1)) Free module generated by {} over Rational Field >>> C.homology(Integer(2)) Free module generated by {[x], [y]} over Rational Field >>> C.homology(Integer(3)) Free module generated by {} over Rational Field >>> C.homology(Integer(4)) Free module generated by {[x^2], [y^2]} over Rational Field
- lift_from_homology(x)[source]¶
Lift the homology element
xto the corresponding module.EXAMPLES:
sage: # needs sage.symbolic sage: E3 = EuclideanSpace(3) sage: C = E3.de_rham_complex() sage: one = C.homology().one() sage: C.lift_from_homology(one) Mixed differential form one on the Euclidean space E^3
>>> from sage.all import * >>> # needs sage.symbolic >>> E3 = EuclideanSpace(Integer(3)) >>> C = E3.de_rham_complex() >>> one = C.homology().one() >>> C.lift_from_homology(one) Mixed differential form one on the Euclidean space E^3
- reduce_to_homology(x, n=None)[source]¶
Reduce a cycle to the corresponding quotient in homology.
INPUT:
x– a cyclen– (default:None) degree of the homology; if none is provided, the direct sum homology will be used
EXAMPLES:
sage: # needs sage.symbolic sage: E3 = EuclideanSpace(3) sage: C = E3.de_rham_complex() sage: one = C.one() sage: C.reduce_to_homology(one) [one]
>>> from sage.all import * >>> # needs sage.symbolic >>> E3 = EuclideanSpace(Integer(3)) >>> C = E3.de_rham_complex() >>> one = C.one() >>> C.reduce_to_homology(one) [one]
- class sage.categories.chain_complexes.HomologyFunctor(domain, n=None)[source]¶
Bases:
FunctorHomology functor.
INPUT:
domain– must be a category of chain complexesn– (default:None) degree of the homology; if none is provided, the direct sum homology will be used
EXAMPLES:
sage: C = ChainComplex({0: matrix(ZZ, 2, 3, [3, 0, 0, 0, 0, 0])}) # needs sage.modules sage: H = HomologyFunctor(ChainComplexes(ZZ), 1) sage: H(C) # needs sage.modules Z x C3
>>> from sage.all import * >>> C = ChainComplex({Integer(0): matrix(ZZ, Integer(2), Integer(3), [Integer(3), Integer(0), Integer(0), Integer(0), Integer(0), Integer(0)])}) # needs sage.modules >>> H = HomologyFunctor(ChainComplexes(ZZ), Integer(1)) >>> H(C) # needs sage.modules Z x C3
sage: A.<x,y,z> = GradedCommutativeAlgebra(QQ, degrees=(2, 2, 3)) # needs sage.combinat sage.libs.singular sage.modules sage: C = A.cdg_algebra({z: x*y}) # needs sage.combinat sage.libs.singular sage.modules sage: H = HomologyFunctor(ChainComplexes(QQ), 2) sage: H(C) # needs sage.combinat sage.modules Free module generated by {[x], [y]} over Rational Field
>>> from sage.all import * >>> A = GradedCommutativeAlgebra(QQ, degrees=(Integer(2), Integer(2), Integer(3)), names=('x', 'y', 'z',)); (x, y, z,) = A._first_ngens(3)# needs sage.combinat sage.libs.singular sage.modules >>> C = A.cdg_algebra({z: x*y}) # needs sage.combinat sage.libs.singular sage.modules >>> H = HomologyFunctor(ChainComplexes(QQ), Integer(2)) >>> H(C) # needs sage.combinat sage.modules Free module generated by {[x], [y]} over Rational Field
Applying to a chain map:
sage: # needs sage.graphs sage.modules sage: S = simplicial_complexes.Sphere(1); S Minimal triangulation of the 1-sphere sage: SCC = S.chain_complex() sage: SCC.differential() {0: [], 1: [-1 -1 0] [ 1 0 -1] [ 0 1 1], 2: []} sage: f = {0: zero_matrix(ZZ,3,3), 1: zero_matrix(ZZ,3,3)} sage: G = Hom(SCC, SCC) sage: x = G(f) sage: H = HomologyFunctor(ChainComplexes(ZZ), 1) sage: H(SCC) Z sage: H(x) Generic morphism: From: Z To: Z
>>> from sage.all import * >>> # needs sage.graphs sage.modules >>> S = simplicial_complexes.Sphere(Integer(1)); S Minimal triangulation of the 1-sphere >>> SCC = S.chain_complex() >>> SCC.differential() {0: [], 1: [-1 -1 0] [ 1 0 -1] [ 0 1 1], 2: []} >>> f = {Integer(0): zero_matrix(ZZ,Integer(3),Integer(3)), Integer(1): zero_matrix(ZZ,Integer(3),Integer(3))} >>> G = Hom(SCC, SCC) >>> x = G(f) >>> H = HomologyFunctor(ChainComplexes(ZZ), Integer(1)) >>> H(SCC) Z >>> H(x) Generic morphism: From: Z To: Z