Ticket #11688: trac_11688-review-ts.patch

File trac_11688-review-ts.patch, 3.4 KB (added by tscrim, 8 years ago)
  • sage/categories/examples/graded_modules_with_basis.py

    # HG changeset patch
    # User Travis Scrimshaw <tscrim@ucdavis.edu>
    # Date 1379611405 25200
    # Node ID 306113f36146d026416b22fc9d675e953993e859
    # Parent  edd12e35808b957b21a2181d5672ffde9cd445e7
    #11688: review patch
    
    diff --git a/sage/categories/examples/graded_modules_with_basis.py b/sage/categories/examples/graded_modules_with_basis.py
    a b class GradedPartitionModule(Combinatoria 
    3131      set of partitions, so it inherits all of the methods for such
    3232      objects, and has operations like addition already defined.
    3333
    34     ::
     34      ::
    3535
    36         sage: A = GradedModulesWithBasis(QQ).example()
     36          sage: A = GradedModulesWithBasis(QQ).example()
    3737
    3838    - A basis function - this module is graded by the non-negative
    3939      integers, so there is a function defined in this module,
    class GradedPartitionModule(Combinatoria 
    4141      `d` as input and returns a family of partitions representing a basis
    4242      for the algebra in degree `d`.
    4343
    44     ::
     44      ::
    4545
    46         sage: A.basis(2)
    47         Lazy family (Term map from Partitions to An example of a graded module with basis: the free module on partitions over Rational Field(i))_{i in Partitions of the integer 2}
    48         sage: A.basis(6)[Partition([3,2,1])]
    49         P[3, 2, 1]
     46          sage: A.basis(2)
     47          Lazy family (Term map from Partitions to An example of a graded module with basis: the free module on partitions over Rational Field(i))_{i in Partitions of the integer 2}
     48          sage: A.basis(6)[Partition([3,2,1])]
     49          P[3, 2, 1]
    5050
    5151    - If the algebra is called ``A``, then its basis function is
    5252      stored as ``A.basis``.  Thus the function can be used to
    class GradedPartitionModule(Combinatoria 
    5454      ``A.basis(d)``.  More precisely, call ``x`` for
    5555      each ``x`` in ``A.basis(d)``.
    5656
    57     ::
     57      ::
    5858
    59     sage: [m for m in A.basis(4)]
    60     [P[4], P[3, 1], P[2, 2], P[2, 1, 1], P[1, 1, 1, 1]]
     59          sage: [m for m in A.basis(4)]
     60          [P[4], P[3, 1], P[2, 2], P[2, 1, 1], P[1, 1, 1, 1]]
    6161
    6262    - For dealing with basis elements: :meth:`degree_on_basis`, and
    6363      :meth:`_repr_term`. The first of these defines the degree of any
    class GradedPartitionModule(Combinatoria 
    6868      print representation for monomials, which automatically produces
    6969      the print representation for general elements.
    7070
    71     ::
     71      ::
    7272
    73         sage: A.degree_on_basis(Partition([4,3]))
    74         7
    75         sage: A._repr_term(Partition([4,3]))
    76         'P[4, 3]'
     73          sage: A.degree_on_basis(Partition([4,3]))
     74          7
     75          sage: A._repr_term(Partition([4,3]))
     76          'P[4, 3]'
    7777
    7878    - There is a class for elements, which inherits from
    7979      :class:`CombinatorialFreeModuleElement
    class GradedPartitionModule(Combinatoria 
    8484      <GradedModules.Element.is_homogeneous>` method and a
    8585      :meth:`degree <GradedModules.Element.degree>` method.
    8686
    87     ::
     87      ::
    8888
    89         sage: p = A.monomial(Partition([3,2,1])); p
    90         P[3, 2, 1]
    91         sage: p.is_homogeneous()
    92         True
    93         sage: p.degree()
    94         6
     89          sage: p = A.monomial(Partition([3,2,1])); p
     90          P[3, 2, 1]
     91          sage: p.is_homogeneous()
     92          True
     93          sage: p.degree()
     94          6
    9595    """
    9696    def __init__(self, base_ring):
    9797        """