18.23 Schubert Polynomials

Module: sage.combinat.schubert_polynomial

Schubert Polynomials

Module-level Functions

SchubertPolynomialRing( R)

Returns the Schubert polynomial ring over R on the X basis.

sage: X = SchubertPolynomialRing(ZZ); X
Schubert polynomial ring with X basis over Integer Ring
sage: X(1)
X[1]
sage: X([1,2,3])*X([2,1,3])
X[2, 1]
sage: X([2,1,3])*X([2,1,3])
X[3, 1, 2]
sage: X([2,1,3])+X([3,1,2,4])
X[2, 1] + X[3, 1, 2]
sage: a = X([2,1,3])+X([3,1,2,4])
sage: a^2
X[3, 1, 2] + 2*X[4, 1, 2, 3] + X[5, 1, 2, 3, 4]

is_SchubertPolynomial( x)

Returns True if x is a Schubert polynomial and False otherwise.

sage: X = SchubertPolynomialRing(ZZ)
sage: a = 1
sage: is_SchubertPolynomial(a)
False
sage: b = X(1)
sage: is_SchubertPolynomial(b)
True
sage: c = X([2,1,3])
sage: is_SchubertPolynomial(c)
True

Class: SchubertPolynomial_class

class SchubertPolynomial_class

Functions: divided_difference,$ \,$ expand,$ \,$ multiply_variable,$ \,$ scalar_product

divided_difference( self, i)

sage: X = SchubertPolynomialRing(ZZ)
sage: a = X([3,2,1])
sage: a.divided_difference(1)
X[2, 3, 1]
sage: a.divided_difference([3,2,1])
X[1]

expand( self)

sage: X = SchubertPolynomialRing(ZZ)
sage: X([2,1,3]).expand()
x0
sage: map(lambda x: x.expand(), [X(p) for p in Permutations(3)])
[1, x0 + x1, x0, x0*x1, x0^2, x0^2*x1]

TESTS: Calling .expand() should always return an element of an MPolynomialRing

sage: X = SchubertPolynomialRing(ZZ)
sage: f = X([1]); f
X[1]
sage: type(f.expand())
<class 'sage.rings.polynomial.multi_polynomial_element.MPolynomial_polydict
'>
sage: f.expand()
1
sage: f = X([1,2])
sage: type(f.expand())
<class 'sage.rings.polynomial.multi_polynomial_element.MPolynomial_polydict
'>
sage: f = X([1,3,2,4])
sage: type(f.expand())
<class 'sage.rings.polynomial.multi_polynomial_element.MPolynomial_polydict
'>

multiply_variable( self, i)

Returns the Schubert polynomial obtained by multiplying self by the variable x_i.

sage: X = SchubertPolynomialRing(ZZ)
sage: a = X([3,2,4,1])
sage: a.multiply_variable(0)
X[4, 2, 3, 1]
sage: a.multiply_variable(1)
X[3, 4, 2, 1]
sage: a.multiply_variable(2)
X[3, 2, 5, 1, 4] - X[3, 4, 2, 1] - X[4, 2, 3, 1]
sage: a.multiply_variable(3)
X[3, 2, 4, 5, 1]

scalar_product( self, x)

Returns the standard scalar product of self and x.

sage: X = SchubertPolynomialRing(ZZ)
sage: a = X([3,2,4,1])
sage: a.scalar_product(a)
0
sage: b = X([4,3,2,1])
sage: b.scalar_product(a)
X[1, 3, 4, 6, 2, 5]
sage: Permutation([1, 3, 4, 6, 2, 5, 7]).to_lehmer_code()
[0, 1, 1, 2, 0, 0, 0]
sage: s = SFASchur(ZZ)
sage: c = s([2,1,1])
sage: b.scalar_product(a).expand()
x0^2*x1*x2 + x0*x1^2*x2 + x0*x1*x2^2 + x0^2*x1*x3 + x0*x1^2*x3 + x0^2*x2*x3
+ 3*x0*x1*x2*x3 + x1^2*x2*x3 + x0*x2^2*x3 + x1*x2^2*x3 + x0*x1*x3^2 +
x0*x2*x3^2 + x1*x2*x3^2
sage: c.expand(4)
x0^2*x1*x2 + x0*x1^2*x2 + x0*x1*x2^2 + x0^2*x1*x3 + x0*x1^2*x3 + x0^2*x2*x3
+ 3*x0*x1*x2*x3 + x1^2*x2*x3 + x0*x2^2*x3 + x1*x2^2*x3 + x0*x1*x3^2 +
x0*x2*x3^2 + x1*x2*x3^2

Class: SchubertPolynomialRing_xbasis

class SchubertPolynomialRing_xbasis
SchubertPolynomialRing_xbasis( self, R)

sage: X = SchubertPolynomialRing(QQ)
sage: X == loads(dumps(X))
True

Special Functions: __init__,$ \,$ _coerce_start,$ \,$ _multiply_basis

_coerce_start( self, x)

Coerce x into self.

sage: X = SchubertPolynomialRing(QQ)
sage: X._coerce_start([2,1,3])
X[2, 1]
sage: X._coerce_start(Permutation([2,1,3]))
X[2, 1]

sage: R.<x1, x2, x3> = QQ[]
sage: X(x1^2*x2)
X[3, 2, 1]

_multiply_basis( self, left, right)

sage: p1 = Permutation([3,2,1])
sage: p2 = Permutation([2,1,3])
sage: X = SchubertPolynomialRing(QQ)
sage: X._multiply_basis(p1,p2)
{[4, 2, 1, 3]: 1}

See About this document... for information on suggesting changes.