Advanced maths

Kazhdan Lusztig polynomial calculator for two permutations

Compute the Coxeter type-A Kazhdan–Lusztig polynomial for two permutations, with exact coefficients and Bruhat-order checks.

Your numbers

Zero-based one-line permutation, same size as w.
Zero-based one-line permutation, at most 5 entries.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Compute the Coxeter type-A Kazhdan–Lusztig polynomial for two permutations, with exact coefficients and Bruhat-order checks.

THE FORMULAPx, w(q)=0 if x≰w; Pw, w=1; deg Px, w≤(ℓ(w)−ℓ(x)−1)/2 for x<w.

A worked example

For x=identity and w=(2,3,0,1), ordinary 3412, the default polynomial is 1+q.

Good to know

Type-A symmetric groups S_n with n≤5; exact integer coefficients and memoized right-descent recurrence with 200000-call cap. Not matroid, poset, parabolic or unequal-parameter KL polynomials; no geometric singularity classification inferred.

A two-permutation invariant

A Kazhdan–Lusztig polynomial in a Coxeter group is attached to an ordered pair of elements. It records more than the inversion lengths of those elements, because the interval between them in Bruhat order matters. Two pairs with the same length difference can therefore have different polynomials.

This calculator works in finite type A, where the elements are ordinary permutations. The name also appears in matroid and poset constructions with different definitions. Those variants are not substitutions for the Coxeter polynomial returned here, even if they share a constant term or a similar degree bound.

The default Bruhat interval gives 1+qq⁰q¹11x = 1234w = 3412Px,w = 1 + q
Scroll across to see the full diagram.
The identity-to 3412 polynomial has two unit coefficients and degree 1.

Compare this with the Symmetric group irreducible character calculator from partitions. Compute P_x,w(q) in type A from Bruhat order and the KL recurrence, not a symmetric-group irreducible character value.

Bruhat order comes before recursion

Enter two zero-based one-line permutations of the same size. The lower row is x and the upper row is w. The calculator checks Bruhat comparability using sorted initial segments, not merely whether the lower permutation has fewer inversions.

If x is not below w, the polynomial is zero by convention. If x equals w, the answer is one. These cases are completed exact outputs, unlike a resource-limit failure. Keeping their meaning separate prevents a rejected or unsupported computation from being interpreted as a zero polynomial.

A first nonconstant example

The default lower permutation is the identity in S4, and the upper row is two-three-zero-one, conventionally written three-four-one-two. The upper element has four inversions. The returned polynomial has ascending coefficients one and one, meaning one plus q.

Its degree is one, which fits the upper bound of the integer part of three over two. A length bound alone would also permit the constant polynomial one, so that bound cannot determine the answer without the recurrence. The default is useful precisely because it exercises a nonconstant correction.

Right descents and correction terms

The implementation chooses a right descent of the upper element and reduces to shorter intervals. Its recurrence combines shifted lower-interval polynomials and subtracts correction terms indexed by intermediate Bruhat elements. Their top-degree coefficients supply the relevant mu values.

These corrections are essential: simply following a reduced word and multiplying elementary factors does not compute the same invariant. All intermediate polynomials are memoized, coefficients are arbitrary-precision integers and trailing zero coefficients are removed. The finite group is small enough that the intermediate elements can be enumerated explicitly.

Degree and coefficient checks

For a strict comparable pair, every result must satisfy the stated degree bound. Ordinary equal-parameter type-A coefficients are nonnegative, and the implementation checks this property before accepting a computed polynomial. These are structural safeguards, not replacements for an independently defined reference calculation.

The validation suite also compares the recurrence with an independent construction using R-polynomials and their defining identity. It covers every ordered pair in the smaller supported symmetric groups and selected S5 pairs. Agreement tests the recurrence's index and shift conventions, where an unnoticed left-versus-right change could otherwise survive simple examples.

Reading exact polynomial output

The coefficient list is ascending in q. A list one-zero-two would mean one plus two q squared, not q squared plus two. The zero polynomial has a separate degree label because assigning it an ordinary nonnegative degree would be misleading.

The memoized-interval count describes computational work, not a coefficient or geometric dimension. It can change if a different descent is chosen while the final polynomial remains the same. Export the coefficient array and the two permutations rather than treating internal recursion statistics as part of the invariant.

Interpretation and scope

Kazhdan–Lusztig polynomials have important representation-theoretic and Schubert-geometric interpretations, but those applications require matching conventions and additional mathematical data. This calculator does not decide every singularity property of an unspecified variety or return a character formula for an arbitrary algebraic group.

Use known comparable pairs, diagonal pairs and reversed incomparable pairs to check input conventions. A successful bounded result is exact for the declared finite Coxeter calculation. A cap failure makes no statement about whether the mathematical polynomial exists or about the difficulty of an equivalent calculation in another implementation.

A few questions, answered

What if x is not below w?

The type-A Coxeter polynomial is returned as zero, with comparability reported separately.

Are coefficients listed in descending powers?

No. The array starts with the constant coefficient and increases in powers of q.

Is this a matroid KL polynomial?

No. It is the Coxeter-group polynomial for two permutations in the stated type-A convention.

Does the degree bound determine the answer?

No. It is a necessary check; intermediate Bruhat structure determines the actual coefficients.

Find your calculator

Start typing to explore the library.