Tutorial
A tour of the packages, from tableaux to symmetric, quasisymmetric and nonsymmetric polynomials, showing how the packages work together. Every code block below is run by the test suite (Tests/Tutorial.wlt), and every line ending in (* => ... *) is checked against the stated result, so the tutorial stays correct as the code changes.
Conventions (indexing, orientation, parameters) are collected in CONVENTIONS.md; Legacy/MIGRATION.md helps with old notebooks.
1. Loading
Load the paclet from a checkout (or install it, see README.md) and the packages you need. Each package loads its own dependencies.
PacletDirectoryLoad["/path/to/Mathematica-packages"];
Needs["NewTableaux`"]; Needs["GTPatterns`"]; Needs["SymmetricFunctions`"];
Needs["QuasiSymmetricFunctions`"]; Needs["NonsymmetricPolynomials`"];
Polynomials in finitely many variables are written in x[1], ..., x[n], with x any symbol.
2. Tableaux and Gelfand–Tsetlin patterns
Young tableaux are YoungTableau objects (English notation). The semistandard Young tableaux of shape (2, 1) and weight (1, 1, 1) are the two standard ones; each tableau corresponds to a Gelfand–Tsetlin pattern.
ssyt = SemiStandardYoungTableaux[{{2, 1}, {}}, {1, 1, 1}];
Length[ssyt] (* => 2 *)
gt = GTPattern[First[ssyt]] (* => GTPattern[{{0, 0}, {1, 0}, {1, 1}, {2, 1}}] *)
YoungTableau[gt] === First[ssyt] (* => True *)
GT patterns are stored bottom to top. GTPatterns[lam, mu, w] enumerates the patterns of shape lam and weight w; their number is a Kostka coefficient.
Length[GTPatterns[{3, 2}, {}, {2, 2, 1}]] == KostkaCoefficient[{3, 2}, {2, 2, 1}] (* => True *)
RSK sends a permutation (or a two-line array) to a pair of tableaux of the same shape:
{pTab, qTab} = BiwordRSK[{3, 1, 4, 2}];
pTab (* => YoungTableau[{{1, 2}, {3, 4}}] *)
YoungTableauShape[pTab] === YoungTableauShape[qTab] (* => True *)
3. Symmetric functions
Symmetric functions are linear combinations of basis symbols such as SchurSymbol[lam] (written s_lam), MonomialSymbol, ElementaryESymbol, CompleteHSymbol and PowerSumSymbol. To...Basis changes basis, and LRExpand expands products of Schur functions with the Littlewood–Richardson rule; LRCoefficient[lam, mu, nu] is the coefficient of s_nu in s_lam s_mu.
ToMonomialBasis[SchurSymbol[{2, 1}]] (* => MonomialSymbol[{2, 1}] + 2 MonomialSymbol[{1, 1, 1}] *)
LRExpand[SchurSymbol[{1}] SchurSymbol[{1}]] (* => SchurSymbol[{2}] + SchurSymbol[{1, 1}] *)
LRCoefficient[{2, 1}, {2, 1}, {3, 2, 1}] (* => 2 *)
Bridges connect symmetric functions with polynomials in finitely many variables, in both directions:
p = SymmetricFunctionToPolynomial[SchurSymbol[{2, 1}], x, 3];
PolynomialToSymmetricFunction[p, x, SchurSymbol, 3] (* => SchurSymbol[{2, 1}] *)
Families with parameters follow standard conventions; for example the modified Macdonald polynomials use Haglund’s convention:
ToSchurBasis[MacdonaldHSymmetric[{2}, q, t]] (* => SchurSymbol[{2}] + q SchurSymbol[{1, 1}] *)
4. Quasisymmetric functions
ToQuasiSymmetric embeds symmetric functions in QSym. A Schur function is the sum of fundamental quasisymmetric functions over the descent sets of standard Young tableaux:
ToFundamentalBasis[ToQuasiSymmetric[SchurSymbol[{2, 1}]]] (* => FundamentalQSymbol[{1, 2}] + FundamentalQSymbol[{2, 1}] *)
Quasisymmetric Schur functions refine Schur functions: summing over the rearrangements of a partition gives the Schur function back.
QuasiSchurQSymmetric[{2, 1, 3}, FundamentalQSymbol] (* => FundamentalQSymbol[{2, 1, 3}] + FundamentalQSymbol[{2, 2, 2}] + FundamentalQSymbol[{1, 2, 1, 2}] *)
Total[QuasiSchurQSymmetric /@ Permutations[{2, 1}]] - ToQuasiSymmetric[SchurSymbol[{2, 1}]] // Expand (* => 0 *)
5. Nonsymmetric polynomials and operators
Key polynomials, Demazure atoms, Schubert, Grothendieck and Lascoux polynomials, and nonsymmetric Macdonald polynomials are all generated by operators acting on monomials. Indices are weak compositions in the standard convention, κ_(0,1) = x1 + x2:
KeyPolynomial[{0, 1}, x] (* => x[1] + x[2] *)
DemazureOperator[x[1]^2, x, 1] (* => x[1]^2 + x[1] x[2] + x[2]^2 *)
KeyPolynomial[{0, 1, 2}, x] == Expand[SymmetricFunctionToPolynomial[SchurSymbol[{2, 1}], x, 3]] (* => True *)
A key polynomial of an increasing composition is a Schur polynomial (above); keys are sums of atoms, Schubert and Grothendieck polynomials come from divided differences, and dual Grothendieck polynomials from fillings (here g_(1,1) in two variables):
ToAtomBasis[KeyPolynomial[{1, 0, 2}, x], x] (* => AtomSymbol[{1, 0, 2}, x] + AtomSymbol[{1, 2}, x] + AtomSymbol[{2, 0, 1}, x] + AtomSymbol[{2, 1}, x] *)
SchubertPolynomial[{1, 3, 2}, x] (* => x[1] + x[2] *)
GrothendieckPolynomial[{1, 3, 2}, x] (* => x[1] + x[2] - x[1] x[2] *)
DualGrothendieckPolynomial[{1, 1}, x] (* => x[1] + x[2] + x[1] x[2] *)
Basis symbols work like the symmetric ones, and any polynomial can be expanded in keys, Schubert polynomials, slides, locks, and the K-theoretic families:
ToKeyBasis[x[1]^2 x[2] + x[1] x[2]^2, x] (* => KeySymbol[{1, 2}, x] *)
ToSchubertBasis[x[1]^2, x] (* => SchubertSymbol[{3, 1, 2}, x] *)
The nonsymmetric Macdonald polynomials E_α (Haglund–Haiman–Loehr convention) specialize to t-deformed atoms at q = 0 and to atoms at q = t = 0:
MacdonaldEPolynomial[{1, 0}, x, q, t] (* => x[1] + q (1 - t)/(1 - q t) x[2] *)
MacdonaldEPolynomial[{1, 0, 2}, x, 0, 0] == AtomPolynomial[{1, 0, 2}, x] (* => True *)
6. Shifted symmetric functions
Needs["ShiftedSymmetricFunctions`"];
Shifted Schur functions vanish at partitions not containing their index, and at their own index they give the product of hook lengths:
ShiftedSchurEvaluate[{2, 1}, {2}] (* => 0 *)
ShiftedSchurEvaluate[{2, 1}, {2, 1}] (* => 3 *)
NormalizedCharacter[{2}, {3, 1}] (* => 4 *)
7. Chromatic symmetric functions
Unit interval graphs are given by area sequences starting with 0, as in CatalanObjects. The chromatic symmetric function of the path on three vertices, expanded in elementary symmetric functions (Stanley–Stembridge: e-positive):
Needs["UnicellularChromatics`"];
edges = UnitIntervalEdges[{0, 1, 1}] (* => {{1, 2}, {2, 3}} *)
chrom = GraphChromaticSymmetricPolynomial[edges, 3, x, 1];
PolynomialToSymmetricFunction[chrom, x, ElementaryESymbol, 3] (* => 3 ElementaryESymbol[{3}] + ElementaryESymbol[{2, 1}] *)
8. Performance notes
- Results are memoized inside each package;
ClearNonsymmetricPolynomialsCache[](and the analogous functions) free memory. - Polynomials with symbolic parameters (q, t) can be large; substituting numbers early is much faster, and
MacdonaldEPolynomialhas a fast path for exact numeric q and t. - For long computations, run
wolframscriptwith a memory limit (for exampleulimit -v 6000000).
Further reading
README.md: the package list.CONVENTIONS.md: shared conventions.Examples/: runnable example scripts for each package.Legacy/MIGRATION.md: from the legacy packages to the current ones.- Usage messages:
?KeyPolynomial,?NonsymmetricPolynomials*`.