Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# -*- coding: utf-8 -*- """ Tensor Products of Crystal Elements
AUTHORS:
- Anne Schilling, Nicolas Thiery (2007): Initial version - Ben Salisbury, Travis Scrimshaw (2013): Refactored tensor products to handle non-regular crystals and created new subclass to take advantage of the regularity - Travis Scrimshaw (2017): Cythonized element classes - Franco Saliola (2017): Tensor products for crystal of super algebras """ #***************************************************************************** # Copyright (C) 2007 Anne Schilling <anne at math.ucdavis.edu> # Nicolas Thiery <nthiery at users.sf.net> # 2017 Franco Saliola <saliola@gmail.com> # 2017 Travis Scrimshaw <tcscrims at gmail.com> # # Distributed under the terms of the GNU General Public License (GPL) # # This code is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # The full text of the GPL is available at: # # http://www.gnu.org/licenses/ #**************************************************************************** from __future__ import print_function, absolute_import
from cpython.object cimport Py_LT, Py_LE, Py_EQ, Py_NE, Py_GT, Py_GE from sage.structure.parent cimport Parent
from sage.misc.cachefunc import cached_method, cached_in_parent_method from sage.functions.other import ceil from sage.combinat.tableau import Tableau from sage.rings.all import ZZ
############################################################################## # Support classes ##############################################################################
cdef class ImmutableListWithParent(ClonableArray): r""" A class for lists having a parent
Specification: any subclass ``C`` should implement ``__init__`` which accepts the following form ``C(parent, list=list)`` """ def __init__(self, Parent parent, list): """ Initialize ``self``.
TESTS::
sage: b = crystals.Tableaux(['A',2], shape=[2,1]).module_generators[0] sage: TestSuite(b).run() """
cpdef long _hash_(self) except? -1: """ Return the hash of ``self``.
TESTS::
sage: b = crystals.Tableaux(['A',2], shape=[2,1]).module_generators[0] sage: b._hash_() == hash(b) True """
def __setstate__(self, state): """ For unpickling old pickles.
EXAMPLES::
sage: T = crystals.Tableaux(['A',2], shape=[2,1]) sage: b = T.module_generators[0] sage: b.__setstate__([T, {'_list': list(b)}]) """
def reversed(self): """ Return a copy of ``self`` but in the reversed order.
EXAMPLES::
sage: b = crystals.Tableaux(['A',2], shape=[2,1]).module_generators[0] sage: list(b) [2, 1, 1] sage: list(b.reversed()) doctest:warning ... DeprecationWarning: reversed() is deprecated; use reversed(self) instead See http://trac.sagemath.org/22642 for details. [1, 1, 2] """
def set_index(self, k, value): """ Return a sibling of ``self`` obtained by setting the `k^{th}` entry of self to value.
EXAMPLES::
sage: b = crystals.Tableaux(['A',2], shape=[3]).module_generators[0] sage: list(b.set_index(0, 2)) doctest:warning ... DeprecationWarning: set_index is deprecated; use _set_index instead See http://trac.sagemath.org/22642 for details. [2, 1, 1] """
cpdef _set_index(self, k, value): r""" Return a sibling of ``self`` obtained by setting the `k^{th}` entry of self to value.
EXAMPLES::
sage: b = crystals.Tableaux(['A',2], shape=[3]).module_generators[0] sage: list(b._set_index(0, 2)) [2, 1, 1] sage: list(b._set_index(1, 4)) [1, 4, 1] """
############################################################################## # Primary classes ##############################################################################
cdef class TensorProductOfCrystalsElement(ImmutableListWithParent): r""" A class for elements of tensor products of crystals. """ def _repr_(self): """ Return a string representation of ``self``.
EXAMPLES::
sage: C = crystals.Letters(['A',3]) sage: T = crystals.TensorProduct(C,C) sage: T(C(1),C(2)) [1, 2] """
def _latex_(self): r""" Return latex code for ``self``.
EXAMPLES::
sage: C = crystals.Letters(["A",2]) sage: D = crystals.Tableaux(["A",2], shape=[2]) sage: E = crystals.TensorProduct(C,D) sage: latex(E.module_generators[0]) 1 \otimes {\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}} \raisebox{-.6ex}{$\begin{array}[b]{*{2}c}\cline{1-2} \lr{1}&\lr{1}\\\cline{1-2} \end{array}$} } """ return ' \otimes '.join(latex(c) for c in reversed(self))
def _ascii_art_(self): """ Return an ASCII art representation of ``self``.
EXAMPLES::
sage: KT = crystals.TensorProductOfKirillovReshetikhinTableaux(['D',4,1],[[3,3],[2,1],[1,2]]) sage: ascii_art(KT.module_generators[0]) 1 1 1 2 2 2 # 1 # 1 1 3 3 3 2 -4 -4 -4 """ lst = list(reversed(self)) else:
def _unicode_art_(self): """ Return a unicode art representation of ``self``.
EXAMPLES::
sage: KT = crystals.TensorProductOfKirillovReshetikhinTableaux(['D',4,1],[[3,3],[2,1],[1,2]]) sage: unicode_art(KT.module_generators[0]) ┌───┬───┬───┐ │ 1 │ 1 │ 1 │ ├───┼───┼───┤ ┌───┐ │ 2 │ 2 │ 2 │ │ 1 │ ┌───┬───┐ ├───┼───┼───┤ ⊗ ├───┤ ⊗ │ 1 │ 1 │ │ 3 │ 3 │ 3 │ │ 2 │ └───┴───┘ ├───┼───┼───┤ └───┘ │ 4̄ │ 4̄ │ 4̄ │ └───┴───┴───┘ """ lst = list(reversed(self)) else:
def _repr_diagram(self): r""" Return a string representation of ``self`` as a diagram.
EXAMPLES::
sage: C = crystals.Tableaux(['A',3], shape=[3,1]) sage: D = crystals.Tableaux(['A',3], shape=[1]) sage: E = crystals.Tableaux(['A',3], shape=[2,2,2]) sage: T = crystals.TensorProduct(C,D,E) sage: print(T.module_generators[0]._repr_diagram()) 1 1 1 (X) 1 (X) 1 1 2 2 2 3 3 """ except AttributeError: pplist.append(c._repr_().split('\n')) else: else:
def pp(self): """ Pretty print ``self``.
EXAMPLES::
sage: C = crystals.Tableaux(['A',3], shape=[3,1]) sage: D = crystals.Tableaux(['A',3], shape=[1]) sage: E = crystals.Tableaux(['A',3], shape=[2,2,2]) sage: T = crystals.TensorProduct(C,D,E) sage: T.module_generators[0].pp() 1 1 1 (X) 1 (X) 1 1 2 2 2 3 3 """
def weight(self): r""" Return the weight of ``self``.
EXAMPLES::
sage: B = crystals.infinity.Tableaux("A3") sage: T = crystals.TensorProduct(B,B) sage: b1 = B.highest_weight_vector().f_string([2,1,3]) sage: b2 = B.highest_weight_vector().f(1) sage: t = T(b2, b1) sage: t [[[1, 1, 1, 2], [2, 2], [3]], [[1, 1, 1, 1, 2], [2, 2, 4], [3]]] sage: t.weight() (-2, 1, 0, 1)
::
sage: C = crystals.Letters(['A',3]) sage: T = crystals.TensorProduct(C,C) sage: T(C(1),C(2)).weight() (1, 1, 0, 0) sage: T = crystals.Tableaux(['D',4],shape=[]) sage: T.list()[0].weight() (0, 0, 0, 0) """
def epsilon(self, i): r""" Return `\varepsilon_i` of ``self``.
INPUT:
- ``i`` -- an element of the index set
EXAMPLES::
sage: B = crystals.infinity.Tableaux("G2") sage: T = crystals.TensorProduct(B,B) sage: b1 = B.highest_weight_vector().f(2) sage: b2 = B.highest_weight_vector().f_string([2,2,1]) sage: t = T(b2, b1) sage: [t.epsilon(i) for i in B.index_set()] [0, 3] """
def phi(self, i): r""" Return `\varphi_i` of ``self``.
INPUT:
- ``i`` -- an element of the index set
EXAMPLES::
sage: La = RootSystem(['A',2,1]).weight_lattice(extended=True).fundamental_weights() sage: B = crystals.GeneralizedYoungWalls(2,La[0]+La[1]) sage: T = crystals.TensorProduct(B,B) sage: b1 = B.highest_weight_vector().f_string([1,0]) sage: b2 = B.highest_weight_vector().f_string([0,1]) sage: t = T(b2, b1) sage: [t.phi(i) for i in B.index_set()] [1, 1, 4]
TESTS:
Check that :trac:`15462` is fixed::
sage: B = crystals.Tableaux(['A',2], shape=[2,1]) sage: La = RootSystem(['A',2]).ambient_space().fundamental_weights() sage: T = crystals.TensorProduct(crystals.elementary.T(['A',2], La[1]+La[2]), B) sage: t = T.an_element() sage: t.phi(1) 2 sage: t.phi(2) 2 """
@cached_in_parent_method def _sig(self, i, k): r""" Return `a_i(k)` of ``self``.
The value `a_i(k)` of a crystal `b = b_N \otimes \cdots \otimes b_1` is defined as:
.. MATH::
a_i(k) = \varepsilon_i(b_k) - \sum_{j=1}^{k-1} \langle h_i, \mathrm{wt}(b_j) \rangle
where `\mathrm{wt}` is the :meth:`weight` of `b_j`.
INPUT:
- ``i`` -- an element of the index set
- ``k`` -- the (1-based) index of the tensor factor of ``self``
EXAMPLES::
sage: B = crystals.infinity.GeneralizedYoungWalls(3) sage: T = crystals.TensorProduct(B,B) sage: b1 = B.highest_weight_vector().f_string([0,3,1]) sage: b2 = B.highest_weight_vector().f_string([3,2,1,0,2,3]) sage: t = T(b1, b2) sage: [[t._sig(i,k) for k in range(1,len(t)+1)] for i in B.index_set()] [[0, -1], [0, 0], [0, 1], [1, 2]]
TESTS:
Check that :trac:`18469` is fixed::
sage: E1 = crystals.elementary.B(['A',2], 1) sage: E2 = crystals.elementary.B(['A',2], 2) sage: T = crystals.TensorProduct(E1, E2) sage: x = T(E1.module_generators[0], E2.module_generators[0]); x [0, 0] sage: [[x._sig(i,k) for k in range(1,3)] for i in T.index_set()] [[-inf, 0], [0, -inf]] sage: x.f(1) [-1, 0] sage: x.e(1) [1, 0] """
def e(self, i): r""" Return the action of `e_i` on ``self``.
INPUT:
- ``i`` -- an element of the index set
EXAMPLES::
sage: B = crystals.infinity.Tableaux("D4") sage: T = crystals.TensorProduct(B,B) sage: b1 = B.highest_weight_vector().f_string([1,4,3]) sage: b2 = B.highest_weight_vector().f_string([2,2,3,1,4]) sage: t = T(b2, b1) sage: t.e(1) [[[1, 1, 1, 1, 1], [2, 2, 3, -3], [3]], [[1, 1, 1, 1, 2], [2, 2, 2], [3, -3]]] sage: t.e(2) sage: t.e(3) [[[1, 1, 1, 1, 1, 2], [2, 2, 3, -4], [3]], [[1, 1, 1, 1, 2], [2, 2, 2], [3, -3]]] sage: t.e(4) [[[1, 1, 1, 1, 1, 2], [2, 2, 3, 4], [3]], [[1, 1, 1, 1, 2], [2, 2, 2], [3, -3]]] """ return None
def f(self, i): r""" Return the action of `f_i` on ``self``.
INPUT:
- ``i`` -- an element of the index set
EXAMPLES::
sage: La = RootSystem(['A',3,1]).weight_lattice(extended=True).fundamental_weights() sage: B = crystals.GeneralizedYoungWalls(3,La[0]) sage: T = crystals.TensorProduct(B,B,B) sage: b1 = B.highest_weight_vector().f_string([0,3]) sage: b2 = B.highest_weight_vector().f_string([0]) sage: b3 = B.highest_weight_vector() sage: t = T(b3, b2, b1) sage: t.f(0) [[[0]], [[0]], [[0, 3]]] sage: t.f(1) [[], [[0]], [[0, 3], [1]]] sage: t.f(2) [[], [[0]], [[0, 3, 2]]] sage: t.f(3) [[], [[0, 3]], [[0, 3]]] """ return None
cdef class TensorProductOfRegularCrystalsElement(TensorProductOfCrystalsElement): """ Element class for a tensor product of regular crystals.
TESTS::
sage: C = crystals.Letters(['A',2]) sage: T = crystals.TensorProduct(C, C) sage: elt = T(C(1), C(2)) sage: from sage.combinat.crystals.tensor_product import TensorProductOfRegularCrystalsElement sage: isinstance(elt, TensorProductOfRegularCrystalsElement) True """ def e(self, i): """ Return the action of `e_i` on ``self``.
EXAMPLES::
sage: C = crystals.Letters(['A',5]) sage: T = crystals.TensorProduct(C,C) sage: T(C(1),C(2)).e(1) == T(C(1),C(1)) True sage: T(C(2),C(1)).e(1) is None True sage: T(C(2),C(2)).e(1) == T(C(1),C(2)) True """ raise ValueError("i must be in the index set")
def f(self, i): """ Return the action of `f_i` on ``self``.
EXAMPLES::
sage: C = crystals.Letters(['A',5]) sage: T = crystals.TensorProduct(C,C) sage: T(C(1),C(1)).f(1) [1, 2] sage: T(C(1),C(2)).f(1) [2, 2] sage: T(C(2),C(1)).f(1) is None True """ raise ValueError("i must be in the index set")
def phi(self, i): r""" Return `\varphi_i` of ``self``.
EXAMPLES::
sage: C = crystals.Letters(['A',5]) sage: T = crystals.TensorProduct(C,C) sage: T(C(1),C(1)).phi(1) 2 sage: T(C(1),C(2)).phi(1) 1 sage: T(C(2),C(1)).phi(1) 0 """ else:
def epsilon(self, i): r""" Return `\varepsilon_i` of ``self``.
EXAMPLES::
sage: C = crystals.Letters(['A',5]) sage: T = crystals.TensorProduct(C,C) sage: T(C(1),C(1)).epsilon(1) 0 sage: T(C(1),C(2)).epsilon(1) 1 sage: T(C(2),C(1)).epsilon(1) 0 """ else:
cpdef position_of_last_unmatched_minus(self, i): """ Return the position of the last unmatched `-` or ``None`` if there is no unmatched `-`.
EXAMPLES::
sage: C = crystals.Letters(['A',5]) sage: T = crystals.TensorProduct(C,C) sage: T(C(2),C(1)).position_of_last_unmatched_minus(1) sage: T(C(1),C(2)).position_of_last_unmatched_minus(1) 0 """ cdef int j else:
cpdef position_of_first_unmatched_plus(self, i): """ Return the position of the first unmatched `+` or ``None`` if there is no unmatched `+`.
EXAMPLES::
sage: C = crystals.Letters(['A',5]) sage: T = crystals.TensorProduct(C,C) sage: T(C(2),C(1)).position_of_first_unmatched_plus(1) sage: T(C(1),C(2)).position_of_first_unmatched_plus(1) 1 """ cdef int j else:
# Legacy function def positions_of_unmatched_minus(self, i, dual=False, reverse=False): """ EXAMPLES::
sage: C = crystals.Letters(['A',5]) sage: T = crystals.TensorProduct(C,C) sage: T(C(2),C(1)).positions_of_unmatched_minus(1) [] sage: T(C(1),C(2)).positions_of_unmatched_minus(1) [0] """ cdef int j else: else: else:
# Legacy function def positions_of_unmatched_plus(self, i): """ EXAMPLES::
sage: C = crystals.Letters(['A',5]) sage: T = crystals.TensorProduct(C,C) sage: T(C(2),C(1)).positions_of_unmatched_plus(1) [] sage: T(C(1),C(2)).positions_of_unmatched_plus(1) [1] """
cdef class CrystalOfTableauxElement(TensorProductOfRegularCrystalsElement): """ Element in a crystal of tableaux. """ def __init__(self, parent, *args, **options): """ There are several ways to input tableaux, by rows, by columns, by columns, as the list of column elements, or as a sequence of numbers in column reading.
EXAMPLES::
sage: T = crystals.Tableaux(['A',3], shape = [2,2]) sage: t = T(rows=[[1,2],[3,4]]) sage: t [[1, 2], [3, 4]] sage: TestSuite(t).run()
sage: t = T(columns=[[3,1],[4,2]]) sage: t [[1, 2], [3, 4]] sage: TestSuite(t).run()
sage: t = T(list=[3,1,4,2]) sage: t [[1, 2], [3, 4]]
sage: t = T(3,1,4,2) sage: t [[1, 2], [3, 4]]
Currently inputting the empty tableau as an empty sequence is broken due to a bug in the generic __call__ method (see :trac:`8648`).
EXAMPLES::
sage: T = crystals.Tableaux(['A',3], shape=[]) sage: t = T() sage: list(t) [0]
TESTS:
Integer types that are not a Sage ``Integer`` (such as a Python ``int`` and typically arise from compiled code) were not converted into a letter. This caused certain functions to fail. This is fixed in :trac:`13204`::
sage: T = crystals.Tableaux(['A',3], shape = [2,2]) sage: t = T(list=[int(3),1,4,2]) sage: type(t[0]) <... 'sage.combinat.crystals.letters.Crystal_of_letters_type_A_element'> sage: t = T(list=[3,int(1),4,2]) sage: type(t[1]) <... 'sage.combinat.crystals.letters.Crystal_of_letters_type_A_element'> sage: C = crystals.KirillovReshetikhin(['A',int(3),1], 1,1) sage: C[0].e(0) [[4]] """ # the_list=Tableau(rows).to_word_by_column() else:
def _repr_(self): """ EXAMPLES::
sage: T = crystals.Tableaux(['A',3], shape = [2,2]) sage: t = T(rows=[[1,2],[3,4]]) sage: t._repr_() '[[1, 2], [3, 4]]' """
def _repr_diagram(self): """ Return a string representation of ``self`` as a diagram.
EXAMPLES::
sage: C = crystals.Tableaux(['A', 4], shape=[4,2,1]) sage: elt = C(rows=[[1,1,1,2], [2,3], [4]]) sage: print(elt._repr_diagram()) 1 1 1 2 2 3 4 """
def pp(self): """ EXAMPLES::
sage: T = crystals.Tableaux(['A',3], shape = [2,2]) sage: t = T(rows=[[1,2],[3,4]]) sage: t.pp() 1 2 3 4 """
def _ascii_art_(self): """ Return an ascii art version of ``self``.
EXAMPLES:
We check that :trac:`16486` is fixed::
sage: T = crystals.Tableaux(['B',6], shape=[1]*5) sage: ascii_art(T.module_generators[0]) 1 2 3 4 5 sage: T = crystals.Tableaux(['D',4], shape=[2,1]) sage: t = T.module_generators[0].f_string([1,2,3,4,2,2,3,4]) sage: ascii_art(t) 1 -2 -3 """
def _unicode_art_(self): """ Return a unicode art version of ``self``.
EXAMPLES::
sage: T = crystals.Tableaux(['B',4], shape=[1]*3) sage: unicode_art(T.module_generators[0]) ┌───┐ │ 1 │ ├───┤ │ 2 │ ├───┤ │ 3 │ └───┘ sage: T = crystals.Tableaux(['D',4], shape=[2,1]) sage: t = T.module_generators[0].f_string([1,2,3,4,2,2,3,4]) sage: unicode_art(t) ┌───┬───┐ │ 1 │ 2̄ │ ├───┼───┘ │ 3̄ │ └───┘ """ return Tableau([])._unicode_art_() cdef int i else:
def _latex_(self): r""" EXAMPLES::
sage: T = crystals.Tableaux(['A',3], shape = [4,2]) sage: t = T(rows=[[1,1,2,3],[2,3]]) sage: latex(t) # indirect doctest {\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}} \raisebox{-.6ex}{$\begin{array}[b]{*{4}c}\cline{1-4} \lr{1}&\lr{1}&\lr{2}&\lr{3}\\\cline{1-4} \lr{2}&\lr{3}\\\cline{1-2} \end{array}$} } """ # Modified version of to_tableau() to have the entries be letters # rather than their values return "{\\emptyset}"
else:
@cached_method def to_tableau(self): """ Return the :class:`Tableau` object corresponding to ``self``.
EXAMPLES::
sage: T = crystals.Tableaux(['A',3], shape = [2,2]) sage: t = T(rows=[[1,2],[3,4]]).to_tableau(); t [[1, 2], [3, 4]] sage: type(t) <class 'sage.combinat.tableau.Tableaux_all_with_category.element_class'> sage: type(t[0][0]) <... 'int'> sage: T = crystals.Tableaux(['D',3], shape = [1,1]) sage: t=T(rows=[[-3],[3]]).to_tableau(); t [[-3], [3]] sage: t=T(rows=[[3],[-3]]).to_tableau(); t [[3], [-3]] sage: T = crystals.Tableaux(['B',2], shape = [1,1]) sage: t = T(rows=[[0],[0]]).to_tableau(); t [[0], [0]] """ cdef int i else:
def shape(self): r""" Return the shape of the tableau corresponding to ``self``.
OUTPUT: an instance of :class:`Partition`
.. SEEALSO::
:meth:`to_tableau`
EXAMPLES::
sage: C = crystals.Tableaux(["A", 2], shape=[2,1]) sage: x = C.an_element() sage: x.to_tableau().shape() [2, 1] sage: x.shape() [2, 1]
"""
def promotion(self): """ Return the result of applying promotion on ``self``.
Promotion for type A crystals of tableaux of rectangular shape. This method only makes sense in type A with rectangular shapes.
EXAMPLES::
sage: C = crystals.Tableaux(["A",3], shape = [3,3,3]) sage: t = C(Tableau([[1,1,1],[2,2,3],[3,4,4]])) sage: t [[1, 1, 1], [2, 2, 3], [3, 4, 4]] sage: t.promotion() [[1, 1, 2], [2, 2, 3], [3, 4, 4]] sage: t.promotion().parent() The crystal of tableaux of type ['A', 3] and shape(s) [[3, 3, 3]] """
def promotion_inverse(self): """ Return the result of applying inverse promotion on ``self``.
Inverse promotion for type A crystals of tableaux of rectangular shape. This method only makes sense in type A with rectangular shapes.
EXAMPLES::
sage: C = crystals.Tableaux(["A",3], shape = [3,3,3]) sage: t = C(Tableau([[1,1,1],[2,2,3],[3,4,4]])) sage: t [[1, 1, 1], [2, 2, 3], [3, 4, 4]] sage: t.promotion_inverse() [[1, 1, 2], [2, 3, 3], [4, 4, 4]] sage: t.promotion_inverse().parent() The crystal of tableaux of type ['A', 3] and shape(s) [[3, 3, 3]] """
cdef class InfinityCrystalOfTableauxElement(CrystalOfTableauxElement): def e(self,i): r""" Return the action of `\widetilde{e}_i` on ``self``.
INPUT:
- ``i`` -- an element of the index set
EXAMPLES::
sage: B = crystals.infinity.Tableaux(['B',3]) sage: b = B(rows=[[1,1,1,1,1,1,1,2,0,-3,-1,-1,-1,-1],[2,2,2,2,-2,-2],[3,-3,-3]]) sage: b.e(3).pp() 1 1 1 1 1 1 1 2 0 -3 -1 -1 -1 -1 2 2 2 2 -2 -2 3 0 -3 sage: b.e(1).pp() 1 1 1 1 1 1 1 0 -3 -1 -1 -1 -1 2 2 2 2 -2 -2 3 -3 -3 """ raise ValueError('i is not in the index set') cdef InfinityCrystalOfTableauxElement ret # We've found a column, so we need to remove it
def f(self, i): r""" Return the action of `\widetilde{f}_i` on ``self``.
INPUT:
- ``i`` -- an element of the index set
EXAMPLES::
sage: B = crystals.infinity.Tableaux(['C',4]) sage: b = B.highest_weight_vector() sage: b.f(1).pp() 1 1 1 1 2 2 2 2 3 3 4 sage: b.f(3).pp() 1 1 1 1 1 2 2 2 2 3 3 4 4 sage: b.f(3).f(4).pp() 1 1 1 1 1 2 2 2 2 3 3 -4 4 """ raise ValueError('i is not in the index set') return None cdef InfinityCrystalOfTableauxElement ret # We've found a full column, so we'll need to add a new column
cdef class InfinityCrystalOfTableauxElementTypeD(InfinityCrystalOfTableauxElement): def e(self, i): r""" Return the action of `\widetilde{e}_i` on ``self``.
INPUT:
- ``i`` -- an element of the index set
EXAMPLES::
sage: B = crystals.infinity.Tableaux(['D',4]) sage: b = B.highest_weight_vector().f_string([1,4,3,1,2]); b.pp() 1 1 1 1 2 3 2 2 2 3 -3 sage: b.e(2).pp() 1 1 1 1 2 2 2 2 2 3 -3 """ raise ValueError('i is not in the index set') cdef InfinityCrystalOfTableauxElementTypeD ret # We've found a column, so we need to remove it
def f(self, i): r""" Return the action of `\widetilde{f}_i` on ``self``.
INPUT:
- ``i`` -- an element of the index set
EXAMPLES::
sage: B = crystals.infinity.Tableaux(['D',5]) sage: b = B.highest_weight_vector().f_string([1,4,3,1,5]); b.pp() 1 1 1 1 1 1 2 2 2 2 2 2 2 3 3 3 -5 4 5 sage: b.f(1).pp() 1 1 1 1 1 1 2 2 2 2 2 2 2 2 3 3 3 -5 4 5 sage: b.f(5).pp() 1 1 1 1 1 1 2 2 2 2 2 2 2 3 3 3 -5 4 -4 """ cdef InfinityCrystalOfTableauxElementTypeD ret # Exceptional case for f_n where we need to add a new column
##################################################################### ## BKK crystal elements
cdef class TensorProductOfSuperCrystalsElement(TensorProductOfRegularCrystalsElement): r""" Element class for a tensor product of crystals for Lie superalgebras.
This implements the tensor product rule for crystals of Lie superalgebras of [BKK2000]_.
TESTS::
sage: C = crystals.Letters(['A', [2, 1]]) sage: T = tensor([C,C]) sage: T Full tensor product of the crystals [The crystal of letters for type ['A', [2, 1]], The crystal of letters for type ['A', [2, 1]]] sage: T.cardinality() 25 sage: t = T.an_element(); t [-3, -3] sage: t.weight() (2, 0, 0, 0, 0) """
def e(self, i): r""" Return `e_i` on ``self``.
EXAMPLES::
sage: C = crystals.Letters(['A', [2, 1]]) sage: T = tensor([C,C]) sage: t = T(C(1),C(1)) sage: t.e(0) [-1, 1] """ # Otherwise i == 0
def f(self, i): r""" Return `f_i` on ``self``.
EXAMPLES::
sage: C = crystals.Letters(['A', [2, 1]]) sage: T = tensor([C,C]) sage: t = T(C(1),C(1)) sage: t.f(0) sage: t.f(1) [1, 2] """ # Otherwise i == 0
# Override epsilon/phi (for now) def epsilon(self, i): r""" Return `\varepsilon_i` on ``self``.
EXAMPLES::
sage: C = crystals.Letters(['A', [2, 1]]) sage: T = tensor([C,C]) sage: t = T(C(1),C(1)) sage: t.epsilon(0) 1 """ else:
def phi(self, i): r""" Return `\varphi_i` on ``self``.
EXAMPLES::
sage: C = crystals.Letters(['A', [2, 1]]) sage: T = tensor([C,C]) sage: t = T(C(1),C(1)) sage: t.phi(0) 0 """ else:
cdef class CrystalOfBKKTableauxElement(TensorProductOfSuperCrystalsElement): """ Element class for the crystal of tableaux for Lie superalgebras of [BKK2000]_. """ def _repr_(self): """ Return a string representation of ``self``.
EXAMPLES::
sage: C = crystals.Tableaux(['A',[1,2]], shape=[1,1]) sage: C.an_element() [[-2], [-1]] """
def _repr_diagram(self): """ Return a string representation of ``self`` as a diagram.
EXAMPLES::
sage: C = crystals.Tableaux(['A',[1,2]], shape=[1,1]) sage: c = C.an_element() sage: c._repr_diagram() ' -2\n -1' """
def pp(self): """ Pretty print ``self``.
EXAMPLES::
sage: C = crystals.Tableaux(['A',[1,2]], shape=[1,1]) sage: c = C.an_element() sage: c.pp() -2 -1 """
def _ascii_art_(self): """ Return an ascii art version of ``self``.
EXAMPLES::
sage: C = crystals.Tableaux(['A',[1,2]], shape=[1,1]) sage: c = C.an_element() sage: ascii_art(c) -2 -1 """
def _unicode_art_(self): """ Return a unicode art version of ``self``.
EXAMPLES::
sage: C = crystals.Tableaux(['A',[1,2]], shape=[1,1]) sage: c = C.an_element() sage: unicode_art(c) ┌───┐ │ 2̄ │ ├───┤ │ 1̄ │ └───┘ """
def _latex_(self): r""" Return the latex code of ``self``.
EXAMPLES::
sage: C = crystals.Tableaux(['A',[1,2]], shape=[1,1]) sage: c = C.an_element() sage: latex(c) {\def\lr#1{\multicolumn{1}{|@{\hspace{.6ex}}c@{\hspace{.6ex}}|}{\raisebox{-.3ex}{$#1$}}} \raisebox{-.6ex}{$\begin{array}[b]{*{1}c}\cline{1-1} \lr{-2}\\\cline{1-1} \lr{-1}\\\cline{1-1} \end{array}$} } """
@cached_method def to_tableau(self): """ Return the :class:`Tableau` object corresponding to ``self``.
EXAMPLES::
sage: C = crystals.Tableaux(['A',[1,2]], shape=[1,1]) sage: c = C.an_element() sage: c.to_tableau() [[-2], [-1]] sage: type(c.to_tableau()) <class 'sage.combinat.tableau.Tableaux_all_with_category.element_class'> sage: type(c) <class 'sage.combinat.crystals.bkk_crystals.CrystalOfBKKTableaux_with_category.element_class'> """
# for unpickling from sage.structure.sage_object import register_unpickle_override register_unpickle_override('sage.combinat.crystals.tensor_product', 'ImmutableListWithParent', ImmutableListWithParent)
|