Macaulay2 » Documentation
Packages » MatrixSchubert :: Functions for investigating permutations
next | previous | forward | backward | up | index | toc

Functions for investigating permutations -- basic functions for permutations

This package provides significantly expanded functionality for studying permutations in Macaulay2.

Given a permutation as a list of integers, one can check if it is indeed a permutation, what its descent set is, what its inverse is, and the Coxeter length of the permutation.

i1 : v = {2,1,6,3,5,4};
i2 : isPerm v --checks if v is indeed a permutation

o2 = true
i3 : lastDescent v

o3 = 5
i4 : firstDescent v

o4 = 1
i5 : inverseOf v

o5 = {2, 1, 4, 6, 5, 3}

o5 : List

This package also allows one to quickly compute certain combinatorial polynomials associated to a permutation, such as the (double) Schubert polynomial and the Grothendieck polynomial.

i6 : u = {3,1,4,2}

o6 = {3, 1, 4, 2}

o6 : List
i7 : schubertPolynomial u

      2      2
o7 = x x  + x x
      1 2    1 3

o7 : QQ[x ..x ]
         1   4
i8 : doubleSchubertPolynomial u

      2      2      2                          2    2                      
o8 = x x  + x x  - x y  - x x y  - x x y  + x y  - x y  - x x y  - x x y  +
      1 2    1 3    1 1    1 2 1    1 3 1    1 1    1 2    1 2 2    1 3 2  
     ------------------------------------------------------------------------
                                  2        2      2
     2x y y  + x y y  + x y y  - y y  + x y  - y y
       1 1 2    2 1 2    3 1 2    1 2    1 2    1 2

o8 : QQ[x ..x , y ..y ]
         1   4   1   4
i9 : grothendieckPolynomial u

        2        2      2
o9 = - x x x  + x x  + x x
        1 2 3    1 2    1 3

o9 : QQ[x ..x ]
         1   4

Moreover, this package contains functionality for checking whether a permutation avoids a set of patterns. For instance, isCDG checks whether a permutation is CDG; isVexillary checks whether a permutation is 2143-avoiding; and isCartwrightSturmfels checks whether a permutation is Cartwright-Sturmfels.

i10 : w = {1,2,3,9,8,4,5,6,7};
i11 : isPatternAvoiding(w,{4,1,2,3})

o11 = false
i12 : isVexillary w

o12 = true
i13 : isCartwrightSturmfels w

o13 = false
i14 : isCDG w

o14 = true

Finally, this package contains functionality for studying both reduced and nonreduced pipe dreams of a permutation.

i15 : decompose antiDiagInit u

o15 = {monomialIdeal (z   , z   , z   ), monomialIdeal (z   , z   , z   )}
                       1,1   1,2   2,2                   1,1   1,2   3,1

o15 : List
i16 : pipeDreams u

o16 = {++//, ++//}
       /+//  ////
       ////  +///
       ////  ////

o16 : List
i17 : pipeDreamsNonReduced u

o17 = {++//, ++//, ++//}
       /+//  /+//  ////
       ////  +///  +///
       ////  ////  ////

o17 : List

Functions for studying permutations