Bases: object
Abstract base class for parents whose elements consist of generators indexed by an arbitrary set.
Options controlling the printing of elements:
Note
These print options may also be accessed and modified using the print_options() method, after the parent has been defined.
EXAMPLES:
We demonstrate a variety of the input options:
sage: from sage.structure.indexed_generators import IndexedGenerators
sage: I = IndexedGenerators(ZZ, prefix='A')
sage: I._repr_generator(2)
'A[2]'
sage: I._latex_generator(2)
'A_{2}'
sage: I = IndexedGenerators(ZZ, bracket='(')
sage: I._repr_generator(2)
'x(2)'
sage: I._latex_generator(2)
'x_{2}'
sage: I = IndexedGenerators(ZZ, prefix="", latex_bracket='(')
sage: I._repr_generator(2)
'[2]'
sage: I._latex_generator(2)
\left( 2 \right)
sage: I = IndexedGenerators(ZZ, bracket=['|', '>'])
sage: I._repr_generator(2)
'x|2>'
Return the indices of self.
EXAMPLES:
sage: F = CombinatorialFreeModule(QQ, ['a', 'b', 'c'])
sage: F.indices()
{'a', 'b', 'c'}
Return the prefix used when displaying elements of self.
EXAMPLES:
sage: F = CombinatorialFreeModule(QQ, ['a', 'b', 'c'])
sage: F.prefix()
'B'
sage: X = SchubertPolynomialRing(QQ)
sage: X.prefix()
'X'
Return the current print options, or set an option.
INPUT: all of the input is optional; if present, it should be in the form of keyword pairs, such as latex_bracket='('. The allowable keywords are:
See the documentation for CombinatorialFreeModule for descriptions of the effects of setting each of these options.
OUTPUT: if the user provides any input, set the appropriate option(s) and return nothing. Otherwise, return the dictionary of settings for print and LaTeX representations.
EXAMPLES:
sage: F = CombinatorialFreeModule(ZZ, [1,2,3], prefix='x')
sage: F.print_options()
{...'prefix': 'x'...}
sage: F.print_options(bracket='(')
sage: F.print_options()
{...'bracket': '('...}
TESTS:
sage: sorted(F.print_options().items())
[('bracket', '('), ('generator_cmp', <built-in function cmp>),
('latex_bracket', False), ('latex_prefix', None),
('latex_scalar_mult', None), ('prefix', 'x'),
('scalar_mult', '*'), ('tensor_symbol', None)]
sage: F.print_options(bracket='[') # reset