Category of chain complexes - Category Framework

Skip to content
Back to top
View this page
Edit this page

# Category of chain complexes

class sage.categories.chain_complexes.ChainComplexes(base, name=None)

  Bases: `Category_module`

  The category of all chain complexes over a base ring.

  EXAMPLES:

  Sage

      sage: ChainComplexes(RationalField())
      Category of chain complexes over Rational Field
      sage: ChainComplexes(Integers(9))
      Category of chain complexes over Ring of integers modulo 9

  Python

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

    Bases: `object`

    differential(*args, **kwargs)

      Return the differentials (or boundary maps) of the chain complex.

      EXAMPLES:

      Sage

          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]

      Python

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

          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

      [Python]

          >>> 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)

      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

          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

      Python

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

          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

      [Python]

          >>> 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)

      Lift the homology element `x` to the corresponding module.

      EXAMPLES:

      Sage

          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

      Python

          >>> 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)

      Reduce a cycle to the corresponding quotient in homology.

      INPUT:

      - `x` – a cycle

      - `n` – (default: `None`) degree of the homology; if none is provided, the direct sum homology will be used

      EXAMPLES:

      Sage

          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]

      Python

          >>> 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]

  super_categories()

    EXAMPLES:

    Sage

        sage: ChainComplexes(Integers(9)).super_categories()
        [Category of modules over Ring of integers modulo 9]

    Python

        >>> from sage.all import *
        >>> ChainComplexes(Integers(Integer(9))).super_categories()
        [Category of modules over Ring of integers modulo 9]

class sage.categories.chain_complexes.HomologyFunctor(domain, n=None)

  Bases: `Functor`

  Homology functor.

  INPUT:

  - `domain` – must be a category of chain complexes

  - `n` – (default: `None`) degree of the homology; if none is provided, the direct sum homology will be used

  EXAMPLES:

  Sage

      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

  Python

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

      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

  [Python]

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

      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

  Python

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