Graded modules with basis - Category Framework

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

# Graded modules with basis

class sage.categories.graded_modules_with_basis.GradedModulesWithBasis(base_category)

  Bases: `GradedModulesCategory`

  The category of graded modules with a distinguished basis.

  EXAMPLES:

  Sage

      sage: C = GradedModulesWithBasis(ZZ); C
      Category of graded modules with basis over Integer Ring
      sage: sorted(C.super_categories(), key=str)
      [Category of filtered modules with basis over Integer Ring,
       Category of graded modules over Integer Ring]
      sage: C is ModulesWithBasis(ZZ).Graded()
      True

  Python

      >>> from sage.all import *
      >>> C = GradedModulesWithBasis(ZZ); C
      Category of graded modules with basis over Integer Ring
      >>> sorted(C.super_categories(), key=str)
      [Category of filtered modules with basis over Integer Ring,
       Category of graded modules over Integer Ring]
      >>> C is ModulesWithBasis(ZZ).Graded()
      True

  class ElementMethods

    Bases: `object`

    degree_negation()

      Return the image of `self` under the degree negation automorphism of the graded module to which `self` belongs.

      The degree negation is the module automorphism which scales every homogeneous element of degree \(k\) by \((-1)^k\) (for all \(k\)). This assumes that the module to which `self` belongs (that is, the module `self.parent()`) is \(\ZZ\)-graded.

      EXAMPLES:

      Sage

          sage: E.<a,b> = ExteriorAlgebra(QQ)                                     # needs sage.modules
          sage: ((1 + a) * (1 + b)).degree_negation()                             # needs sage.modules
          a*b - a - b + 1
          sage: E.zero().degree_negation()                                        # needs sage.modules
          0

          sage: P = GradedModulesWithBasis(ZZ).example(); P                       # needs sage.combinat sage.modules
          An example of a graded module with basis:
           the free module on partitions over Integer Ring
          sage: pbp = lambda x: P.basis()[Partition(list(x))]
          sage: p = pbp([3,1]) - 2 * pbp([2]) + 4 * pbp([1])                      # needs sage.combinat sage.modules
          sage: p.degree_negation()                                               # needs sage.combinat sage.modules
          -4*P[1] - 2*P[2] + P[3, 1]

      Python

          >>> from sage.all import *
          >>> E = ExteriorAlgebra(QQ, names=('a', 'b',)); (a, b,) = E._first_ngens(2)# needs sage.modules
          >>> ((Integer(1) + a) * (Integer(1) + b)).degree_negation()                             # needs sage.modules
          a*b - a - b + 1
          >>> E.zero().degree_negation()                                        # needs sage.modules
          0

          >>> P = GradedModulesWithBasis(ZZ).example(); P                       # needs sage.combinat sage.modules
          An example of a graded module with basis:
           the free module on partitions over Integer Ring
          >>> pbp = lambda x: P.basis()[Partition(list(x))]
          >>> p = pbp([Integer(3),Integer(1)]) - Integer(2) * pbp([Integer(2)]) + Integer(4) * pbp([Integer(1)])                      # needs sage.combinat sage.modules
          >>> p.degree_negation()                                               # needs sage.combinat sage.modules
          -4*P[1] - 2*P[2] + P[3, 1]

  class ParentMethods

    Bases: `object`

    degree_negation(element)

      Return the image of `element` under the degree negation automorphism of the graded module `self`.

      The degree negation is the module automorphism which scales every homogeneous element of degree \(k\) by \((-1)^k\) (for all \(k\)). This assumes that the module `self` is \(\ZZ\)-graded.

      INPUT:

      - `element` – element of the module `self`

      EXAMPLES:

      Sage

          sage: E.<a,b> = ExteriorAlgebra(QQ)                                     # needs sage.modules
          sage: E.degree_negation((1 + a) * (1 + b))                              # needs sage.modules
          a*b - a - b + 1
          sage: E.degree_negation(E.zero())                                       # needs sage.modules
          0

          sage: P = GradedModulesWithBasis(ZZ).example(); P                       # needs sage.combinat sage.modules
          An example of a graded module with basis:
           the free module on partitions over Integer Ring
          sage: pbp = lambda x: P.basis()[Partition(list(x))]
          sage: p = pbp([3,1]) - 2 * pbp([2]) + 4 * pbp([1])                      # needs sage.combinat sage.modules
          sage: P.degree_negation(p)                                              # needs sage.combinat sage.modules
          -4*P[1] - 2*P[2] + P[3, 1]

      Python

          >>> from sage.all import *
          >>> E = ExteriorAlgebra(QQ, names=('a', 'b',)); (a, b,) = E._first_ngens(2)# needs sage.modules
          >>> E.degree_negation((Integer(1) + a) * (Integer(1) + b))                              # needs sage.modules
          a*b - a - b + 1
          >>> E.degree_negation(E.zero())                                       # needs sage.modules
          0

          >>> P = GradedModulesWithBasis(ZZ).example(); P                       # needs sage.combinat sage.modules
          An example of a graded module with basis:
           the free module on partitions over Integer Ring
          >>> pbp = lambda x: P.basis()[Partition(list(x))]
          >>> p = pbp([Integer(3),Integer(1)]) - Integer(2) * pbp([Integer(2)]) + Integer(4) * pbp([Integer(1)])                      # needs sage.combinat sage.modules
          >>> P.degree_negation(p)                                              # needs sage.combinat sage.modules
          -4*P[1] - 2*P[2] + P[3, 1]

    quotient_module(submodule, check=True, already_echelonized=False, category=None)

      Construct the quotient module `self` / `submodule`.

      INPUT:

      - `submodule` – a submodule with basis of `self`, or something that can be turned into one via `self.submodule(submodule)`

      - `check`, `already_echelonized` – passed down to `ModulesWithBasis.ParentMethods.submodule()`

      - `category` – (optional) the category of the quotient module

      Warning

      At this point, this only supports quotients by free submodules admitting a basis in unitriangular echelon form. In this case, the quotient is also a free module, with a basis consisting of the retract of a subset of the basis of `self`.

      EXAMPLES:

      Sage

          sage: # needs sage.combinat sage.modules
          sage: E.<x,y,z> = ExteriorAlgebra(QQ)
          sage: S = E.submodule([x + y, x*y - y*z, y])
          sage: Q = E.quotient_module(S)
          sage: Q.category()
          Join of
           Category of quotients of graded modules with basis over Rational Field and
           Category of graded vector spaces with basis over Rational Field and
           Category of finite dimensional filtered modules with basis over Rational Field

      Python

          >>> from sage.all import *
          >>> # needs sage.combinat sage.modules
          >>> E = ExteriorAlgebra(QQ, names=('x', 'y', 'z',)); (x, y, z,) = E._first_ngens(3)
          >>> S = E.submodule([x + y, x*y - y*z, y])
          >>> Q = E.quotient_module(S)
          >>> Q.category()
          Join of
           Category of quotients of graded modules with basis over Rational Field and
           Category of graded vector spaces with basis over Rational Field and
           Category of finite dimensional filtered modules with basis over Rational Field

      See also

      - `Modules.WithBasis.ParentMethods.submodule()`

      - `Rings.ParentMethods.quotient()`

      - `sage.modules.with_basis.subquotient.QuotientModuleWithBasis`

    submodule(gens, check=True, already_echelonized=False, unitriangular=False, support_order=None, category=None, *args, **opts)

      Return the submodule spanned by a finite set of elements.

      INPUT:

      - `gens` – list or family of elements of `self`

      - `check` – boolean (default: `True`); whether to verify that the elements of `gens` are in `self`

      - `already_echelonized` – boolean (default: `False`); whether

          the elements of `gens` are already in (not necessarily reduced) echelon form

      - `unitriangular` – boolean (default: `False`); whether the lift morphism is unitriangular

      - `support_order` – (optional) either something that can be converted into a tuple or a key function

      - `category` – (optional) the category of the submodule

      If `already_echelonized` is `False`, then the generators are put in reduced echelon form using `echelonize()`, and reindexed by \(0,1,...\).

      Warning

      At this point, this method only works for finite dimensional submodules and if matrices can be echelonized over the base ring.

      If in addition `unitriangular` is `True`, then the generators are made such that the coefficients of the pivots are 1, so that lifting map is unitriangular.

      The basis of the submodule uses the same index set as the generators, and the lifting map sends \(y_i\) to \(gens[i]\).

      See also

      - `ModulesWithBasis.FiniteDimensional.ParentMethods.quotient_module()`

      - `sage.modules.with_basis.subquotient.SubmoduleWithBasis`

      EXAMPLES:

      A graded submodule of a graded module generated by homogeneous elements is naturally graded:

      Sage

          sage: # needs sage.combinat sage.modules
          sage: E.<x,y,z> = ExteriorAlgebra(QQ)
          sage: S = E.submodule([x + y, x*y - y*z])
          sage: S.category()
          Join of
           Category of graded vector spaces with basis over Rational Field and
           Category of subobjects of filtered modules with basis over Rational Field and
           Category of finite dimensional filtered modules with basis over Rational Field
          sage: S.basis()[0].degree()
          1
          sage: S.basis()[1].degree()
          2

      Python

          >>> from sage.all import *
          >>> # needs sage.combinat sage.modules
          >>> E = ExteriorAlgebra(QQ, names=('x', 'y', 'z',)); (x, y, z,) = E._first_ngens(3)
          >>> S = E.submodule([x + y, x*y - y*z])
          >>> S.category()
          Join of
           Category of graded vector spaces with basis over Rational Field and
           Category of subobjects of filtered modules with basis over Rational Field and
           Category of finite dimensional filtered modules with basis over Rational Field
          >>> S.basis()[Integer(0)].degree()
          1
          >>> S.basis()[Integer(1)].degree()
          2

      We check on the echelonized basis:

      Sage

          sage: Sp = E.submodule([1, x + y + 5, x*y - y*z + x + y - 2])           # needs sage.combinat sage.modules
          sage: Sp.category()                                                     # needs sage.combinat sage.modules
          Join of
           Category of graded vector spaces with basis over Rational Field and
           Category of subobjects of filtered modules with basis over Rational Field and
           Category of finite dimensional filtered modules with basis over Rational Field

      [Python]

          >>> from sage.all import *
          >>> Sp = E.submodule([Integer(1), x + y + Integer(5), x*y - y*z + x + y - Integer(2)])           # needs sage.combinat sage.modules
          >>> Sp.category()                                                     # needs sage.combinat sage.modules
          Join of
           Category of graded vector spaces with basis over Rational Field and
           Category of subobjects of filtered modules with basis over Rational Field and
           Category of finite dimensional filtered modules with basis over Rational Field

      If it is generated by inhomogeneous elements, then it is filtered by default:

      Sage

          sage: F = E.submodule([x + y*z, x*z + y*x])                             # needs sage.combinat sage.modules
          sage: F.category()                                                      # needs sage.combinat sage.modules
          Join of
           Category of subobjects of filtered modules with basis over Rational Field and
           Category of finite dimensional filtered modules with basis over Rational Field and
           Category of filtered vector spaces with basis over Rational Field

      Python

          >>> from sage.all import *
          >>> F = E.submodule([x + y*z, x*z + y*x])                             # needs sage.combinat sage.modules
          >>> F.category()                                                      # needs sage.combinat sage.modules
          Join of
           Category of subobjects of filtered modules with basis over Rational Field and
           Category of finite dimensional filtered modules with basis over Rational Field and
           Category of filtered vector spaces with basis over Rational Field

      If `category` is specified, then it does not give any extra structure to the submodule (we can think of this as applying the forgetful functor):

      Sage

          sage: # needs sage.combinat sage.modules
          sage: SM = E.submodule([x + y, x*y - y*z],
          ....:                  category=ModulesWithBasis(QQ))
          sage: SM.category()
          Join of
           Category of finite dimensional vector spaces with basis over Rational Field and
           Category of subobjects of sets
          sage: FM = E.submodule([x + 1, x*y - x*y*z],
          ....:                  category=ModulesWithBasis(QQ))
          sage: FM.category()
          Join of
           Category of finite dimensional vector spaces with basis over Rational Field and
           Category of subobjects of sets

      [Python]

          >>> from sage.all import *
          >>> # needs sage.combinat sage.modules
          >>> SM = E.submodule([x + y, x*y - y*z],
          ...                  category=ModulesWithBasis(QQ))
          >>> SM.category()
          Join of
           Category of finite dimensional vector spaces with basis over Rational Field and
           Category of subobjects of sets
          >>> FM = E.submodule([x + Integer(1), x*y - x*y*z],
          ...                  category=ModulesWithBasis(QQ))
          >>> FM.category()
          Join of
           Category of finite dimensional vector spaces with basis over Rational Field and
           Category of subobjects of sets

      If we have specified that this is a graded submodule of a graded module, then the echelonized elements must be homogeneous:

      Sage

          sage: Cat = ModulesWithBasis(QQ).Graded().Subobjects()
          sage: E.submodule([x + y, x*y - 1], category=Cat)                       # needs sage.combinat sage.modules
          Traceback (most recent call last):
          ...
          ValueError: all of the generators must be homogeneous
          sage: E.submodule([x + y, x*y - x - y], category=Cat)                   # needs sage.combinat sage.modules
          Free module generated by {0, 1} over Rational Field

      Python

          >>> from sage.all import *
          >>> Cat = ModulesWithBasis(QQ).Graded().Subobjects()
          >>> E.submodule([x + y, x*y - Integer(1)], category=Cat)                       # needs sage.combinat sage.modules
          Traceback (most recent call last):
          ...
          ValueError: all of the generators must be homogeneous
          >>> E.submodule([x + y, x*y - x - y], category=Cat)                   # needs sage.combinat sage.modules
          Free module generated by {0, 1} over Rational Field

  class Quotients(category, *args)

    Bases: `QuotientsCategory`

    class ElementMethods

      Bases: `object`

      degree()

        Return the degree of `self`.

        EXAMPLES:

        Sage

            sage: # needs sage.combinat sage.modules
            sage: E.<x,y,z> = ExteriorAlgebra(QQ)
            sage: S = E.submodule([x + y, x*y - y*z, y])
            sage: Q = E.quotient_module(S)
            sage: B = Q.basis()
            sage: [B[i].lift() for i in Q.indices()]
            [1, z, x*z, y*z, x*y*z]
            sage: [B[i].degree() for i in Q.indices()]
            [0, 1, 2, 2, 3]

        Python

            >>> from sage.all import *
            >>> # needs sage.combinat sage.modules
            >>> E = ExteriorAlgebra(QQ, names=('x', 'y', 'z',)); (x, y, z,) = E._first_ngens(3)
            >>> S = E.submodule([x + y, x*y - y*z, y])
            >>> Q = E.quotient_module(S)
            >>> B = Q.basis()
            >>> [B[i].lift() for i in Q.indices()]
            [1, z, x*z, y*z, x*y*z]
            >>> [B[i].degree() for i in Q.indices()]
            [0, 1, 2, 2, 3]

    class ParentMethods

      Bases: `object`

      degree_on_basis(m)

        Return the degree of the basis element indexed by `m` in `self`.

        EXAMPLES:

        Sage

            sage: # needs sage.combinat sage.modules
            sage: E.<x,y,z> = ExteriorAlgebra(QQ)
            sage: S = E.submodule([x + y, x*y - y*z, y])
            sage: Q = E.quotient_module(S)
            sage: B = Q.basis()
            sage: [B[i].lift() for i in Q.indices()]
            [1, z, x*z, y*z, x*y*z]
            sage: [Q.degree_on_basis(i) for i in Q.indices()]
            [0, 1, 2, 2, 3]

        Python

            >>> from sage.all import *
            >>> # needs sage.combinat sage.modules
            >>> E = ExteriorAlgebra(QQ, names=('x', 'y', 'z',)); (x, y, z,) = E._first_ngens(3)
            >>> S = E.submodule([x + y, x*y - y*z, y])
            >>> Q = E.quotient_module(S)
            >>> B = Q.basis()
            >>> [B[i].lift() for i in Q.indices()]
            [1, z, x*z, y*z, x*y*z]
            >>> [Q.degree_on_basis(i) for i in Q.indices()]
            [0, 1, 2, 2, 3]