# Tensor Products of Crystals¶

Main entry points:

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
class sage.combinat.crystals.tensor_product.CrystalOfTableaux(cartan_type, shapes)

A class for crystals of tableaux with integer valued shapes

INPUT:

• cartan_type – a Cartan type
• shape – a partition of length at most cartan_type.rank()
• shapes – a list of such partitions

This constructs a classical crystal with the given Cartan type and highest weight(s) corresponding to the given shape(s).

If the type is $$D_r$$, the shape is permitted to have a negative value in the $$r$$-th position. Thus if the shape equals $$[s_1,\ldots,s_r]$$, then $$s_r$$ may be negative but in any case $$s_1 \geq \cdots \geq s_{r-1} \geq |s_r|$$. This crystal is related to that of shape $$[s_1,\ldots,|s_r|]$$ by the outer automorphism of $$SO(2r)$$.

If the type is $$D_r$$ or $$B_r$$, the shape is permitted to be of length $$r$$ with all parts of half integer value. This corresponds to having one spin column at the beginning of the tableau. If several shapes are provided, they currently should all or none have this property.

Crystals of tableaux are constructed using an embedding into tensor products following Kashiwara and Nakashima [KN94]. Sage’s tensor product rule for crystals differs from that of Kashiwara and Nakashima by reversing the order of the tensor factors. Sage produces the same crystals of tableaux as Kashiwara and Nakashima. With Sage’s convention, the tensor product of crystals is the same as the monoid operation on tableaux and hence the plactic monoid.

sage.combinat.crystals.crystals for general help on crystals, and in particular plotting and $$\LaTeX$$ output.

EXAMPLES:

We create the crystal of tableaux for type $$A_2$$, with highest weight given by the partition $$[2,1,1]$$:

sage: T = CrystalOfTableaux(['A',3], shape = [2,1,1])


Here is the list of its elements:

sage: T.list()
[[[1, 1], [2], [3]], [[1, 2], [2], [3]], [[1, 3], [2], [3]],
[[1, 4], [2], [3]], [[1, 4], [2], [4]], [[1, 4], [3], [4]],
[[2, 4], [3], [4]], [[1, 1], [2], [4]], [[1, 2], [2], [4]],
[[1, 3], [2], [4]], [[1, 3], [3], [4]], [[2, 3], [3], [4]],
[[1, 1], [3], [4]], [[1, 2], [3], [4]], [[2, 2], [3], [4]]]


Internally, a tableau of a given Cartan type is represented as a tensor product of letters of the same type. The order in which the tensor factors appear is by reading the columns of the tableaux left to right, top to bottom (in French notation). As an example:

sage: T = CrystalOfTableaux(['A',2], shape = [3,2])
sage: T.module_generators[0]
[[1, 1, 1], [2, 2]]
sage: T.module_generators[0]._list
[2, 1, 2, 1, 1]


To create a tableau, one can use:

sage: Tab = CrystalOfTableaux(['A',3], shape = [2,2])
sage: Tab(rows=[[1,2],[3,4]])
[[1, 2], [3, 4]]
sage: Tab(columns=[[3,1],[4,2]])
[[1, 2], [3, 4]]


Todo

FIXME:

• Do we want to specify the columns increasingly or decreasingly? That is, should this be Tab(columns = [[1,3],[2,4]])?
• Make this fully consistent with Tableau()!

We illustrate the use of a shape with a negative last entry in type $$D$$:

sage: T = CrystalOfTableaux(['D',4],shape=[1,1,1,-1])
sage: T.cardinality()
35
sage: TestSuite(T).run()


We illustrate the construction of crystals of spin tableaux when the partitions have half integer values in type $$B$$ and $$D$$:

sage: T = CrystalOfTableaux(['B',3],shape=[3/2,1/2,1/2]); T
The crystal of tableaux of type ['B', 3] and shape(s) [[3/2, 1/2, 1/2]]
sage: T.cardinality()
48
sage: T.module_generators
[[+++, [[1]]]]
sage: TestSuite(T).run()

sage: T = CrystalOfTableaux(['D',3],shape=[3/2,1/2,-1/2]); T
The crystal of tableaux of type ['D', 3] and shape(s) [[3/2, 1/2, -1/2]]
sage: T.cardinality()
20
sage: T.module_generators
[[++-, [[1]]]]
sage: TestSuite(T).run()


TESTS:

Base cases:

sage: T = CrystalOfTableaux(['A',2], shape = [])
sage: T.list()
[[]]
sage: TestSuite(T).run()

sage: T = CrystalOfTableaux(['C',2], shape = [1])
sage: T.list()
[[[1]], [[2]], [[-2]], [[-1]]]
sage: TestSuite(T).run()

sage: T = CrystalOfTableaux(['A',2], shapes = [[],[1],[2]])
sage: T.list()
[[], [[1]], [[2]], [[3]], [[1, 1]], [[1, 2]], [[2, 2]], [[1, 3]], [[2, 3]], [[3, 3]]]
sage: T.module_generators
([], [[1]], [[1, 1]])

sage: T = CrystalOfTableaux(['B',2], shape=[3])
sage: T(rows=[[1,1,0]])
[[1, 1, 0]]


Input tests:

sage: T = CrystalOfTableaux(['A',3], shape = [2,2])
sage: C = T.letters
sage: Tab(rows    = [[1,2],[3,4]])._list == [C(3),C(1),C(4),C(2)]
True
sage: Tab(columns = [[3,1],[4,2]])._list == [C(3),C(1),C(4),C(2)]
True


For compatibility with TensorProductOfCrystals() we need to accept as input the internal list or sequence of elements:

sage: Tab(list    = [3,1,4,2])._list     == [C(3),C(1),C(4),C(2)]
True
sage: Tab(3,1,4,2)._list                 == [C(3),C(1),C(4),C(2)]
True


The next example checks whether a given tableau is in fact a valid type $$C$$ tableau or not:

sage: T = CrystalOfTableaux(['C',3], shape = [2,2,2])
sage: Tab = T(rows=[[1,3],[2,-3],[3,-1]])
sage: Tab in T.list()
True
sage: Tab = T(rows=[[2,3],[3,-3],[-3,-2]])
sage: Tab in T.list()
False

Element

alias of CrystalOfTableauxElement

cartan_type()

Returns the Cartan type of the associated crystal

EXAMPLES:

sage: T = CrystalOfTableaux(['A',3], shape = [2,2])
sage: T.cartan_type()
['A', 3]

module_generator(shape)

This yields the module generator (or highest weight element) of a classical crystal of given shape. The module generator is the unique tableau with equal shape and content.

EXAMPLE:

sage: T = CrystalOfTableaux(['D',3], shape = [1,1])
sage: T.module_generator([1,1])
[[1], [2]]

sage: T = CrystalOfTableaux(['D',4],shape=[2,2,2,-2])
sage: T.module_generator(tuple([2,2,2,-2]))
[[1, 1], [2, 2], [3, 3], [-4, -4]]
sage: T.cardinality()
294
sage: T = CrystalOfTableaux(['D',4],shape=[2,2,2,2])
sage: T.module_generator(tuple([2,2,2,2]))
[[1, 1], [2, 2], [3, 3], [4, 4]]
sage: T.cardinality()
294

class sage.combinat.crystals.tensor_product.CrystalOfTableauxElement(parent, *args, **options)

Element in a crystal of tableaux.

pp()

EXAMPLES:

sage: T = CrystalOfTableaux(['A',3], shape = [2,2])
sage: t = T(rows=[[1,2],[3,4]])
sage: t.pp()
1  2
3  4

promotion()

Promotion for type A crystals of tableaux of rectangular shape

Returns the result of applying promotion on this tableau.

This method only makes sense in type A with rectangular shapes.

EXAMPLES:

sage: C = CrystalOfTableaux(["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]]

promotion_inverse()

Inverse promotion for type A crystals of tableaux of rectangular shape

Returns the result of applying inverse promotion on this tableau.

This method only makes sense in type A with rectangular shapes.

EXAMPLES:

sage: C = CrystalOfTableaux(["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]]

to_tableau()

Returns the Tableau object corresponding to self.

EXAMPLES:

sage: T = CrystalOfTableaux(['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])
<type 'int'>
sage: T = CrystalOfTableaux(['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 = CrystalOfTableaux(['B',2], shape = [1,1])
sage: t = T(rows=[[0],[0]]).to_tableau(); t
[[0], [0]]

class sage.combinat.crystals.tensor_product.CrystalOfWords

Auxiliary class to provide a call method to create tensor product elements. This class is shared with several tensor product classes and is also used in CrystalOfTableaux to allow tableaux of different tensor product structures in column-reading (and hence different shapes) to be considered elements in the same crystal.

Element

alias of TensorProductOfCrystalsElement

one_dimensional_configuration_sum(q=None, group_components=True)

Computes the one-dimensional configuration sum.

INPUT:

• q – (default: None) a variable or None; if None, a variable $$q$$ is set in the code
• group_components – (default: True) boolean; if True, then the terms are grouped by classical component

The one-dimensional configuration sum is the sum of the weights of all elements in the crystal weighted by the energy function.

EXAMPLES:

sage: K = KirillovReshetikhinCrystal(['A',2,1],1,1)
sage: T = TensorProductOfCrystals(K,K)
sage: T.one_dimensional_configuration_sum()
B[-2*Lambda[1] + 2*Lambda[2]] + (q+1)*B[-Lambda[1]] + (q+1)*B[Lambda[1] - Lambda[2]]
+ B[2*Lambda[1]] + B[-2*Lambda[2]] + (q+1)*B[Lambda[2]]
sage: R.<t> = ZZ[]
sage: T.one_dimensional_configuration_sum(t, False)
B[-2*Lambda[1] + 2*Lambda[2]] + (t+1)*B[-Lambda[1]] + (t+1)*B[Lambda[1] - Lambda[2]]
+ B[2*Lambda[1]] + B[-2*Lambda[2]] + (t+1)*B[Lambda[2]]

sage: R = RootSystem(['A',2,1])
sage: La = R.weight_space().basis()
sage: LS = CrystalOfProjectedLevelZeroLSPaths(2*La[1])
sage: LS.one_dimensional_configuration_sum() == T.one_dimensional_configuration_sum()
True


TESTS:

sage: K1 = KirillovReshetikhinCrystal(['A',2,1],1,1)
sage: K2 = KirillovReshetikhinCrystal(['A',2,1],2,1)
sage: T = TensorProductOfCrystals(K1,K2)
sage: T.one_dimensional_configuration_sum() == T.one_dimensional_configuration_sum(group_components=False)
True

class sage.combinat.crystals.tensor_product.FullTensorProductOfCrystals(crystals, **options)

Full tensor product of crystals.

cardinality()

Return the cardinality of self.

EXAMPLES:

sage: C = CrystalOfLetters(['A',2])
sage: T = TensorProductOfCrystals(C,C)
sage: T.cardinality()
9

class sage.combinat.crystals.tensor_product.FullTensorProductOfRegularCrystals(crystals, **options)

Full tensor product of regular crystals.

Element
class sage.combinat.crystals.tensor_product.ImmutableListWithParent(parent, list)

A class for lists having a parent

Specification: any subclass C should implement __init__ which accepts the following form C(parent, list = list)

EXAMPLES: We create an immutable list whose parent is the class list:

sage: from sage.combinat.crystals.tensor_product import ImmutableListWithParent, TestParent
sage: l = ImmutableListWithParent(TestParent(), [1,2,3])
sage: l._list
[1, 2, 3]
sage: l.parent()
A parent for tests
sage: l.sibling([2,1]) == ImmutableListWithParent(TestParent(), [2,1])
True
sage: l.reversed()
[3, 2, 1]
sage: l.set_index(1,4)
[1, 4, 3]

reversed()

Returns the sibling of self which is obtained by reversing the elements of self.

EXAMPLES:

sage: from sage.combinat.crystals.tensor_product import ImmutableListWithParent, TestParent
sage: l = ImmutableListWithParent(TestParent(), [1,2,3])
sage: l.reversed()
[3, 2, 1]

set_index(k, value)

Returns the sibling of self obtained by setting the $$k^{th}$$ entry of self to value.

EXAMPLES:

sage: from sage.combinat.crystals.tensor_product import ImmutableListWithParent, TestParent
sage: l = ImmutableListWithParent(TestParent(), [1,2,3])
sage: l.set_index(0,2)
[2, 2, 3]
sage: l.set_index(1,4)
[1, 4, 3]
sage: _.parent()
A parent for tests

sibling(l)

Returns an ImmutableListWithParent object whose list is l and whose parent is the same as self’s parent.

Note that the implementation of this function makes an assumption about the constructor for subclasses.

EXAMPLES:

sage: from sage.combinat.crystals.tensor_product import ImmutableListWithParent, TestParent
sage: l = ImmutableListWithParent(TestParent(), [1,2,3])
sage: m = l.sibling([2,3,4]); m
[2, 3, 4]
sage: m.parent()
A parent for tests

class sage.combinat.crystals.tensor_product.TensorProductOfCrystals

Tensor product of crystals.

Given two crystals $$B$$ and $$B'$$ of the same Cartan type, one can form the tensor product $$B \otimes B^{\prime}$$. As a set $$B \otimes B^{\prime}$$ is the Cartesian product $$B \times B^{\prime}$$. The crystal operators $$f_i$$ and $$e_i$$ act on $$b \otimes b^{\prime} \in B \otimes B^{\prime}$$ as follows:

$\begin{split}f_i(b \otimes b^{\prime}) = \begin{cases} f_i(b) \otimes b^{\prime} & \text{if } \varepsilon_i(b) \geq \varphi_i(b^{\prime}) \\ b \otimes f_i(b^{\prime}) & \text{otherwise} \end{cases}\end{split}$

and

$\begin{split}e_i(b \otimes b^{\prime}) = \begin{cases} e_i(b) \otimes b^{\prime} & \text{if } \varepsilon_i(b) > \varphi_i(b^{\prime}) \\ b \otimes e_i(b^{\prime}) & \text{otherwise.} \end{cases}\end{split}$

We also define:

\begin{split}\begin{aligned} \varphi_i(b \otimes b^{\prime}) & = \max\left( \varphi_i(b), \varphi_i(b) + \varphi_i(b^{\prime}) - \varepsilon_i(b) \right) \\ \varepsilon_i(b \otimes b^{\prime}) & = \max\left( \varepsilon_i(b^{\prime}), \varepsilon_i(b^{\prime}) + \varepsilon_i(b) - \varphi_i(b^{\prime}) \right). \end{aligned}\end{split}

Note

This is the opposite of Kashiwara’s convention for tensor products of crystals.

Since tensor products are associative $$(\mathcal{B} \otimes \mathcal{C}) \otimes \mathcal{D} \cong \mathcal{B} \otimes (\mathcal{C} \otimes \mathcal{D})$$ via the natural isomorphism $$(b \otimes c) \otimes d \mapsto b \otimes (c \otimes d)$$, we can generalizing this to arbitrary tensor products. Thus consider $$B_N \otimes \cdots \otimes B_1$$, where each $$B_k$$ is an abstract crystal. The underlying set of the tensor product is $$B_N \times \cdots \times B_1$$, while the crystal structure is given as follows. Let $$I$$ be the index set, and fix some $$i \in I$$ and $$b_N \otimes \cdots \otimes b_1 \in B_N \otimes \cdots \otimes B_1$$. Define

$a_i(k) := \varepsilon_i(b_k) - \sum_{j=1}^{k-1} \langle \alpha_i^{\vee}, \mathrm{wt}(b_j) \rangle.$

Then

\begin{split}\begin{aligned} \mathrm{wt}(b_N \otimes \cdots \otimes b_1) &= \mathrm{wt}(b_N) + \cdots + \mathrm{wt}(b_1), \\ \varepsilon_i(b_N \otimes \cdots \otimes b_1) &= \max_{1 \leq k \leq n}\left( \sum_{j=1}^k \varepsilon_i(b_j) - \sum_{j=1}^{k-1} \varphi_i(b_j) \right) \\ & = \max_{1 \leq k \leq N}\bigl( a_i(k) \bigr), \\ \varphi_i(b_N \otimes \cdots \otimes b_1) &= \max_{1 \leq k \leq N} \left( \varphi_i(b_N) + \sum_{j=k}^{N-1} \big( \varphi_i(b_j) - \varepsilon_i(b_{j+1}) \big) \right) \\ & = \max_{1 \leq k \leq N}\bigl( \lambda_i + a_i(k) \bigr) \end{aligned}\end{split}

where $$\lambda_i = \langle \alpha_i^{\vee}, \mathrm{wt}(b_N \otimes \cdots \otimes b_1) \rangle$$. Then for $$k = 1, \ldots, N$$ the action of the Kashiwara operators is determined as follows.

• If $$a_i(k) > a_i(j)$$ for $$1 \leq j < k$$ and $$a_i(k) \geq a_i(j)$$ for $$k < j \leq N$$:

$e_i(b_N \otimes \cdots \otimes b_1) = b_N \otimes \cdots \otimes e_i b_k \otimes \cdots \otimes b_1.$
• If $$a_i(k) \geq a_i(j)$$ for $$1 \leq j < k$$ and $$a_i(k) > a_i(j)$$ for $$k < j \leq N$$:

$f_i(b_N \otimes \cdots \otimes b_1) = b_N \otimes \cdots \otimes f_i b_k \otimes \cdots \otimes b_1.$

Note that this is just recursively applying the definition of the tensor product on two crystals. Recall that $$\langle \alpha_i^{\vee}, \mathrm{wt}(b_j) \rangle = \varphi_i(b_j) - \varepsilon_i(b_j)$$ by the definition of a crystal.

Regular crystals

Now if all crystals $$B_k$$ are regular crystals, all $$\varepsilon_i$$ and $$\varphi_i$$ are non-negative and we can define tensor product by the signature rule. We start by writing a word in $$+$$ and $$-$$ as follows:

$\underbrace{- \cdots -}_{\varphi_i(b_N) \text{ times}} \quad \underbrace{+ \cdots +}_{\varepsilon_i(b_N) \text{ times}} \quad \cdots \quad \underbrace{- \cdots -}_{\varphi_i(b_1) \text{ times}} \quad \underbrace{+ \cdots +}_{\varepsilon_i(b_1) \text{ times}},$

and then canceling ordered pairs of $$+-$$ until the word is in the reduced form:

$\underbrace{- \cdots -}_{\varphi_i \text{ times}} \quad \underbrace{+ \cdots +}_{\varepsilon_i \text{ times}}.$

Here $$e_i$$ acts on the factor corresponding to the leftmost $$+$$ and $$f_i$$ on the factor corresponding to the rightmost $$-$$. If there is no $$+$$ or $$-$$ respectively, then the result is $$0$$ (None).

EXAMPLES:

We construct the type $$A_2$$-crystal generated by $$2 \otimes 1 \otimes 1$$:

sage: C = CrystalOfLetters(['A',2])
sage: T = TensorProductOfCrystals(C,C,C,generators=[[C(2),C(1),C(1)]])


It has $$8$$ elements:

sage: T.list()
[[2, 1, 1], [2, 1, 2], [2, 1, 3], [3, 1, 3], [3, 2, 3], [3, 1, 1], [3, 1, 2], [3, 2, 2]]


One can also check the Cartan type of the crystal:

sage: T.cartan_type()
['A', 2]


Other examples include crystals of tableaux (which internally are represented as tensor products obtained by reading the tableaux columnwise):

sage: C = CrystalOfTableaux(['A',3], shape=[1,1,0])
sage: D = CrystalOfTableaux(['A',3], shape=[1,0,0])
sage: T = TensorProductOfCrystals(C,D, generators=[[C(rows=[[1], [2]]), D(rows=[[1]])], [C(rows=[[2], [3]]), D(rows=[[1]])]])
sage: T.cardinality()
24
sage: TestSuite(T).run()
sage: T.module_generators
[[[[1], [2]], [[1]]], [[[2], [3]], [[1]]]]
sage: [x.weight() for x in T.module_generators]
[(2, 1, 0, 0), (1, 1, 1, 0)]


If no module generators are specified, we obtain the full tensor product:

sage: C = CrystalOfLetters(['A',2])
sage: T = TensorProductOfCrystals(C,C)
sage: T.list()
[[1, 1], [1, 2], [1, 3], [2, 1], [2, 2], [2, 3], [3, 1], [3, 2], [3, 3]]
sage: T.cardinality()
9


For a tensor product of crystals without module generators, the default implementation of module_generators contains all elements in the tensor product of the crystals. If there is a subset of elements in the tensor product that still generates the crystal, this needs to be implemented for the specific crystal separately:

sage: T.module_generators.list()
[[1, 1], [1, 2], [1, 3], [2, 1], [2, 2], [2, 3], [3, 1], [3, 2], [3, 3]]


For classical highest weight crystals, it is also possible to list all highest weight elements:

sage: C = CrystalOfLetters(['A',2])
sage: T = TensorProductOfCrystals(C,C,C,generators=[[C(2),C(1),C(1)],[C(1),C(2),C(1)]])
sage: T.highest_weight_vectors()
[[2, 1, 1], [1, 2, 1]]


Examples with non-regular and infinite crystals (these did not work before trac ticket #14402):

sage: B = InfinityCrystalOfTableaux(['D',10])
sage: T = TensorProductOfCrystals(B,B)
sage: T
Full tensor product of the crystals
[The infinity crystal of tableaux of type ['D', 10],
The infinity crystal of tableaux of type ['D', 10]]

sage: B = InfinityCrystalOfGeneralizedYoungWalls(15)
sage: T = TensorProductOfCrystals(B,B,B)
sage: T
Full tensor product of the crystals
[Crystal of generalized Young walls of type ['A', 15, 1],
Crystal of generalized Young walls of type ['A', 15, 1],
Crystal of generalized Young walls of type ['A', 15, 1]]

sage: La = RootSystem(['A',2,1]).weight_lattice().fundamental_weights()
sage: B = CrystalOfGeneralizedYoungWalls(2,La[0]+La[1])
sage: C = CrystalOfGeneralizedYoungWalls(2,2*La[2])
sage: D = CrystalOfGeneralizedYoungWalls(2,3*La[0]+La[2])
sage: T = TensorProductOfCrystals(B,C,D)
sage: T
Full tensor product of the crystals
[Highest weight crystal of generalized Young walls of Cartan type ['A', 2, 1] and highest weight Lambda[0] + Lambda[1].,
Highest weight crystal of generalized Young walls of Cartan type ['A', 2, 1] and highest weight 2*Lambda[2].,
Highest weight crystal of generalized Young walls of Cartan type ['A', 2, 1] and highest weight 3*Lambda[0] + Lambda[2].]


There is also a global option for setting the convention (by default Sage uses anti-Kashiwara):

sage: C = CrystalOfLetters(['A',2])
sage: T = TensorProductOfCrystals(C,C)
sage: elt = T(C(1), C(2)); elt
[1, 2]
sage: TensorProductOfCrystals.global_options['convention'] = "Kashiwara"
sage: elt
[2, 1]
sage: TensorProductOfCrystals.global_options.reset()

global_options(*get_value, **set_value)

Sets the global options for tensor products of crystals. The default is to use the anti-Kashiwara convention.

There are two conventions for how $$e_i$$ and $$f_i$$ act on tensor products, and the difference between the two is the order of the tensor factors are reversed. This affects both the input and output. See the example below.

OPTIONS:

• convention – (default: antiKashiwara) Sets the convention used for displaying/inputting tensor product of crystals
• Kashiwara – use the Kashiwara convention
• anti – alias for antiKashiwara
• antiKashiwara – use the anti-Kashiwara convention
• opposite – alias for antiKashiwara

Note

Changing the convention also changes how the input is handled.

Warning

Internally, the crystals are always stored using the anti-Kashiwara convention.

If no parameters are set, then the function returns a copy of the options dictionary.

EXAMPLES:

sage: C = CrystalOfLetters(['A',2])
sage: T = TensorProductOfCrystals(C,C)
sage: elt = T(C(1), C(2)); elt
[1, 2]
sage: TensorProductOfCrystals.global_options['convention'] = "Kashiwara"
sage: elt
[2, 1]
sage: T(C(1), C(2)) == elt
False
sage: T(C(2), C(1)) == elt
True
sage: TensorProductOfCrystals.global_options.reset()


See GlobalOptions for more features of these options.

class sage.combinat.crystals.tensor_product.TensorProductOfCrystalsElement(parent, list)

A class for elements of tensor products of crystals.

e(i)

Return the action of $$e_i$$ on self.

INPUT:

• i – An element of the index set

EXAMPLES:

sage: B = InfinityCrystalOfTableaux("D4")
sage: T = TensorProductOfCrystals(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]]]

epsilon(i)

Return $$\varepsilon_i$$ of self.

INPUT:

• i – An element of the index set

EXAMPLES:

sage: B = InfinityCrystalOfTableaux("G2")
sage: T = TensorProductOfCrystals(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]

f(i)

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().fundamental_weights()
sage: B = CrystalOfGeneralizedYoungWalls(3,La[0])
sage: T = TensorProductOfCrystals(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]]]

phi(i)

Return $$\varphi_i$$ of self.

INPUT:

• i – An element of the index set

EXAMPLES:

sage: La = RootSystem(['A',2,1]).weight_lattice().fundamental_weights()
sage: B = CrystalOfGeneralizedYoungWalls(2,La[0]+La[1])
sage: T = TensorProductOfCrystals(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]

weight()

Return the weight of self.

EXAMPLES:

sage: B = InfinityCrystalOfTableaux("A3")
sage: T = TensorProductOfCrystals(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)

class sage.combinat.crystals.tensor_product.TensorProductOfCrystalsWithGenerators(crystals, generators, cartan_type)

Tensor product of crystals with a generating set.

class sage.combinat.crystals.tensor_product.TensorProductOfRegularCrystalsElement(parent, list)

Element class for a tensor product of regular crystals.

TESTS:

sage: C = CrystalOfLetters(['A',2])
sage: T = TensorProductOfCrystals(C, C)
sage: elt = T(C(1), C(2))
sage: from sage.combinat.crystals.tensor_product import TensorProductOfRegularCrystalsElement
sage: isinstance(elt, TensorProductOfRegularCrystalsElement)
True


Returns the affine grading of $$self$$.

INPUT:

• self – an element of a tensor product of Kirillov-Reshetikhin crystals.

OUTPUT: an integer

The affine grading is only defined when self is an element of a tensor product of affine Kirillov-Reshetikhin crystals. It is calculated by finding a path from self to a ground state path using the helper method e_string_to_ground_state() and counting the number of affine Kashiwara operators $$e_0$$ applied on the way.

EXAMPLES:

sage: K = KirillovReshetikhinCrystal(['A',2,1],1,1)
sage: T = TensorProductOfCrystals(K,K)
sage: t = T.module_generators[0]
1

sage: K = KirillovReshetikhinCrystal(['A',2,1],1,1)
sage: T = TensorProductOfCrystals(K,K,K)
sage: hw = [b for b in T if all(b.epsilon(i)==0 for i in [1,2])]
sage: for b in hw:
...
[[[1]], [[1]], [[1]]] 3
[[[1]], [[2]], [[1]]] 1
[[[2]], [[1]], [[1]]] 2
[[[3]], [[2]], [[1]]] 0

sage: K = KirillovReshetikhinCrystal(['C',2,1],1,1)
sage: T = TensorProductOfCrystals(K,K,K)
sage: hw = [b for b in T if all(b.epsilon(i)==0 for i in [1,2])]
sage: for b in hw:
...
[[[1]], [[1]], [[1]]] 2
[[[1]], [[2]], [[1]]] 1
[[[1]], [[-1]], [[1]]] 0
[[[2]], [[1]], [[1]]] 1
[[[-2]], [[2]], [[1]]] 0
[[[-1]], [[1]], [[1]]] 1

e(i)

Return the action of $$e_i$$ on self.

EXAMPLES:

sage: C = CrystalOfLetters(['A',5])
sage: T = TensorProductOfCrystals(C,C)
sage: T(C(1),C(2)).e(1) == T(C(1),C(1))
True
sage: T(C(2),C(1)).e(1) == None
True
sage: T(C(2),C(2)).e(1) == T(C(1),C(2))
True

e_string_to_ground_state()

Returns a string of integers in the index set $$(i_1,\ldots,i_k)$$ such that $$e_{i_k} \cdots e_{i_1} self$$ is the ground state.

INPUT:

• self – an element of a tensor product of Kirillov-Reshetikhin crystals.

OUTPUT: a tuple of integers $$(i_1,\ldots,i_k)$$

This method is only defined when self is an element of a tensor product of affine Kirillov-Reshetikhin crystals. It calculates a path from self to a ground state path using Demazure arrows as defined in Lemma 7.3 in [SchillingTingley2011].

EXAMPLES:

sage: K = KirillovReshetikhinCrystal(['A',2,1],1,1)
sage: T = TensorProductOfCrystals(K,K)
sage: t = T.module_generators[0]
sage: t.e_string_to_ground_state()
(0, 2)

sage: K = KirillovReshetikhinCrystal(['C',2,1],1,1)
sage: T = TensorProductOfCrystals(K,K)
sage: t = T.module_generators[0]; t
[[[1]], [[1]]]
sage: t.e_string_to_ground_state()
(0,)
sage: x=t.e(0)
sage: x.e_string_to_ground_state()
()
sage: y=t.f_string([1,2,1,1,0]); y
[[[2]], [[1]]]
sage: y.e_string_to_ground_state()
()

energy_function()

Return the energy function of self.

INPUT:

• self – an element of a tensor product of perfect Kirillov-Reshetkhin crystals of the same level.

OUTPUT: an integer

The energy is only defined when self is an element of a tensor product of affine Kirillov-Reshetikhin crystals. In this implementation, it is assumed that self is an element of a tensor product of perfect crystals of the same level, see Theorem 7.5 in [SchillingTingley2011].

REFERENCES:

 [SchillingTingley2011] (1, 2) A. Schilling, P. Tingley. Demazure crystals, Kirillov-Reshetikhin crystals, and the energy function. Electronic Journal of Combinatorics. 19(2). 2012. Arxiv 1104.2359

EXAMPLES:

sage: K = KirillovReshetikhinCrystal(['A',2,1],1,1)
sage: T = TensorProductOfCrystals(K,K,K)
sage: hw = [b for b in T if all(b.epsilon(i)==0 for i in [1,2])]
sage: for b in hw:
...      print b, b.energy_function()
...
[[[1]], [[1]], [[1]]] 0
[[[1]], [[2]], [[1]]] 2
[[[2]], [[1]], [[1]]] 1
[[[3]], [[2]], [[1]]] 3

sage: K = KirillovReshetikhinCrystal(['C',2,1],1,2)
sage: T = TensorProductOfCrystals(K,K)
sage: hw = [b for b in T if all(b.epsilon(i)==0 for i in [1,2])]
sage: for b in hw:  # long time (5s on sage.math, 2011)
...       print b, b.energy_function()
...
[[], []] 4
[[], [[1, 1]]] 1
[[[1, 1]], []] 3
[[[1, 1]], [[1, 1]]] 0
[[[1, 2]], [[1, 1]]] 1
[[[2, 2]], [[1, 1]]] 2
[[[-1, -1]], [[1, 1]]] 2
[[[1, -1]], [[1, 1]]] 2
[[[2, -1]], [[1, 1]]] 2

sage: K = KirillovReshetikhinCrystal(['C',2,1],1,1)
sage: T = TensorProductOfCrystals(K)
sage: t = T.module_generators[0]
sage: t.energy_function()
Traceback (most recent call last):
...
ValueError: All crystals in the tensor product need to be perfect of the same level

epsilon(i)

Return $$\varepsilon_i$$ of self.

EXAMPLES:

sage: C = CrystalOfLetters(['A',5])
sage: T = TensorProductOfCrystals(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

f(i)

Return the action of $$f_i$$ on self.

EXAMPLES:

sage: C = CrystalOfLetters(['A',5])
sage: T = TensorProductOfCrystals(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

phi(i)

Return $$\varphi_i$$ of self.

EXAMPLES:

sage: C = CrystalOfLetters(['A',5])
sage: T = TensorProductOfCrystals(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

positions_of_unmatched_minus(i, dual=False, reverse=False)

EXAMPLES:

sage: C = CrystalOfLetters(['A',5])
sage: T = TensorProductOfCrystals(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]

positions_of_unmatched_plus(i)

EXAMPLES:

sage: C = CrystalOfLetters(['A',5])
sage: T = TensorProductOfCrystals(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]

weight()

Return the weight of self.

EXAMPLES:

sage: C = CrystalOfLetters(['A',3])
sage: T = TensorProductOfCrystals(C,C)
sage: T(C(1),C(2)).weight()
(1, 1, 0, 0)
sage: T=CrystalOfTableaux(['D',4],shape=[])
sage: T.list()[0].weight()
(0, 0, 0, 0)

class sage.combinat.crystals.tensor_product.TensorProductOfRegularCrystalsWithGenerators(crystals, generators, cartan_type)

Tensor product of regular crystals with a generating set.

Element
class sage.combinat.crystals.tensor_product.TestParent

Base class for all parents.

Parents are the Sage/mathematical analogues of container objects in computer science.

INPUT:

• base – An algebraic structure considered to be the “base” of this parent (e.g. the base field for a vector space).
• category – a category or list/tuple of categories. The category in which this parent lies (or list or tuple thereof). Since categories support more general super-categories, this should be the most specific category possible. If category is a list or tuple, a JoinCategory is created out of them. If category is not specified, the category will be guessed (see CategoryObject), but won’t be used to inherit parent’s or element’s code from this category.
• element_constructor – A class or function that creates elements of this Parent given appropriate input (can also be filled in later with _populate_coercion_lists_())
• gens – Generators for this object (can also be filled in later with _populate_generators_())
• names – Names of generators.
• normalize – Whether to standardize the names (remove punctuation, etc)
• facade – a parent, or tuple thereof, or True

Internal invariants:

• self._element_init_pass_parent == guess_pass_parent(self, self._element_constructor) Ensures that __call__() passes down the parent properly to _element_constructor(). See trac ticket #5979.

Todo

Eventually, category should be Sets by default.

__call__(x=0, *args, **kwds)

This is the generic call method for all parents.

When called, it will find a map based on the Parent (or type) of x. If a coercion exists, it will always be chosen. This map will then be called (with the arguments and keywords if any).

By default this will dispatch as quickly as possible to _element_constructor_() though faster pathways are possible if so desired.

TESTS:

We check that the invariant:

self._element_init_pass_parent == guess_pass_parent(self, self._element_constructor)


is preserved (see trac ticket #5979):

sage: class MyParent(Parent):
....:     def _element_constructor_(self, x):
....:         print self, x
....:         return sage.structure.element.Element(parent = self)
....:     def _repr_(self):
....:         return "my_parent"
....:
sage: my_parent = MyParent()
sage: x = my_parent("bla")
my_parent bla
sage: x.parent()         # indirect doctest
my_parent

sage: x = my_parent()    # shouldn't this one raise an error?
my_parent 0
sage: x = my_parent(3)   # todo: not implemented  why does this one fail???
my_parent 3

_populate_coercion_lists_(coerce_list=[], action_list=[], convert_list=[], embedding=None, convert_method_name=None, element_constructor=None, init_no_parent=None, unpickling=False)

This function allows one to specify coercions, actions, conversions and embeddings involving this parent.

IT SHOULD ONLY BE CALLED DURING THE __INIT__ method, often at the end.

INPUT:

• coerce_list – a list of coercion Morphisms to self and parents with canonical coercions to self

• action_list – a list of actions on and by self

• convert_list – a list of conversion Maps to self and

parents with conversions to self

• embedding – a single Morphism from self

• convert_method_name – a name to look for that other elements can implement to create elements of self (e.g. _integer_)

• element_constructor – A callable object used by the __call__ method to construct new elements. Typically the element class or a bound method (defaults to self._element_constructor_).

• init_no_parent – if True omit passing self in as the first argument of element_constructor for conversion. This is useful if parents are unique, or element_constructor is a bound method (this latter case can be detected automatically).

__mul__(x)

This is a multiplication method that more or less directly calls another attribute _mul_ (single underscore). This is because __mul__ can not be implemented via inheritance from the parent methods of the category, but _mul_ can be inherited. This is, e.g., used when creating twosided ideals of matrix algebras. See trac ticket #7797.

EXAMPLE:

sage: MS = MatrixSpace(QQ,2,2)


This matrix space is in fact an algebra, and in particular it is a ring, from the point of view of categories:

sage: MS.category()
Category of algebras over Rational Field
sage: MS in Rings()
True


However, its class does not inherit from the base class Ring:

sage: isinstance(MS,Ring)
False


Its _mul_ method is inherited from the category, and can be used to create a left or right ideal:

sage: MS._mul_.__module__
'sage.categories.rings'
sage: MS*MS.1      # indirect doctest
Left Ideal
(
[0 1]
[0 0]
)
of Full MatrixSpace of 2 by 2 dense matrices over Rational Field
sage: MS*[MS.1,2]
Left Ideal
(
[0 1]
[0 0],

[2 0]
[0 2]
)
of Full MatrixSpace of 2 by 2 dense matrices over Rational Field
sage: MS.1*MS
Right Ideal
(
[0 1]
[0 0]
)
of Full MatrixSpace of 2 by 2 dense matrices over Rational Field
sage: [MS.1,2]*MS
Right Ideal
(
[0 1]
[0 0],

[2 0]
[0 2]
)
of Full MatrixSpace of 2 by 2 dense matrices over Rational Field

__contains__(x)

True if there is an element of self that is equal to x under ==, or if x is already an element of self. Also, True in other cases involving the Symbolic Ring, which is handled specially.

For many structures we test this by using __call__() and then testing equality between x and the result.

The Symbolic Ring is treated differently because it is ultra-permissive about letting other rings coerce in, but ultra-strict about doing comparisons.

EXAMPLES:

sage: 2 in Integers(7)
True
sage: 2 in ZZ
True
sage: Integers(7)(3) in ZZ
True
sage: 3/1 in ZZ
True
sage: 5 in QQ
True
sage: I in RR
False
sage: SR(2) in ZZ
True
sage: RIF(1, 2) in RIF
True
sage: pi in RIF # there is no element of RIF equal to pi
False
sage: sqrt(2) in CC
True
sage: pi in RR
True
sage: pi in CC
True
sage: pi in RDF
True
sage: pi in CDF
True


TESTS:

Check that trac ticket #13824 is fixed:

sage: 4/3 in GF(3)
False
sage: 15/50 in GF(25, 'a')
False
sage: 7/4 in Integers(4)
False
sage: 15/36 in Integers(6)
False

_coerce_map_from_(S)

Override this method to specify coercions beyond those specified in coerce_list.

If no such coercion exists, return None or False. Otherwise, it may return either an actual Map to use for the coercion, a callable (in which case it will be wrapped in a Map), or True (in which case a generic map will be provided).

_convert_map_from_(S)

Override this method to provide additional conversions beyond those given in convert_list.

This function is called after coercions are attempted. If there is a coercion morphism in the opposite direction, one should consider adding a section method to that.

This MUST return a Map from S to self, or None. If None is returned then a generic map will be provided.

_get_action_(S, op, self_on_left)

Override this method to provide an action of self on S or S on self beyond what was specified in action_list.

This must return an action which accepts an element of self and an element of S (in the order specified by self_on_left).

_an_element_()

Returns an element of self. Want it in sufficient generality that poorly-written functions won’t work when they’re not supposed to. This is cached so doesn’t have to be super fast.

EXAMPLES:

sage: QQ._an_element_()
1/2
sage: ZZ['x,y,z']._an_element_()
x


TESTS:

Since Parent comes before the parent classes provided by categories in the hierarchy of classes, we make sure that this default implementation of _an_element_() does not override some provided by the categories. Eventually, this default implementation should be moved into the categories to avoid this workaround:

sage: S = FiniteEnumeratedSet([1,2,3])
sage: S.category()
Category of facade finite enumerated sets
sage: super(Parent, S)._an_element_
Cached version of <function _an_element_from_iterator at ...>
sage: S._an_element_()
1
sage: S = FiniteEnumeratedSet([])
sage: S._an_element_()
Traceback (most recent call last):
...
EmptySetError

_repr_option(key)

INPUT:

• key – string. A key for different metadata informations that can be inquired about.

Valid key arguments are:

• 'ascii_art': The _repr_() output is multi-line ascii art and each line must be printed starting at the same column, or the meaning is lost.
• 'element_ascii_art': same but for the output of the elements. Used in sage.misc.displayhook.
• 'element_is_atomic': the elements print atomically, that is, parenthesis are not required when printing out any of $$x - y$$, $$x + y$$, $$x^y$$ and $$x/y$$.

OUTPUT:

Boolean.

EXAMPLES:

sage: ZZ._repr_option('ascii_art')
False
sage: MatrixSpace(ZZ, 2)._repr_option('element_ascii_art')
True

_init_category_(category)

Initialize the category framework

Most parents initialize their category upon construction, and this is the recommended behavior. For example, this happens when the constructor calls Parent.__init__() directly or indirectly. However, some parents defer this for performance reasons. For example, sage.matrix.matrix_space.MatrixSpace does not.

EXAMPLES:

sage: P = Parent()
sage: P.category()
Category of sets
sage: class MyParent(Parent):
....:     def __init__(self):
....:         self._init_category_(Groups())
sage: MyParent().category()
Category of groups

sage.combinat.crystals.tensor_product.trunc(i)

Truncates to the integer closer to zero

EXAMPLES:

sage: from sage.combinat.crystals.tensor_product import trunc
sage: trunc(-3/2), trunc(-1), trunc(-1/2), trunc(0), trunc(1/2), trunc(1), trunc(3/2)
(-1, -1, 0, 0, 0, 1, 1)
sage: isinstance(trunc(3/2), Integer)
True


Spin Crystals

#### Next topic

Crystals of Generalized Young Walls