Path: blob/master/sage/algebras/affine_nil_temperley_lieb.py
4145 views
"""1Affine nilTemperley Lieb Algebra of type A2"""3#*****************************************************************************4# Copyright (C) 2010 Anne Schilling <anne at math.ucdavis.edu>5#6# Distributed under the terms of the GNU General Public License (GPL)7# http://www.gnu.org/licenses/8#*****************************************************************************9from sage.categories.all import AlgebrasWithBasis10from sage.combinat.root_system.cartan_type import CartanType11from sage.combinat.root_system.weyl_group import WeylGroup12from sage.rings.ring import Ring13from sage.rings.all import ZZ14from sage.combinat.free_module import CombinatorialFreeModule15from sage.misc.cachefunc import cached_method1617class AffineNilTemperleyLiebTypeA(CombinatorialFreeModule):18r"""19Constructs the affine nilTemperley Lieb algebra of type `A_{n-1}^{(1)}` as used in [P2005].2021REFERENCES:2223.. [P2005] A. Postnikov, Affine approach to quantum Schubert calculus, Duke Math. J. 128 (2005) 473-5092425INPUT:2627- ``n`` -- a positive integer2829The affine nilTemperley Lieb algebra is generated by `a_i` for `i=0,1,\ldots,n-1`30subject to the relations `a_i a_i = a_i a_{i+1} a_i = a_{i+1} a_i a_{i+1} = 0` and31`a_i a_j = a_j a_i` for `i-j \not \equiv \pm 1`, where the indices are taken modulo `n`.3233EXAMPLES::3435sage: A = AffineNilTemperleyLiebTypeA(4)36sage: a = A.algebra_generators(); a37Finite family {0: a0, 1: a1, 2: a2, 3: a3}38sage: a[1]*a[2]*a[0] == a[1]*a[0]*a[2]39True40sage: a[0]*a[3]*a[0]41042sage: A.an_element()432*a0 + 3*a0*a1 + 1 + a0*a1*a2*a344"""4546def __init__(self, n, R = ZZ, prefix = 'a'):47"""48Initiates the affine nilTemperley Lieb algebra over the ring `R`.4950EXAMPLES::5152sage: A = AffineNilTemperleyLiebTypeA(3, prefix="a"); A53The affine nilTemperley Lieb algebra A3 over the ring Integer Ring54sage: TestSuite(A).run()55sage: A = AffineNilTemperleyLiebTypeA(3, QQ); A56The affine nilTemperley Lieb algebra A3 over the ring Rational Field57"""58if not isinstance(R, Ring):59raise TypeError("Argument R must be a ring.")60self._cartan_type = CartanType(['A',n-1,1])61self._n = n62W = WeylGroup(self._cartan_type)63self._prefix = prefix64self._index_set = W.index_set()65self._base_ring = R66category = AlgebrasWithBasis(R)67CombinatorialFreeModule.__init__(self, R, W, category = category)6869def _element_constructor_(self, w):70"""71Constructs a basis element from an element of the Weyl group.7273If `w = w_1 ... w_k` is a reduced word for `w`, then `A(w)` returns74zero if `w` contains braid relations.75TODO: Once the functorial construction is in sage, perhaps this should be76handled constructing the affine nilTemperley Lieb algebra as a quotient algebra.7778EXAMPLES::7980sage: A = AffineNilTemperleyLiebTypeA(3, prefix="a")81sage: W = A.weyl_group()82sage: w = W.from_reduced_word([2,1,2])83sage: A(w)84085sage: w = W.from_reduced_word([2,1])86sage: A(w)87a2*a188"""89W = self.weyl_group()90assert(w in W)91word = w.reduced_word()92if all( self.has_no_braid_relation(W.from_reduced_word(word[:i]), word[i]) for i in range(len(word)) ):93return self.monomial(w)94else:95return self.zero()9697@cached_method98def one_basis(self):99"""100Returns the unit of the underlying Weyl group, which index101the one of this algebra, as per102:meth:`AlgebrasWithBasis.ParentMethods.one_basis`.103104EXAMPLES::105106sage: A = AffineNilTemperleyLiebTypeA(3)107sage: A.one_basis()108[1 0 0]109[0 1 0]110[0 0 1]111sage: A.one_basis() == A.weyl_group().one()112True113sage: A.one()1141115"""116return self.weyl_group().one()117118def _repr_(self):119"""120EXAMPLES::121122sage: A = AffineNilTemperleyLiebTypeA(3); A123The affine nilTemperley Lieb algebra A3 over the ring Integer Ring124"""125return "The affine nilTemperley Lieb algebra A%s over the ring %s"%(self._n, self._base_ring)126127def weyl_group(self):128"""129EXAMPLES::130131sage: A = AffineNilTemperleyLiebTypeA(3)132sage: A.weyl_group()133Weyl Group of type ['A', 2, 1] (as a matrix group acting on the root space)134"""135return self.basis().keys()136137def index_set(self):138"""139EXAMPLES::140141sage: A = AffineNilTemperleyLiebTypeA(3)142sage: A.index_set()143[0, 1, 2]144"""145return self._index_set146147@cached_method148def algebra_generators(self):149"""150Returns the generators `a_i` for `i=0,1,2,\ldots,n-1`.151152EXAMPLES::153154sage: A = AffineNilTemperleyLiebTypeA(3)155sage: a = A.algebra_generators();a156Finite family {0: a0, 1: a1, 2: a2}157sage: a[1]158a1159"""160return self.weyl_group().simple_reflections().map(self.monomial)161162def algebra_generator(self, i):163"""164EXAMPLES::165166sage: A = AffineNilTemperleyLiebTypeA(3)167sage: A.algebra_generator(1)168a1169sage: A = AffineNilTemperleyLiebTypeA(3, prefix = 't')170sage: A.algebra_generator(1)171t1172"""173return self.algebra_generators()[i]174175def product_on_basis(self, w, w1):176"""177Returns `a_w a_{w1}`, where `w` and `w1` are in the Weyl group178assuming that `w` does not contain any braid relations.179180EXAMPLES::181182sage: A = AffineNilTemperleyLiebTypeA(5)183sage: W = A.weyl_group()184sage: s = W.simple_reflections()185sage: [A.product_on_basis(s[1],x) for x in s]186[a1*a0, 0, a1*a2, a3*a1, a4*a1]187188sage: a = A.algebra_generators()189sage: x = a[1] * a[2]190sage: x191a1*a2192sage: x * a[1]1930194sage: x * a[2]1950196sage: x * a[0]197a1*a2*a0198199sage: [x * a[1] for x in a]200[a0*a1, 0, a2*a1, a3*a1, a4*a1]201202sage: w = s[1]*s[2]*s[1]203sage: A.product_on_basis(w,s[1])204Traceback (most recent call last):205...206AssertionError207"""208assert(self(w) != self.zero())209for i in w1.reduced_word():210if self.has_no_braid_relation(w, i):211w = w.apply_simple_reflection(i)212else:213return self.zero()214return self.monomial(w)215216@cached_method217def has_no_braid_relation(self, w, i):218"""219Assuming that `w` contains no relations of the form `s_i^2` or `s_i s_{i+1} s_i` or220`s_i s_{i-1} s_i`, tests whether `w s_i` contains terms of this form.221222EXAMPLES::223224sage: A = AffineNilTemperleyLiebTypeA(5)225sage: W = A.weyl_group()226sage: s=W.simple_reflections()227sage: A.has_no_braid_relation(s[2]*s[1]*s[0]*s[4]*s[3],0)228False229sage: A.has_no_braid_relation(s[2]*s[1]*s[0]*s[4]*s[3],2)230True231sage: A.has_no_braid_relation(s[4],2)232True233"""234if w == w.parent().one():235return True236if i in w.descents():237return False238s = w.parent().simple_reflections()239wi = w*s[i]240adjacent = [(i-1)%w.parent().n, (i+1)%w.parent().n]241for j in adjacent:242if j in w.descents():243if j in wi.descents():244return False245else:246return True247return self.has_no_braid_relation(w*s[w.first_descent()],i)248249def _repr_term(self, t, short_display=True):250"""251EXAMPLES::252253sage: A = AffineNilTemperleyLiebTypeA(3)254sage: W = A.weyl_group()255sage: A._repr_term(W.from_reduced_word([1,2,0]))256'a1*a2*a0'257sage: A._repr_term(W.from_reduced_word([1,2,0]), short_display = False)258'a[1]*a[2]*a[0]'259"""260redword = t.reduced_word()261if len(redword) == 0:262return "1"263elif short_display:264return "*".join("%s%d"%(self._prefix, i) for i in redword)265else:266return "*".join("%s[%d]"%(self._prefix, i) for i in redword)267268269