# The Generalized Temperley-Lieb Algebra in type A is just the (normal) Temperley-Lieb Algebra.
R.<v> = LaurentPolynomialRing(ZZ)
T = GeneralizedTemperleyLiebAlgebra('A', 4, R, v + 1/v)
U1, U2, U3 = T.algebra_generators()
# The basis elements are indexed by decorated Temperley-Lieb diagrams
U1
U1.plot()
(U1*U2*U1).plot()
# Type B
R.<v> = LaurentPolynomialRing(QQ)
T = GeneralizedTemperleyLiebAlgebra('B', 5, R, v + 1/v)
U1, U2, U3, U4 = T.algebra_generators()
U1
U1.plot()
(U1*U2*U1*U2).plot()
# TL Algebras have a canonical basis, indexed by the fully commutative elements of W
C = T.canonical_basis(); FC = C.keys()
C[FC([2, 1, 3, 2, 4, 3])].plot()
C[FC([1, 3, 2, 4, 1])].plot()
# In type B, certain canonical diagrams are best represented with a "square" decoration;
# we can re-express a B-canonical diagrams using this decoration:
C[FC([1, 3, 2, 4, 1])].canonical_redecoration().plot()
# Type H is also supported
R.<v> = LaurentPolynomialRing(ZZ)
T = GeneralizedTemperleyLiebAlgebra('H', 5, R, v + 1/v)
U1, U2, U3, U4 = T.algebra_generators()
U1.plot()
(U1*U2*U1*U2*U1).plot()
(3*U1*U2*U1 - U1).plot()