Ticket #12645: trac_12645-fix_rst_markup-sk.patch

File trac_12645-fix_rst_markup-sk.patch, 12.6 KB (added by nthiery, 8 years ago)
  • doc/en/reference/combinat/symmetric_functions.rst

    # HG changeset patch
    # User Simon King <simon.king@uni-jena.de>
    # Date 1331304426 -3600
    # Node ID 7653d2fd417636a0ae1400009dcfd95457e92e96
    # Parent  d296d66e789b4c918cf959ad3a06f4343eda6625
    #12645: Fix rst markup in sage.combinat.sf.sf and sage.structure.dynamic_class
    
    diff --git a/doc/en/reference/combinat/symmetric_functions.rst b/doc/en/reference/combinat/symmetric_functions.rst
    a b Symmetric Functions 
    55   :maxdepth: 2
    66
    77   ../sage/combinat/sf/sfa
     8   ../sage/combinat/sf/sf
    89   ../sage/combinat/sf/classical
    910   ../sage/combinat/sf/schur
    1011   ../sage/combinat/sf/monomial
    Symmetric Functions 
    2021   ../sage/combinat/sf/kschur
    2122   ../sage/combinat/sf/llt
    2223   ../sage/combinat/sf/macdonald
    23    ../sage/combinat/sf/ns_macdonald
    24  No newline at end of file
     24   ../sage/combinat/sf/ns_macdonald
  • sage/combinat/sf/sf.py

    diff --git a/sage/combinat/sf/sf.py b/sage/combinat/sf/sf.py
    a b  
     1"""
     2Symmetric functions, with their multiple realizations
     3"""
    14from sage.structure.parent import Parent
    25from sage.structure.unique_representation import UniqueRepresentation
    36from sage.categories.all import Rings, GradedHopfAlgebrasWithBasis, ModulesWithBasis
    class SymmetricFunctions(UniqueRepresent 
    1922        sage: Sym
    2023        Symmetric Functions over Rational Field
    2124
    22     Todo: add one example of non trivial computation, and then proceed
    23     with the detailed explanations
     25    .. todo::
     26       
     27        Add one example of non trivial computation, and then proceed
     28        with the detailed explanations.
    2429
    25     Todo: expand this tutorial, merging with that of ``MuPAD-Combinat``
     30    .. todo::
     31       
     32        Expand this tutorial, merging with that of ``MuPAD-Combinat``
     33
     34    ::
    2635
    2736        sage: h = Sym.h(); e = Sym.e(); s = Sym.s(); m = Sym.m(); p = Sym.p()
    2837        sage: ( ( h[2,1] * ( 1 + 3 * h[2,1]) ) + s[2]. antipode()) . coproduct() # todo: not implemented
    class SymmetricFunctions(UniqueRepresent 
    8089        p[2, 1, 1]
    8190
    8291    Badly enough, due to a limitation in Python syntax, one cannot use::
     92
    8393        sage: p[]       # todo: not implemented
    8494
    8595    Please use instead::
     96
    8697        sage: p[[]]
    8798        p[]
    8899
    class SymmetricFunctions(UniqueRepresent 
    90101
    91102        sage: p[2,1,1] + 2 * (p[4] + p[2,1])
    92103        2*p[2, 1] + p[2, 1, 1] + 2*p[4]
    93    
    94     ..topic: Algebra structure
     104
     105    .. rubric:: Algebra structure
    95106
    96107    Let us explore the other operations of p. First, we can ask for
    97     the mathematical properties of p:
     108    the mathematical properties of p::
    98109
    99110        sage: p.categories() # todo: not implemented
    100111        [The category of multiplicative bases on primitive elements of Sym,
    class SymmetricFunctions(UniqueRepresent 
    122133        sage: (p.one() + 2 * p[3,1]) * p[4, 2]
    123134        p[4, 2] + 2*p[4, 3, 2, 1]
    124135
    125     ..topic: Hopf algebra structure
     136    .. rubric:: Hopf algebra structure
    126137
    127138    p is further endowed with a coalgebra algebra structure (in
    128139    fact, it is, up to isomorphism, the unique free algebra on
    class SymmetricFunctions(UniqueRepresent 
    136147        p[] # p[2] + p[2] # p[]
    137148
    138149    The coproduct being cocommutative on the generators is cocommutative everywhere::
     150
    139151        sage: p[2, 1].coproduct()       # todo: not implemented
    140152        p[] # p[2, 1] + p[1] # p[2] + p[2, 1] # p[] + p[2] # p[1]
    141153
    142154    The antipode is an anti-algebra morphism (Todo: explain what it
    143     is); on the p basis, it sends the generators to their opposite:
     155    is); on the p basis, it sends the generators to their opposite::
    144156
    145157        sage: p[3].antipode()           # todo: not implemented
    146158        -p[3]
    147159        sage: p[1,3,2].antipode()       # todo: not implemented
    148160        -p[2, 3, 1]
    149161
    150     ..topic: Other concrete representations
     162    .. rubric:: Other concrete representations
    151163
    152     Todo: demonstrate how to customize the basis names
     164    .. todo::
     165       
     166        Demonstrate how to customize the basis names.
    153167
    154168    Sym admits many other concrete representations::
    155169
    class SymmetricFunctions(UniqueRepresent 
    159173        sage: m = Sym.monomial()
    160174        sage: f = Sym.forgotten()       # todo: not implemented
    161175
    162     To change from one basis to another, one simply does:
     176    To change from one basis to another, one simply does::
    163177
    164178        sage: m(p[3])
    165179        m[3]
    166180        sage: m(p[3,2])
    167181        m[3, 2] + m[5]
    168182
    169     In general, one can mix up different basis in computations:
     183    In general, one can mix up different basis in computations::
    170184
    171185        sage: p( m[1] * ( e[3]*s[2] + 1 ))
    172186        p[1] + 1/12*p[1, 1, 1, 1, 1, 1] - 1/6*p[2, 1, 1, 1, 1] - 1/4*p[2, 2, 1, 1] + 1/6*p[3, 1, 1, 1] + 1/6*p[3, 2, 1]
    class SymmetricFunctions(UniqueRepresent 
    178192        sage: P = Jack.P(); J = Jack.J(); Q = Jack.Q()  # todo: not implemented
    179193        sage: J(P[2,1])                                 # todo: not implemented
    180194
    181     t can be specialized as follow::
     195    It can be specialized as follow::
    182196
    183197        sage: Sym = SymmetricFunctions(QQ)
    184198        sage: Jack = Sym.jack_polynomials(t = 1)        # todo: not implemented
    185199        sage: P = Jack.P(); J = Jack.J(); Q = Jack.Q()  # todo: not implemented
    186200        sage: J(P[2,1])                                 # todo: not implemented
    187201
    188     Todo: introduce a field with degree 1 elements as in
    189     MuPAD-Combinat, to get proper plethysm.
     202    .. todo::
     203
     204        Introduce a field with degree 1 elements as in
     205        MuPAD-Combinat, to get proper plethysm.
    190206
    191207    Similarly one can get Hall-Littlewood, Macdonald polynomials, etc::
    192208
    class SymmetricFunctions(UniqueRepresent 
    195211        sage: P = Mcd.P(); J = Mcd.J(); Q = Mcd.Q()     # todo: not implemented
    196212        sage: J(P[2,1])                                 # todo: not implemented
    197213
    198     Further things to do:
    199      - Use UniqueRepresentation to get rid of all the manual cache handling for the bases
    200      - Devise a mechanism so that pickling bases of symmetric functions pickles
    201        the coercions which have a cache.
     214    .. todo::
    202215
     216        - Use UniqueRepresentation to get rid of all the manual cache
     217          handling for the bases
     218        - Devise a mechanism so that pickling bases of symmetric
     219          functions pickles the coercions which have a cache.
     220        - Use #7980 to handle the multiple realizations
    203221    """
    204222
    205223    def __init__(self, R):
    class SymmetricFunctions(UniqueRepresent 
    309327
    310328        We override the canonical coercion from the Schur basis to the
    311329        powersum basis by a (stupid!) map `s_\lambda\mapsto 2p_\lambda`.
     330        ::
    312331
    313332            sage: Sym = SymmetricFunctions(QQ['zorglub']) # make sure we are not going to screw up later tests
    314333            sage: s = Sym.s(); p = Sym.p().dual_basis()
    class SymmetricFunctions(UniqueRepresent 
    333352
    334353        INPUT:
    335354
    336          - shorthands - a list (or iterable) of strings (default: ['e', 'h', 'm', 'p', 's'])
     355        - ``shorthands`` -- a list (or iterable) of strings (default: ['e', 'h', 'm', 'p', 's'])
    337356
    338357        EXAMPLES::
    339358
    class SymmetricaConversionOnBasis: 
    415434        """
    416435        INPUT:
    417436
    418          - t -- a function taking a monomial in CombinatorialFreeModule(QQ, Partitions()), and returning a
    419            (partition, coefficient) list.
     437        - ``t`` -- a function taking a monomial in CombinatorialFreeModule(QQ, Partitions()),
     438           and returning a (partition, coefficient) list.
    420439
    421          - ``domain``, ``codomain`` -- parents
     440        - ``domain``, ``codomain`` -- parents
    422441
    423442        Construct a function mapping a partition to an element of ``codomain``.
    424443
    425444        This is a temporary quick hack to wrap around the existing
    426445        symmetrica conversions, without changing their specs.
    427446
    428         EXAMPLES:
     447        EXAMPLES::
    429448
    430449            sage: Sym = SymmetricFunctions(QQ[x])
    431450            sage: p = Sym.p(); s = Sym.s()
  • sage/structure/dynamic_class.py

    diff --git a/sage/structure/dynamic_class.py b/sage/structure/dynamic_class.py
    a b  
    11"""
    22Dynamic classes
    33
    4 ..topic: Why dynamic classes?
     4.. rubric:: Why dynamic classes?
    55
    66The short answer:
    77
    parent, but we won't discuss this point  
    2222choose a data structure for the permutations, typically among the
    2323following:
    2424
    25  - Stored by cycle type
    26  - Stored by code
    27  - Stored in list notation
    28    - C arrays of short ints (for small permutations)
    29    - python lists of ints (for huge permutations)
    30    - ...
    31  - Stored by reduced word
    32  - Stored as a function
    33  - ...
     25- Stored by cycle type
     26- Stored by code
     27- Stored in list notation
     28  - C arrays of short ints (for small permutations)
     29  - python lists of ints (for huge permutations)
     30  - ...
     31- Stored by reduced word
     32- Stored as a function
     33- ...
    3434
    3535Luckily, the Sage library provides (or will provide) classes
    3636implementing each of those data structures. Those classes all share a
    just derive our class from the chosen on 
    4242
    4343Then we may want to further choose a specific memory behavior (unique
    4444representation, copy-on-write) which (hopefuly) can again be achieved
    45 by inheritance.
     45by inheritance::
    4646
    4747    class MyPermutation(UniqueRepresentation, PermutationCycleType):
    4848         ...
    by inheritance. 
    5050Finaly, we may want to endow the permutations in `S` with further
    5151operations coming from the (algebraic) structure of `S`:
    5252
    53  - group operations
    54  - or just monoid operations (for a subset of permutations not stable by inverse)
    55  - poset operations (for left/right/Bruhat order)
    56  - word operations (searching for substrings, patterns, ...)
     53- group operations
     54- or just monoid operations (for a subset of permutations not stable by inverse)
     55- poset operations (for left/right/Bruhat order)
     56- word operations (searching for substrings, patterns, ...)
    5757
    5858Or any combination thereof. Now, our class typically looks like::
    5959
    time. Let us take another standard const 
    7878Depending on the structure of `B` and `C`, and possibly on further
    7979options passed down by the user, `A` may be:
    8080
    81  - an enumerated set
    82  - a group
    83  - an algebra
    84  - a poset
    85  - ...
     81- an enumerated set
     82- a group
     83- an algebra
     84- a poset
     85- ...
    8686
    8787Or any combination thereof.
    8888
    tedious. Furthermore, this would require 
    9191lookup the appropriate class depending on the desired combination.
    9292
    9393Instead, one may use the ability of Python to create new classes
    94 dynamicaly:
     94dynamicaly::
    9595
    9696    type("class name", tuple of base classes, dictionary of methods)
    9797
    address. The purpose of this library is  
    100100Sage, and in particular to ensure that the constructed classes are
    101101reused whenever possible (unique representation), and can be pickled.
    102102
    103 ..topic: combining dynamic classes and Cython classes
     103.. rubric:: Combining dynamic classes and Cython classes
    104104
    105105Cython classes cannot inherit from a dynamic class (there might be
    106106some partial support for this in the future). On the other hand, such
    from sage.structure.unique_representatio 
    121121
    122122def dynamic_class(name, bases, cls = None, reduction = None, doccls=None):
    123123    r"""
    124     INPUT::
    125      - ``name``: a string
    126      - ``bases``: a tuple of classes
    127      - ``cls``: a class or None
    128      - ``reduction``: a tuple or None
    129      - ``doccls``: a class or None
     124    INPUT:
     125
     126    - ``name`` -- a string
     127    - ``bases`` -- a tuple of classes
     128    - ``cls`` -- a class or None
     129    - ``reduction`` -- a tuple or None
     130    - ``doccls`` -- a class or None
    130131
    131132    Constructs dynamically a new class ``C`` with name ``name``, and
    132133    bases ``bases``. If ``cls`` is provided, then its methods will be
    def dynamic_class(name, bases, cls = Non 
    134135    module of ``cls`` or from the first base class (``bases`` should
    135136    be non empty if ``cls` is ``None``).
    136137
    137     Documentation and source instrospection is taken from doccls, or
    138     cls if doccls is None, or bases[0] if both are None.
     138    Documentation and source instrospection is taken from ``doccls``, or
     139    ``cls`` if ``doccls`` is ``None``, or ``bases[0]`` if both are ``None``.
    139140
    140141    The constructed class can safely be pickled (assuming the
    141142    arguments themselves can).
    def dynamic_class(name, bases, cls = Non 
    143144    The result is cached, ensuring unique representation of dynamic
    144145    classes.
    145146
    146     See sage.structure.dynamic_class? for a discussion of the dynamic
    147     classes paradigm, and its relevance to Sage.
     147    See :mod:`sage.structure.dynamic_class` for a discussion of the
     148    dynamic classes paradigm, and its relevance to Sage.
    148149
    149150    EXAMPLES:
    150151