{"id":25059951,"url":"https://github.com/stla/jackpolynomials","last_synced_at":"2025-03-31T11:15:07.425Z","repository":{"id":49377339,"uuid":"517497598","full_name":"stla/jackpolynomials","owner":"stla","description":"Jack, zonal, and Schur polynomials","archived":false,"fork":false,"pushed_at":"2024-04-03T23:45:28.000Z","size":122,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-04-04T10:56:15.133Z","etag":null,"topics":["haskell","jack-polynomials","schur-polynomials","zonal-polynomials"],"latest_commit_sha":null,"homepage":"","language":"Haskell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stla.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2022-07-25T02:56:53.000Z","updated_at":"2024-04-15T05:57:25.026Z","dependencies_parsed_at":"2024-04-15T05:57:10.633Z","dependency_job_id":"77cf9dac-9a66-41fe-9b2c-bc3a0bcbc0e8","html_url":"https://github.com/stla/jackpolynomials","commit_stats":{"total_commits":19,"total_committers":1,"mean_commits":19.0,"dds":0.0,"last_synced_commit":"25bb1996fb6445ee6077cbb9d227b5256f57f531"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stla%2Fjackpolynomials","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stla%2Fjackpolynomials/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stla%2Fjackpolynomials/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stla%2Fjackpolynomials/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stla","download_url":"https://codeload.github.com/stla/jackpolynomials/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246458010,"owners_count":20780678,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["haskell","jack-polynomials","schur-polynomials","zonal-polynomials"],"created_at":"2025-02-06T15:56:01.080Z","updated_at":"2025-03-31T11:15:07.398Z","avatar_url":"https://github.com/stla.png","language":"Haskell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jackpolynomials\n\n***Jack, zonal, Schur, and other symmetric polynomials.***\n\n\u003c!-- badges: start --\u003e\n[![Stack-lts](https://github.com/stla/jackpolynomials/actions/workflows/Stack-lts.yml/badge.svg)](https://github.com/stla/jackpolynomials/actions/workflows/Stack-lts.yml)\n[![Stack-nightly](https://github.com/stla/jackpolynomials/actions/workflows/Stack-nightly.yml/badge.svg)](https://github.com/stla/jackpolynomials/actions/workflows/Stack-nightly.yml)\n\u003c!-- badges: end --\u003e\n\nSchur polynomials have applications in combinatorics and zonal polynomials have\napplications in multivariate statistics. They are particular cases of\n[Jack polynomials](https://en.wikipedia.org/wiki/Jack_function), which are \nmultivariate symmetric polynomials. This package\nallows to compute these polynomials. It also allows to compute other \nsymmetric polynomials: $t$-Schur polynomials, \nHall-Littlewood polynomials, and Macdonald \npolynomials. In addition, it provides some functions to compute Kostka-Jack \nnumbers, Kostka-Foulkes polynomials, Kostka-Macdonald polynomials, Hall \npolynomials, and to enumerate Gelfand-Tsetlin patterns.\n\n___\n\nEvaluation of the Jack polynomial with Jack parameter `2`, associated to the \ninteger partition `[3, 1]`, at `x1 = 1` and `x2 = 1`:\n\n```haskell\nimport Math.Algebra.Jack\njack' [1, 1] [3, 1] 2 'J'\n-- 48 % 1\n```\n\nThe last argument, here `'J'`, is used to specify the choice of the Jack \npolynomial, because there are four possible Jack polynomials for a given \nJack parameter and a given integer partition: the $J$-polynomial, \nthe $P$-polynomial, the $Q$-polynomial and the $C$-polynomial, each \ncorresponding to a certain normalization. \n\nThe non-evaluated Jack polynomial:\n\n```haskell\nimport Math.Algebra.JackPol\nimport Math.Algebra.Hspray\njp = jackPol' 2 [3, 1] 2 'J'\nputStrLn $ prettyQSpray jp\n-- 18*x^3.y + 12*x^2.y^2 + 18*x.y^3\nevalSpray jp [1, 1]\n-- 48 % 1\n```\n\nThe first argument, here `2`, is the number of variables of the polynomial.\n\nJack polynomials are generalized by skew Jack polynomials, which are available \nin the package as of version `1.4.5.0`.\n\n\n### Symbolic Jack parameter\n\nAs of version `1.2.0.0`, it is possible to get Jack polynomials with a \nsymbolic Jack parameter:\n\n```haskell\nimport Math.Algebra.JackSymbolicPol\nimport Math.Algebra.Hspray\njp = jackSymbolicPol' 2 [3, 1] 'J'\nputStrLn $ prettyParametricQSpray jp\n-- { [ 2*a^2 + 4*a + 2 ] }*X^3.Y + { [ 4*a + 4 ] }*X^2.Y^2 + { [ 2*a^2 + 4*a + 2 ] }*X.Y^3\nputStrLn $ prettyQSpray' $ substituteParameters jp [2]\n-- 18*x^3.y + 12*x^2.y^2 + 18*x.y^3\n```\n\nThis is possible thanks to the **hspray** package which provides the type \n`ParametricSpray`. An object of this type represents a multivariate polynomial \nwhose coefficients depend on some parameters which are symbolically treated. \nThe type of the Jack polynomial returned by the `jackSymbolicPol` function is \n`ParametricSpray a`, and it is `ParametricQSpray` for the `jackSymbolicPol'` \nfunction. The type `ParametricQSpray` is an alias of `ParametricSpray Rational`.\n\nFrom the definition of Jack polynomials, as well as from their implementation \nin this package, the coefficients of the Jack polynomials are \n*fractions of polynomials* in the Jack parameter. However, in the above \nexample, one can see that the coefficients of the Jack polynomial `jp` are \n*polynomials* in the Jack parameter `a`. This fact actually is always true for \nthe $J$-Jack polynomials (not for $C$, $P$ and $Q$). This is a consequence of \nthe Knop \u0026 Sahi combinatorial formula. But be aware that in spite of this fact, \nthe coefficients of the polynomials returned by Haskell are *fractions* of \npolynomials, in the sense that this is the nature of the `ParametricSpray` \nobjects. \n\nNote that if you use the function `jackSymbolicPol` to get a \n`ParametricSpray Double` object in the output, it is not guaranted that you \nwill visually get some polynomials in the Jack parameter for the coefficients, \nbecause the arithmetic operations are not exact with the `Double` type.\n\n\n### Showing symmetric polynomials\n\nAs of version 1.2.1.0, there is a module providing some functions to print a \nsymmetric polynomial as a linear combination of the monomial symmetric \npolynomials. This can considerably shorten the expression of a symmetric \npolynomial as compared to its expression in the canonical basis, and the \nmotivation to add this module to the package is that any Jack polynomial is \na symmetric polynomial. Here is an example:\n\n```haskell\nimport Math.Algebra.JackPol\nimport Math.Algebra.SymmetricPolynomials\njp = jackPol' 3 [3, 1, 1] 2 'J'\nputStrLn $ prettySymmetricQSpray jp\n-- 42*M[3,1,1] + 28*M[2,2,1]\n```\n\nAnd another example, involving a Jack polynomial with symbolic Jack\nparameter:\n\n```haskell\nimport Math.Algebra.JackSymbolicPol\nimport Math.Algebra.SymmetricPolynomials\njp = jackSymbolicPol' 3 [3, 1, 1] 'J'\nputStrLn $ prettySymmetricParametricQSpray [\"a\"] jp\n-- { [ 4*a^2 + 10*a + 6 ] }*M[3,1,1] + { [ 8*a + 12 ] }*M[2,2,1]\n```\n\nOf course you can use these functions for other polynomials, but carefully: \nthey do not check the symmetry. This new module provides the function \n`isSymmetricSpray` to check the symmetry of a polynomial, much more efficient \nthan the function with the same name in the **hspray** package.\n\n\n### Hall inner product\n\nAs of version 1.4.1.0, the package provides an implementation of the Hall \ninner product with Jack parameter, aka the Jack scalar product. It is known \nthat the Jack polynomials with Jack parameter $\\alpha$ are orthogonal for \nthe Hall inner product with Jack parameter $\\alpha$. \n\nThere is a function `hallInnerProduct` as well as a function \n`symbolicHallInnerProduct`. The latter allows to get the Hall inner product \nof two symmetric polynomials without substituting a value to the parameter \n$\\alpha$. The Hall inner product of two symmetric polynomials is a polynomial \nin $\\alpha$, so the result of `symbolicHallInnerProduct` is a `Spray` object.\n\nLet's see a first example with a power sum polynomial. These symmetric \npolynomials are implemented in the package. We display the result by using \n`alpha` to denote the parameter of the Hall product.\n\n```haskell\nimport Math.Algebra.SymmetricPolynomials \nimport Math.Algebra.Hspray hiding (psPolynomial)\npsPoly = psPolynomial 4 [2, 1, 1] :: QSpray\nhip = symbolicHallInnerProduct psPoly psPoly\nputStrLn $ prettyQSprayXYZ [\"alpha\"] hip\n-- 4*alpha^3\n```\n\nNow let's consider the following situation. We want to get the symbolic Hall \ninner product of a Jack polynomial with itself, and we deal with a symbolic \nJack parameter in this polynomial. We denote it by `t` to distinguish it from \nthe parameter of the Hall product that we still denote by `alpha`.\n\nThe signature of the `symbolicHallInnerProduct` is a bit misleading:\n```haskell\nSpray a -\u003e Spray a -\u003e Spray a\n```\nbecause the `Spray a` of the output is not of the same family as the two \n`Spray a` inputs: this is a univariate polynomial in $\\alpha$. \n\nWe use the function `jackSymbolicPol'` to compute a Jack polynomial. It\nreturns a `ParametricQSpray` spray, a type alias of `Spray RatioOfQSprays`.\n\n```haskell\nimport Math.Algebra.JackSymbolicPol\nimport Math.Algebra.SymmetricPolynomials \nimport Math.Algebra.Hspray \njp = jackSymbolicPol' 2 [3, 1] 'P'\nhip = symbolicHallInnerProduct jp jp\nputStrLn $ prettyParametricQSprayABCXYZ [\"t\"] [\"alpha\"] hip\n-- { [ 3*t^2 + 6*t + 11 ] %//% [ t^2 + 2*t + 1 ] }*alpha^2 + { [ 4*t^2 + 16*t + 16 ] %//% [ t^2 + 2*t + 1 ] }*alpha\n```\n\nOne could be interested in computing the Hall inner product of a Jack \npolynomial with itself when the Jack parameter and the parameter of the \nHall product are identical. That is, we want to take `alpha = t` in the \nabove expression. Since the symbolic Hall product is a `ParametricQSpray` \nspray, one can substitute its variable `alpha` by a `RatioOfQSprays` \nobject. On the other hand, `t` represents a `QSpray` object, but one can \nidentify a `QSpray` to a `RatioOfQSprays` by taking the unit spray as the \ndenominator, that is, by applying the `asRatioOfSprays` function. Finally \nwe get the desired result if we evaluate the symbolic Hall product by \nreplacing `alpha` with `asRatioOfSprays (qlone 1)`, since `t` is the \nfirst polynomial variable, `qlone 1`. \n\n```haskell\nprettyRatioOfQSpraysXYZ [\"t\"] $ evaluate hip [asRatioOfSprays (qlone 1)]\n-- [ 3*t^4 + 10*t^3 + 27*t^2 + 16*t ] %//% [ t^2 + 2*t + 1 ]\n```\n\n\n### Hall-Littlewood polynomials\n\nThe package can also compute the Hall-Littlewood polynomials. A Hall-Littlewood \npolynomial is a multivariate symmetric polynomial associated to an integer \npartition and whose coefficients depend on a parameter. More precisely, the \ncoefficients are some polynomials in this parameter. So the Hall-Littlewood \npolynomials implemented in the package, returned by the \n`hallLittlewoodPolynomial` function, are represented by some sprays of type \n`SimpleParametricSpray a`, an alias of the type `Spray (Spray a)`. \n\nWhen the value of the parameter of a Hall-Littlewood $P$-polynomial is `0`, then \nthis polynomial is the Schur polynomial of the given partition.\n\n```haskell\nimport Math.Algebra.JackPol\nimport Math.Algebra.SymmetricPolynomials \nimport Math.Algebra.Hspray \nlambda = [2, 1]\nhlPoly = hallLittlewoodPolynomial' 3 lambda 'P' \nputStrLn $ prettySymmetricSimpleParametricQSpray [\"t\"] hlPoly\n-- (1)*M[2,1] + (-t^2 - t + 2)*M[1,1,1]\nhlPolyAt0 = substituteParameters hlPoly [0]\nhlPolyAt0 == schurPol' 3 lambda\n-- True\n```\n\n\n### Macdonald polynomials\n\nAs of version 1.4.5.0, the package can compute some Macdonald polynomials. \nThe Macdonald polynomials are symmetric multivariate polynomials whose \ncoefficients depend on two parameters usually denoted by $q$ and $t$. \nLet's consider for example the Macdonald $P$-polynomial. It generalizes \nthe Hall-Littlewood $P$-polynomial: the Hall-Littlewood $P$-polynomial with \nparameter $t$ is obtained from the Macdonald $P$-polynomial by substituting\nthe parameter $q$ with $0$.\n\n```haskell\nimport Math.Algebra.Hspray\nimport Math.Algebra.SymmetricPolynomials\nn = 4\nlambda = [2, 2]\nmacPoly = macdonaldPolynomial' n lambda 'P'\npoly = changeParameters macPoly [zeroSpray, qlone 1]\nhlPoly = hallLittlewoodPolynomial' n lambda 'P'\nasSimpleParametricSpray poly == hlPoly\n-- True\n```\n\nWe use `asSimpleParametricSpray` because, contrary to the Hall-Littlewood \n$P$-polynomial, the Macdonald $P$-polynomial is not represented by a \n`SimpleParametricSpray a` spray but by a `ParametricSpray a` spray, because \nits coefficients are not polynomials in the two parameters $q$ and $t$, but \nratios of polynomials.\n\n\n### Kostka-Jack numbers, Kostka-Foulkes polynomials, and Kostka-Macdonald polynomials\n\nThe package can also compute the Kostka-Jack numbers (i.e. Kostka numbers with\na Jack parameter), the Kostka-Foulkes polynomials (aka $t$-Kostka polynomials), \nthe Kostka-Macdonald polynomials (aka $qt$-Kostka polynomials), and the \nHall polynomials. Skew generalizations are also available: skew Kostka-Jack \nnumbers, skew Kostka-Foulkes polynomials, and skew Kostka-Macdonald polynomials.\n\n\n### Semistandard Young tableaux and Gelfand-Tsetlin patterns \n\nThe package allows to enumerate the semistandard Young tableaux with a given \nshape, possibly skew, and a given weight, and to enumerate Gelfand-Tsetlin \npatterns defined by a skew partition.\n\n\n\n## References\n\n* I.G. Macdonald. *Symmetric Functions and Hall Polynomials*. Oxford Mathematical Monographs. The Clarendon Press Oxford University Press, New York, second edition, 1995.\n\n* J. Demmel and P. Koev. *Accurate and efficient evaluation of Schur and Jack functions*. Mathematics of computations, vol. 75, n. 253, 223-229, 2005.\n\n* The symmetric functions catalog. \u003chttps://www.symmetricfunctions.com/index.htm\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstla%2Fjackpolynomials","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstla%2Fjackpolynomials","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstla%2Fjackpolynomials/lists"}