Affine crystals - Combinatorics

Skip to content
Back to top
View this page
Edit this page

# Affine crystals

class sage.combinat.crystals.affine.AffineCrystalFromClassical(cartan_type, classical_crystal, category=None)

  Bases: `UniqueRepresentation`, `Parent`

  This abstract class can be used for affine crystals that are constructed from a classical crystal. The zero arrows can be implemented using different methods (for example using a Dynkin diagram automorphisms or virtual crystals).

  This is a helper class, mostly used to implement Kirillov-Reshetikhin crystals (see: `KirillovReshetikhinCrystal()`).

  For general information about crystals see `sage.combinat.crystals`.

  INPUT:

  - `cartan_type` – the Cartan type of the resulting affine crystal

  - `classical_crystal` – instance of a classical crystal

  EXAMPLES:

  Sage

      sage: n = 2
      sage: C = crystals.Tableaux(['A',n],shape=[1])
      sage: pr = attrcall("promotion")
      sage: pr_inverse = attrcall("promotion_inverse")
      sage: A = crystals.AffineFromClassicalAndPromotion(['A',n,1],C,pr,pr_inverse,1)
      sage: A.list()
      [[[1]], [[2]], [[3]]]
      sage: A.cartan_type()
      ['A', 2, 1]
      sage: A.index_set()
      (0, 1, 2)
      sage: b = A(rows=[[1]])
      sage: b.weight()
      -Lambda[0] + Lambda[1]
      sage: b.classical_weight()
      (1, 0, 0)
      sage: [x.s(0) for x in A.list()]
      [[[3]], [[2]], [[1]]]
      sage: [x.s(1) for x in A.list()]
      [[[2]], [[1]], [[3]]]

  Python

      >>> from sage.all import *
      >>> n = Integer(2)
      >>> C = crystals.Tableaux(['A',n],shape=[Integer(1)])
      >>> pr = attrcall("promotion")
      >>> pr_inverse = attrcall("promotion_inverse")
      >>> A = crystals.AffineFromClassicalAndPromotion(['A',n,Integer(1)],C,pr,pr_inverse,Integer(1))
      >>> A.list()
      [[[1]], [[2]], [[3]]]
      >>> A.cartan_type()
      ['A', 2, 1]
      >>> A.index_set()
      (0, 1, 2)
      >>> b = A(rows=[[Integer(1)]])
      >>> b.weight()
      -Lambda[0] + Lambda[1]
      >>> b.classical_weight()
      (1, 0, 0)
      >>> [x.s(Integer(0)) for x in A.list()]
      [[[3]], [[2]], [[1]]]
      >>> [x.s(Integer(1)) for x in A.list()]
      [[[2]], [[1]], [[3]]]

  Element

    alias of `AffineCrystalFromClassicalElement`

  cardinality()

    Return the cardinality of `self`.

    EXAMPLES:

    Sage

        sage: C = crystals.Tableaux(['A',3],shape=[1])
        sage: pr = attrcall("promotion")
        sage: pr_inverse = attrcall("promotion_inverse")
        sage: A = crystals.AffineFromClassicalAndPromotion(['A',3,1],C,pr,pr_inverse,1)
        sage: A.cardinality() == C.cardinality()
        True

    Python

        >>> from sage.all import *
        >>> C = crystals.Tableaux(['A',Integer(3)],shape=[Integer(1)])
        >>> pr = attrcall("promotion")
        >>> pr_inverse = attrcall("promotion_inverse")
        >>> A = crystals.AffineFromClassicalAndPromotion(['A',Integer(3),Integer(1)],C,pr,pr_inverse,Integer(1))
        >>> A.cardinality() == C.cardinality()
        True

  lift(affine_elt)

    Lift an affine crystal element to the corresponding classical crystal element.

    EXAMPLES:

    Sage

        sage: n = 2
        sage: C = crystals.Tableaux(['A',n],shape=[1])
        sage: pr = attrcall("promotion")
        sage: pr_inverse = attrcall("promotion_inverse")
        sage: A = crystals.AffineFromClassicalAndPromotion(['A',n,1],C,pr,pr_inverse,1)
        sage: b = A.list()[0]
        sage: A.lift(b)
        [[1]]
        sage: A.lift(b).parent()
        The crystal of tableaux of type ['A', 2] and shape(s) [[1]]

    Python

        >>> from sage.all import *
        >>> n = Integer(2)
        >>> C = crystals.Tableaux(['A',n],shape=[Integer(1)])
        >>> pr = attrcall("promotion")
        >>> pr_inverse = attrcall("promotion_inverse")
        >>> A = crystals.AffineFromClassicalAndPromotion(['A',n,Integer(1)],C,pr,pr_inverse,Integer(1))
        >>> b = A.list()[Integer(0)]
        >>> A.lift(b)
        [[1]]
        >>> A.lift(b).parent()
        The crystal of tableaux of type ['A', 2] and shape(s) [[1]]

  retract(classical_elt)

    Transform a classical crystal element to the corresponding affine crystal element.

    EXAMPLES:

    Sage

        sage: n = 2
        sage: C = crystals.Tableaux(['A',n],shape=[1])
        sage: pr = attrcall("promotion")
        sage: pr_inverse = attrcall("promotion_inverse")
        sage: A = crystals.AffineFromClassicalAndPromotion(['A',n,1],C,pr,pr_inverse,1)
        sage: t = C(rows=[[1]])
        sage: t.parent()
        The crystal of tableaux of type ['A', 2] and shape(s) [[1]]
        sage: A.retract(t)
        [[1]]
        sage: A.retract(t).parent() is A
        True

    Python

        >>> from sage.all import *
        >>> n = Integer(2)
        >>> C = crystals.Tableaux(['A',n],shape=[Integer(1)])
        >>> pr = attrcall("promotion")
        >>> pr_inverse = attrcall("promotion_inverse")
        >>> A = crystals.AffineFromClassicalAndPromotion(['A',n,Integer(1)],C,pr,pr_inverse,Integer(1))
        >>> t = C(rows=[[Integer(1)]])
        >>> t.parent()
        The crystal of tableaux of type ['A', 2] and shape(s) [[1]]
        >>> A.retract(t)
        [[1]]
        >>> A.retract(t).parent() is A
        True

class sage.combinat.crystals.affine.AffineCrystalFromClassicalAndPromotion(cartan_type, classical_crystal, p_automorphism, p_inverse_automorphism, dynkin_node, category=None)

  Bases: `AffineCrystalFromClassical`

  Crystals that are constructed from a classical crystal and a Dynkin diagram automorphism \(\sigma\). In type \(A_n\), the Dynkin diagram automorphism is \(i \to i+1 \pmod n+1\) and the corresponding map on the crystal is the promotion operation \(\mathrm{pr}\) on tableaux. The affine crystal operators are given by \(f_0= \mathrm{pr}^{-1} f_{\sigma(0)} \mathrm{pr}\).

  INPUT:

  - `cartan_type` – the Cartan type of the resulting affine crystal

  - `classical_crystal` – instance of a classical crystal

  - `automorphism, inverse_automorphism` – a function on the elements of the `classical_crystal`

  - `dynkin_node` – integer specifying the classical node in the image of the zero node under the automorphism sigma

  EXAMPLES:

  Sage

      sage: n = 2
      sage: C = crystals.Tableaux(['A',n],shape=[1])
      sage: pr = attrcall("promotion")
      sage: pr_inverse = attrcall("promotion_inverse")
      sage: A = crystals.AffineFromClassicalAndPromotion(['A',n,1],C,pr,pr_inverse,1)
      sage: A.list()
      [[[1]], [[2]], [[3]]]
      sage: A.cartan_type()
      ['A', 2, 1]
      sage: A.index_set()
      (0, 1, 2)
      sage: b = A(rows=[[1]])
      sage: b.weight()
      -Lambda[0] + Lambda[1]
      sage: b.classical_weight()
      (1, 0, 0)
      sage: [x.s(0) for x in A.list()]
      [[[3]], [[2]], [[1]]]
      sage: [x.s(1) for x in A.list()]
      [[[2]], [[1]], [[3]]]

  Python

      >>> from sage.all import *
      >>> n = Integer(2)
      >>> C = crystals.Tableaux(['A',n],shape=[Integer(1)])
      >>> pr = attrcall("promotion")
      >>> pr_inverse = attrcall("promotion_inverse")
      >>> A = crystals.AffineFromClassicalAndPromotion(['A',n,Integer(1)],C,pr,pr_inverse,Integer(1))
      >>> A.list()
      [[[1]], [[2]], [[3]]]
      >>> A.cartan_type()
      ['A', 2, 1]
      >>> A.index_set()
      (0, 1, 2)
      >>> b = A(rows=[[Integer(1)]])
      >>> b.weight()
      -Lambda[0] + Lambda[1]
      >>> b.classical_weight()
      (1, 0, 0)
      >>> [x.s(Integer(0)) for x in A.list()]
      [[[3]], [[2]], [[1]]]
      >>> [x.s(Integer(1)) for x in A.list()]
      [[[2]], [[1]], [[3]]]

  Element

    alias of `AffineCrystalFromClassicalAndPromotionElement`

  automorphism(x)

    Give the analogue of the affine Dynkin diagram automorphism on the level of crystals.

    EXAMPLES:

    Sage

        sage: n = 2
        sage: C = crystals.Tableaux(['A',n],shape=[1])
        sage: pr = attrcall("promotion")
        sage: pr_inverse = attrcall("promotion_inverse")
        sage: A = crystals.AffineFromClassicalAndPromotion(['A',n,1],C,pr,pr_inverse,1)
        sage: b = A.list()[0]
        sage: A.automorphism(b)
        [[2]]

    Python

        >>> from sage.all import *
        >>> n = Integer(2)
        >>> C = crystals.Tableaux(['A',n],shape=[Integer(1)])
        >>> pr = attrcall("promotion")
        >>> pr_inverse = attrcall("promotion_inverse")
        >>> A = crystals.AffineFromClassicalAndPromotion(['A',n,Integer(1)],C,pr,pr_inverse,Integer(1))
        >>> b = A.list()[Integer(0)]
        >>> A.automorphism(b)
        [[2]]

  inverse_automorphism(x)

    Give the analogue of the inverse of the affine Dynkin diagram automorphism on the level of crystals.

    EXAMPLES:

    Sage

        sage: n = 2
        sage: C = crystals.Tableaux(['A',n],shape=[1])
        sage: pr = attrcall("promotion")
        sage: pr_inverse = attrcall("promotion_inverse")
        sage: A = crystals.AffineFromClassicalAndPromotion(['A',n,1],C,pr,pr_inverse,1)
        sage: b = A.list()[0]
        sage: A.inverse_automorphism(b)
        [[3]]

    Python

        >>> from sage.all import *
        >>> n = Integer(2)
        >>> C = crystals.Tableaux(['A',n],shape=[Integer(1)])
        >>> pr = attrcall("promotion")
        >>> pr_inverse = attrcall("promotion_inverse")
        >>> A = crystals.AffineFromClassicalAndPromotion(['A',n,Integer(1)],C,pr,pr_inverse,Integer(1))
        >>> b = A.list()[Integer(0)]
        >>> A.inverse_automorphism(b)
        [[3]]

class sage.combinat.crystals.affine.AffineCrystalFromClassicalAndPromotionElement

  Bases: `AffineCrystalFromClassicalElement`

  Elements of crystals that are constructed from a classical crystal and a Dynkin diagram automorphism. In type \(A\), the automorphism is the promotion operation on tableaux.

  This class is not instantiated directly but rather `__call__`-ed from `AffineCrystalFromClassicalAndPromotion`. The syntax of this is governed by the (classical) crystal.

  Since this class inherits from `AffineCrystalFromClassicalElement`, the methods that need to be implemented are `e0()`, `f0()` and possibly `epsilon0()` and `phi0()` if more efficient algorithms exist.

  EXAMPLES:

  Sage

      sage: n = 2
      sage: C = crystals.Tableaux(['A',n],shape=[1])
      sage: pr = attrcall("promotion")
      sage: pr_inverse = attrcall("promotion_inverse")
      sage: A = crystals.AffineFromClassicalAndPromotion(['A',n,1],C,pr,pr_inverse,1)
      sage: b = A(rows=[[1]])
      sage: b._repr_()
      '[[1]]'

  Python

      >>> from sage.all import *
      >>> n = Integer(2)
      >>> C = crystals.Tableaux(['A',n],shape=[Integer(1)])
      >>> pr = attrcall("promotion")
      >>> pr_inverse = attrcall("promotion_inverse")
      >>> A = crystals.AffineFromClassicalAndPromotion(['A',n,Integer(1)],C,pr,pr_inverse,Integer(1))
      >>> b = A(rows=[[Integer(1)]])
      >>> b._repr_()
      '[[1]]'

  e0()

    Implement \(e_0\) using the automorphism as \(e_0 = \operatorname{pr}^{-1} e_{dynkin_node} \operatorname{pr}\)

    EXAMPLES:

    Sage

        sage: n = 2
        sage: C = crystals.Tableaux(['A',n],shape=[1])
        sage: pr = attrcall("promotion")
        sage: pr_inverse = attrcall("promotion_inverse")
        sage: A = crystals.AffineFromClassicalAndPromotion(['A',n,1],C,pr,pr_inverse,1)
        sage: b = A(rows=[[1]])
        sage: b.e0()
        [[3]]

    Python

        >>> from sage.all import *
        >>> n = Integer(2)
        >>> C = crystals.Tableaux(['A',n],shape=[Integer(1)])
        >>> pr = attrcall("promotion")
        >>> pr_inverse = attrcall("promotion_inverse")
        >>> A = crystals.AffineFromClassicalAndPromotion(['A',n,Integer(1)],C,pr,pr_inverse,Integer(1))
        >>> b = A(rows=[[Integer(1)]])
        >>> b.e0()
        [[3]]

  epsilon0()

    Implement \(epsilon_0\) using the automorphism.

    EXAMPLES:

    Sage

        sage: n = 2
        sage: C = crystals.Tableaux(['A',n],shape=[1])
        sage: pr = attrcall("promotion")
        sage: pr_inverse = attrcall("promotion_inverse")
        sage: A = crystals.AffineFromClassicalAndPromotion(['A',n,1],C,pr,pr_inverse,1)
        sage: [x.epsilon0() for x in A.list()]
        [1, 0, 0]

    Python

        >>> from sage.all import *
        >>> n = Integer(2)
        >>> C = crystals.Tableaux(['A',n],shape=[Integer(1)])
        >>> pr = attrcall("promotion")
        >>> pr_inverse = attrcall("promotion_inverse")
        >>> A = crystals.AffineFromClassicalAndPromotion(['A',n,Integer(1)],C,pr,pr_inverse,Integer(1))
        >>> [x.epsilon0() for x in A.list()]
        [1, 0, 0]

  f0()

    Implement \(f_0\) using the automorphism as \(f_0 = \operatorname{pr}^{-1} f_{dynkin_node} \operatorname{pr}\)

    EXAMPLES:

    Sage

        sage: n = 2
        sage: C = crystals.Tableaux(['A',n],shape=[1])
        sage: pr = attrcall("promotion")
        sage: pr_inverse = attrcall("promotion_inverse")
        sage: A = crystals.AffineFromClassicalAndPromotion(['A',n,1],C,pr,pr_inverse,1)
        sage: b = A(rows=[[3]])
        sage: b.f0()
        [[1]]

    Python

        >>> from sage.all import *
        >>> n = Integer(2)
        >>> C = crystals.Tableaux(['A',n],shape=[Integer(1)])
        >>> pr = attrcall("promotion")
        >>> pr_inverse = attrcall("promotion_inverse")
        >>> A = crystals.AffineFromClassicalAndPromotion(['A',n,Integer(1)],C,pr,pr_inverse,Integer(1))
        >>> b = A(rows=[[Integer(3)]])
        >>> b.f0()
        [[1]]

  phi0()

    Implement \(phi_0\) using the automorphism.

    EXAMPLES:

    Sage

        sage: n = 2
        sage: C = crystals.Tableaux(['A',n],shape=[1])
        sage: pr = attrcall("promotion")
        sage: pr_inverse = attrcall("promotion_inverse")
        sage: A = crystals.AffineFromClassicalAndPromotion(['A',n,1],C,pr,pr_inverse,1)
        sage: [x.phi0() for x in A.list()]
        [0, 0, 1]

    Python

        >>> from sage.all import *
        >>> n = Integer(2)
        >>> C = crystals.Tableaux(['A',n],shape=[Integer(1)])
        >>> pr = attrcall("promotion")
        >>> pr_inverse = attrcall("promotion_inverse")
        >>> A = crystals.AffineFromClassicalAndPromotion(['A',n,Integer(1)],C,pr,pr_inverse,Integer(1))
        >>> [x.phi0() for x in A.list()]
        [0, 0, 1]

class sage.combinat.crystals.affine.AffineCrystalFromClassicalElement

  Bases: `ElementWrapper`

  Elements of crystals that are constructed from a classical crystal.

  The elements inherit many of their methods from the classical crystal using lift and retract.

  This class is not instantiated directly but rather `__call__`-ed from `AffineCrystalFromClassical`. The syntax of this is governed by the (classical) crystal.

  EXAMPLES:

  Sage

      sage: n = 2
      sage: C = crystals.Tableaux(['A',n],shape=[1])
      sage: pr = attrcall("promotion")
      sage: pr_inverse = attrcall("promotion_inverse")
      sage: A = crystals.AffineFromClassicalAndPromotion(['A',n,1],C,pr,pr_inverse,1)
      sage: b = A(rows=[[1]])
      sage: b._repr_()
      '[[1]]'

  Python

      >>> from sage.all import *
      >>> n = Integer(2)
      >>> C = crystals.Tableaux(['A',n],shape=[Integer(1)])
      >>> pr = attrcall("promotion")
      >>> pr_inverse = attrcall("promotion_inverse")
      >>> A = crystals.AffineFromClassicalAndPromotion(['A',n,Integer(1)],C,pr,pr_inverse,Integer(1))
      >>> b = A(rows=[[Integer(1)]])
      >>> b._repr_()
      '[[1]]'

  classical_weight()

    Return the classical weight corresponding to `self`.

    EXAMPLES:

    Sage

        sage: n = 2
        sage: C = crystals.Tableaux(['A',n],shape=[1])
        sage: pr = attrcall("promotion")
        sage: pr_inverse = attrcall("promotion_inverse")
        sage: A = crystals.AffineFromClassicalAndPromotion(['A',n,1],C,pr,pr_inverse,1)
        sage: b = A(rows=[[1]])
        sage: b.classical_weight()
        (1, 0, 0)

    Python

        >>> from sage.all import *
        >>> n = Integer(2)
        >>> C = crystals.Tableaux(['A',n],shape=[Integer(1)])
        >>> pr = attrcall("promotion")
        >>> pr_inverse = attrcall("promotion_inverse")
        >>> A = crystals.AffineFromClassicalAndPromotion(['A',n,Integer(1)],C,pr,pr_inverse,Integer(1))
        >>> b = A(rows=[[Integer(1)]])
        >>> b.classical_weight()
        (1, 0, 0)

  e(i)

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

    EXAMPLES:

    Sage

        sage: n = 2
        sage: C = crystals.Tableaux(['A',n],shape=[1])
        sage: pr = attrcall("promotion")
        sage: pr_inverse = attrcall("promotion_inverse")
        sage: A = crystals.AffineFromClassicalAndPromotion(['A',n,1],C,pr,pr_inverse,1)
        sage: b = A(rows=[[1]])
        sage: b.e(0)
        [[3]]
        sage: b.e(1)

    Python

        >>> from sage.all import *
        >>> n = Integer(2)
        >>> C = crystals.Tableaux(['A',n],shape=[Integer(1)])
        >>> pr = attrcall("promotion")
        >>> pr_inverse = attrcall("promotion_inverse")
        >>> A = crystals.AffineFromClassicalAndPromotion(['A',n,Integer(1)],C,pr,pr_inverse,Integer(1))
        >>> b = A(rows=[[Integer(1)]])
        >>> b.e(Integer(0))
        [[3]]
        >>> b.e(Integer(1))

  e0()

    Assumes that \(e_0\) is implemented separately.

  epsilon(i)

    Return the maximal time the crystal operator \(e_i\) can be applied to `self`.

    EXAMPLES:

    Sage

        sage: n = 2
        sage: C = crystals.Tableaux(['A',n],shape=[1])
        sage: pr = attrcall("promotion")
        sage: pr_inverse = attrcall("promotion_inverse")
        sage: A = crystals.AffineFromClassicalAndPromotion(['A',n,1],C,pr,pr_inverse,1)
        sage: [x.epsilon(0) for x in A.list()]
        [1, 0, 0]
        sage: [x.epsilon(1) for x in A.list()]
        [0, 1, 0]

    Python

        >>> from sage.all import *
        >>> n = Integer(2)
        >>> C = crystals.Tableaux(['A',n],shape=[Integer(1)])
        >>> pr = attrcall("promotion")
        >>> pr_inverse = attrcall("promotion_inverse")
        >>> A = crystals.AffineFromClassicalAndPromotion(['A',n,Integer(1)],C,pr,pr_inverse,Integer(1))
        >>> [x.epsilon(Integer(0)) for x in A.list()]
        [1, 0, 0]
        >>> [x.epsilon(Integer(1)) for x in A.list()]
        [0, 1, 0]

  epsilon0()

    Uses \(\varepsilon_0\) from the super class, but should be implemented if a faster implementation exists.

    EXAMPLES:

    Sage

        sage: n = 2
        sage: C = crystals.Tableaux(['A',n],shape=[1])
        sage: pr = attrcall("promotion")
        sage: pr_inverse = attrcall("promotion_inverse")
        sage: A = crystals.AffineFromClassicalAndPromotion(['A',n,1],C,pr,pr_inverse,1)
        sage: [x.epsilon0() for x in A.list()]
        [1, 0, 0]

    Python

        >>> from sage.all import *
        >>> n = Integer(2)
        >>> C = crystals.Tableaux(['A',n],shape=[Integer(1)])
        >>> pr = attrcall("promotion")
        >>> pr_inverse = attrcall("promotion_inverse")
        >>> A = crystals.AffineFromClassicalAndPromotion(['A',n,Integer(1)],C,pr,pr_inverse,Integer(1))
        >>> [x.epsilon0() for x in A.list()]
        [1, 0, 0]

  f(i)

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

    EXAMPLES:

    Sage

        sage: n = 2
        sage: C = crystals.Tableaux(['A',n],shape=[1])
        sage: pr = attrcall("promotion")
        sage: pr_inverse = attrcall("promotion_inverse")
        sage: A = crystals.AffineFromClassicalAndPromotion(['A',n,1],C,pr,pr_inverse,1)
        sage: b = A(rows=[[3]])
        sage: b.f(0)
        [[1]]
        sage: b.f(2)

    Python

        >>> from sage.all import *
        >>> n = Integer(2)
        >>> C = crystals.Tableaux(['A',n],shape=[Integer(1)])
        >>> pr = attrcall("promotion")
        >>> pr_inverse = attrcall("promotion_inverse")
        >>> A = crystals.AffineFromClassicalAndPromotion(['A',n,Integer(1)],C,pr,pr_inverse,Integer(1))
        >>> b = A(rows=[[Integer(3)]])
        >>> b.f(Integer(0))
        [[1]]
        >>> b.f(Integer(2))

  f0()

    Assumes that \(f_0\) is implemented separately.

  lift()

    Lift an affine crystal element to the corresponding classical crystal element.

    EXAMPLES:

    Sage

        sage: n = 2
        sage: C = crystals.Tableaux(['A',n],shape=[1])
        sage: pr = attrcall("promotion")
        sage: pr_inverse = attrcall("promotion_inverse")
        sage: A = crystals.AffineFromClassicalAndPromotion(['A',n,1],C,pr,pr_inverse,1)
        sage: b = A.list()[0]
        sage: b.lift()
        [[1]]
        sage: b.lift().parent()
        The crystal of tableaux of type ['A', 2] and shape(s) [[1]]

    Python

        >>> from sage.all import *
        >>> n = Integer(2)
        >>> C = crystals.Tableaux(['A',n],shape=[Integer(1)])
        >>> pr = attrcall("promotion")
        >>> pr_inverse = attrcall("promotion_inverse")
        >>> A = crystals.AffineFromClassicalAndPromotion(['A',n,Integer(1)],C,pr,pr_inverse,Integer(1))
        >>> b = A.list()[Integer(0)]
        >>> b.lift()
        [[1]]
        >>> b.lift().parent()
        The crystal of tableaux of type ['A', 2] and shape(s) [[1]]

  phi(i)

    Return the maximal time the crystal operator \(f_i\) can be applied to `self`.

    EXAMPLES:

    Sage

        sage: n = 2
        sage: C = crystals.Tableaux(['A',n],shape=[1])
        sage: pr = attrcall("promotion")
        sage: pr_inverse = attrcall("promotion_inverse")
        sage: A = crystals.AffineFromClassicalAndPromotion(['A',n,1],C,pr,pr_inverse,1)
        sage: [x.phi(0) for x in A.list()]
        [0, 0, 1]
        sage: [x.phi(1) for x in A.list()]
        [1, 0, 0]

    Python

        >>> from sage.all import *
        >>> n = Integer(2)
        >>> C = crystals.Tableaux(['A',n],shape=[Integer(1)])
        >>> pr = attrcall("promotion")
        >>> pr_inverse = attrcall("promotion_inverse")
        >>> A = crystals.AffineFromClassicalAndPromotion(['A',n,Integer(1)],C,pr,pr_inverse,Integer(1))
        >>> [x.phi(Integer(0)) for x in A.list()]
        [0, 0, 1]
        >>> [x.phi(Integer(1)) for x in A.list()]
        [1, 0, 0]

  phi0()

    Uses \(\varphi_0\) from the super class, but should be implemented if a faster implementation exists.

    EXAMPLES:

    Sage

        sage: n = 2
        sage: C = crystals.Tableaux(['A',n],shape=[1])
        sage: pr = attrcall("promotion")
        sage: pr_inverse = attrcall("promotion_inverse")
        sage: A = crystals.AffineFromClassicalAndPromotion(['A',n,1],C,pr,pr_inverse,1)
        sage: [x.phi0() for x in A.list()]
        [0, 0, 1]

    Python

        >>> from sage.all import *
        >>> n = Integer(2)
        >>> C = crystals.Tableaux(['A',n],shape=[Integer(1)])
        >>> pr = attrcall("promotion")
        >>> pr_inverse = attrcall("promotion_inverse")
        >>> A = crystals.AffineFromClassicalAndPromotion(['A',n,Integer(1)],C,pr,pr_inverse,Integer(1))
        >>> [x.phi0() for x in A.list()]
        [0, 0, 1]

  pp()

    Method for pretty printing.

    EXAMPLES:

    Sage

        sage: K = crystals.KirillovReshetikhin(['D',3,2],1,1)
        sage: t=K(rows=[[1]])
        sage: t.pp()
        1

    Python

        >>> from sage.all import *
        >>> K = crystals.KirillovReshetikhin(['D',Integer(3),Integer(2)],Integer(1),Integer(1))
        >>> t=K(rows=[[Integer(1)]])
        >>> t.pp()
        1