Fast Rank Two Crystals#

class sage.combinat.crystals.fast_crystals.FastCrystal(ct, shape, format)[source]#

Bases: UniqueRepresentation, Parent

An alternative implementation of rank 2 crystals. The root operators are implemented in memory by table lookup. This means that in comparison with the CrystalsOfTableaux, these crystals are slow to instantiate but faster for computation. Implemented for types \(A_2\), \(B_2\), and \(C_2\).

INPUT:

  • cartan_type – the Cartan type and must be either type \(A_2\), \(B_2\), or \(C_2\)

  • shape – A shape is of the form [l1,l2] where l1 and l2 are either integers or (in type \(B_2\)) half integers such that l1 - l2 is integral. It is assumed that l1 >= l2 >= 0. If l1 and l2` are integers, this will produce a crystal isomorphic to the one obtained by ``crystals.Tableaux(type, shape=[l1,l2]). Furthermore crystals.FastRankTwo(['B', 2], l1+1/2, l2+1/2) produces a crystal isomorphic to the following crystal T:

    sage: C = crystals.Tableaux(['B',2], shape=[l1,l2])               # not tested
    sage: D = crystals.Spins(['B',2])                                 # not tested
    sage: T = crystals.TensorProduct(C, D, C.list()[0], D.list()[0])  # not tested
    
    >>> from sage.all import *
    >>> C = crystals.Tableaux(['B',Integer(2)], shape=[l1,l2])               # not tested
    >>> D = crystals.Spins(['B',Integer(2)])                                 # not tested
    >>> T = crystals.TensorProduct(C, D, C.list()[Integer(0)], D.list()[Integer(0)])  # not tested
    
  • format – (default: 'string') the default representation of elements is in term of theBerenstein-Zelevinsky-Littelmann (BZL) strings [a1, a2, ...] described under metapost in crystals. Alternative representations may be obtained by the options 'dual_string' or 'simple'. In the 'simple' format, the element is represented by and integer, and in the 'dual_string' format, it is represented by the BZL string, but the underlying decomposition of the long Weyl group element into simple reflections is changed.

class Element(parent, value, format)[source]#

Bases: Element

EXAMPLES:

sage: C = crystals.FastRankTwo(['A',2],shape=[2,1])
sage: c = C(0); c
[0, 0, 0]
sage: C[0].parent()
The fast crystal for A2 with shape [2,1]
sage: TestSuite(c).run()
>>> from sage.all import *
>>> C = crystals.FastRankTwo(['A',Integer(2)],shape=[Integer(2),Integer(1)])
>>> c = C(Integer(0)); c
[0, 0, 0]
>>> C[Integer(0)].parent()
The fast crystal for A2 with shape [2,1]
>>> TestSuite(c).run()
e(i)[source]#

Return the action of \(e_i\) on self.

EXAMPLES:

sage: C = crystals.FastRankTwo(['A',2],shape=[2,1])
sage: C(1).e(1)
[0, 0, 0]
sage: C(0).e(1) is None
True
>>> from sage.all import *
>>> C = crystals.FastRankTwo(['A',Integer(2)],shape=[Integer(2),Integer(1)])
>>> C(Integer(1)).e(Integer(1))
[0, 0, 0]
>>> C(Integer(0)).e(Integer(1)) is None
True
f(i)[source]#

Return the action of \(f_i\) on self.

EXAMPLES:

sage: C = crystals.FastRankTwo(['A',2],shape=[2,1])
sage: C(6).f(1)
[1, 2, 1]
sage: C(7).f(1) is None
True
>>> from sage.all import *
>>> C = crystals.FastRankTwo(['A',Integer(2)],shape=[Integer(2),Integer(1)])
>>> C(Integer(6)).f(Integer(1))
[1, 2, 1]
>>> C(Integer(7)).f(Integer(1)) is None
True
weight()[source]#

Return the weight of self.

EXAMPLES:

sage: [v.weight() for v in crystals.FastRankTwo(['A',2], shape=[2,1])]
[(2, 1, 0), (1, 2, 0), (1, 1, 1), (1, 0, 2), (0, 1, 2), (2, 0, 1), (1, 1, 1), (0, 2, 1)]
sage: [v.weight() for v in crystals.FastRankTwo(['B',2], shape=[1,0])]
[(1, 0), (0, 1), (0, 0), (0, -1), (-1, 0)]
sage: [v.weight() for v in crystals.FastRankTwo(['B',2], shape=[1/2,1/2])]
[(1/2, 1/2), (1/2, -1/2), (-1/2, 1/2), (-1/2, -1/2)]
sage: [v.weight() for v in crystals.FastRankTwo(['C',2], shape=[1,0])]
[(1, 0), (0, 1), (0, -1), (-1, 0)]
sage: [v.weight() for v in crystals.FastRankTwo(['C',2], shape=[1,1])]
[(1, 1), (1, -1), (0, 0), (-1, 1), (-1, -1)]
>>> from sage.all import *
>>> [v.weight() for v in crystals.FastRankTwo(['A',Integer(2)], shape=[Integer(2),Integer(1)])]
[(2, 1, 0), (1, 2, 0), (1, 1, 1), (1, 0, 2), (0, 1, 2), (2, 0, 1), (1, 1, 1), (0, 2, 1)]
>>> [v.weight() for v in crystals.FastRankTwo(['B',Integer(2)], shape=[Integer(1),Integer(0)])]
[(1, 0), (0, 1), (0, 0), (0, -1), (-1, 0)]
>>> [v.weight() for v in crystals.FastRankTwo(['B',Integer(2)], shape=[Integer(1)/Integer(2),Integer(1)/Integer(2)])]
[(1/2, 1/2), (1/2, -1/2), (-1/2, 1/2), (-1/2, -1/2)]
>>> [v.weight() for v in crystals.FastRankTwo(['C',Integer(2)], shape=[Integer(1),Integer(0)])]
[(1, 0), (0, 1), (0, -1), (-1, 0)]
>>> [v.weight() for v in crystals.FastRankTwo(['C',Integer(2)], shape=[Integer(1),Integer(1)])]
[(1, 1), (1, -1), (0, 0), (-1, 1), (-1, -1)]
cmp_elements(x, y)[source]#

Return True if and only if there is a path from x to y in the crystal graph.

Because the crystal graph is classical, it is a directed acyclic graph which can be interpreted as a poset. This function implements the comparison function of this poset.

EXAMPLES:

sage: C = crystals.FastRankTwo(['A',2],shape=[2,1])
sage: x = C(0)
sage: y = C(1)
sage: C.cmp_elements(x,y)
-1
sage: C.cmp_elements(y,x)
1
sage: C.cmp_elements(x,x)
0
>>> from sage.all import *
>>> C = crystals.FastRankTwo(['A',Integer(2)],shape=[Integer(2),Integer(1)])
>>> x = C(Integer(0))
>>> y = C(Integer(1))
>>> C.cmp_elements(x,y)
-1
>>> C.cmp_elements(y,x)
1
>>> C.cmp_elements(x,x)
0
digraph()[source]#

Return the digraph associated to self.

EXAMPLES:

sage: C = crystals.FastRankTwo(['A',2],shape=[2,1])
sage: C.digraph()
Digraph on 8 vertices
>>> from sage.all import *
>>> C = crystals.FastRankTwo(['A',Integer(2)],shape=[Integer(2),Integer(1)])
>>> C.digraph()
Digraph on 8 vertices