Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Merge branch 'public/combinat/fix_brauer_algebra_options-24323' of gi…
Browse files Browse the repository at this point in the history
…t://trac.sagemath.org/sage into public/combinat/fix_brauer_algebra_options-24323
  • Loading branch information
tscrim committed Apr 19, 2018
2 parents a9d274b + 64901e3 commit 3448e98
Showing 1 changed file with 54 additions and 40 deletions.
94 changes: 54 additions & 40 deletions src/sage/combinat/diagram_algebras.py
Expand Up @@ -239,40 +239,6 @@ def __init__(self, parent, d):
self._base_diagram = tuple(sorted(tuple(sorted(i)) for i in d))
super(AbstractPartitionDiagram, self).__init__(parent, self._base_diagram)

# add options to class
class options(GlobalOptions):
r"""
Set and display the global options for Brauer diagram (algebras). If no
parameters are set, then the function returns a copy of the options
dictionary.
The ``options`` to diagram algebras can be accessed as the method
:obj:`BrauerAlgebra.options` of :class:`BrauerAlgebra` and
related classes.
@OPTIONS@
EXAMPLES::
sage: R.<q> = QQ[]
sage: BA = BrauerAlgebra(2, q)
sage: E = BA([[1,2],[-1,-2]])
sage: E
B{{-2, -1}, {1, 2}}
sage: BrauerAlgebra.options.display="compact" # known bug (Trac #24323)
sage: E # known bug (Trac #24323)
B[12/12;]
sage: BrauerAlgebra.options._reset() # known bug (Trac #24323)
"""
NAME = 'Brauer diagram'
module = 'sage.combinat.diagram_algebras'
option_class='AbstractPartitionDiagram'
display = dict(default="normal",
description='Specifies how the Brauer diagrams should be printed',
values=dict(normal="Using the normal representation",
compact="Using the compact representation"),
case_sensitive=False)

def check(self):
r"""
Check the validity of the input for the diagram.
Expand Down Expand Up @@ -440,6 +406,57 @@ def __init__(self, parent, d):
"""
super(BrauerDiagram, self).__init__(parent,d)

# add options to class
class options(GlobalOptions):
r"""
Set and display the global options for Brauer diagram (algebras). If no
parameters are set, then the function returns a copy of the options
dictionary.
The ``options`` to diagram algebras can be accessed as the method
:obj:`BrauerAlgebra.options` of :class:`BrauerAlgebra` and
related classes.
@OPTIONS@
The compact representation ``[A/B;pi]`` of the Brauer algebra diagram
(see [GL1996]_) has the following components:
- ``A`` -- is a list of pairs of positive elements (upper row) that
are connected,
- ``B`` -- is a list of pairs of negative elements (lower row) that
are connected, and
- ``pi`` -- is a permutation that is to be interpreted as the relative
order of the remaining elements in the top row and the bottom row.
EXAMPLES::
sage: R.<q> = QQ[]
sage: BA = BrauerAlgebra(2, q)
sage: E = BA([[1,2],[-1,-2]])
sage: E
B{{-2, -1}, {1, 2}}
sage: BA8 = BrauerAlgebra(8, q)
sage: BA8([[1,-4],[2,4],[3,8],[-7,-2],[5,7],[6,-1],[-3,-5],[-6,-8]])
B{{-8, -6}, {-7, -2}, {-5, -3}, {-4, 1}, {-1, 6}, {2, 4}, {3, 8}, {5, 7}}
sage: BrauerAlgebra.options.display = "compact"
sage: E
B[12/12;]
sage: B{{-8, -6}, {-7, -2}, {-5, -3}, {-4, 1}, {-1, 6}, {2, 4}, {3, 8}, {5, 7}}
B[24.38.57/35.27.68;21]
sage: BrauerAlgebra.options._reset()
"""
NAME = 'Brauer diagram'
module = 'sage.combinat.diagram_algebras'
option_class='BrauerDiagram'
display = dict(default="normal",
description='Specifies how the Brauer diagrams should be printed',
values=dict(normal="Using the normal representation",
compact="Using the compact representation"),
case_sensitive=False)

def check(self):
r"""
Check the validity of the input for ``self``.
Expand Down Expand Up @@ -859,7 +876,7 @@ class BrauerDiagrams(AbstractPartitionDiagrams):
sage: bd.options._reset()
"""
Element = BrauerDiagram
options = AbstractPartitionDiagram.options
options = BrauerDiagram.options

def __init__(self, order, category=None):
r"""
Expand Down Expand Up @@ -1912,6 +1929,8 @@ def __init__(self, k, q, base_ring, prefix):
"""
SubPartitionAlgebra.__init__(self, k, q, base_ring, prefix, BrauerDiagrams(k))

options = BrauerDiagram.options

def _repr_(self):
"""
Return a string representation of ``self``.
Expand Down Expand Up @@ -2689,8 +2708,3 @@ def set_partition_composition(sp1, sp2):
# END BORROWED CODE
##########################################################################

# Deprecations from trac:18555. July 2016
from sage.misc.superseded import deprecated_function_alias
AbstractPartitionDiagram.global_options=deprecated_function_alias(18555, AbstractPartitionDiagram.options)
BrauerDiagramOptions = deprecated_function_alias(18555, AbstractPartitionDiagram.options)
BrauerDiagrams.global_options = deprecated_function_alias(18555, BrauerDiagrams.options)

0 comments on commit 3448e98

Please sign in to comment.