Jack polynomials in Python

Posted on May 15, 2024 by Stéphane Laurent
Tags: python, maths

In my previous post about the Jack polynomials, I said that I thought it would not be difficult to modify the code of my Python package jackpy in order to make it able to compute Jack polynomials with a symbolic parameter. I was right. I managed to do this modification and it sufficed to set a SymPy symbol as the Jack parameter instead of a number. So now Jack polynomials with a symbolic parameter are available in jackpy:

>>> from jackpy.jack import JackSymbolicPol
>>> poly = JackSymbolicPol(3, [2, 2])
>>> print(poly)
Poly((2*alpha**2 + 6*alpha + 4)*x_1**2*x_2**2 
 + (4*alpha + 8)*x_1**2*x_2*x_3 
 + (2*alpha**2 + 6*alpha + 4)*x_1**2*x_3**2 
 + (4*alpha + 8)*x_1*x_2**2*x_3 
 + (4*alpha + 8)*x_1*x_2*x_3**2 
 + (2*alpha**2 + 6*alpha + 4)*x_2**2*x_3**2, 
 x_1, x_2, x_3, domain='QQ(alpha)')

For some reason, this new version of jackpy is not available on ‘PyPi’ yet. So if you want to use it, you have to install the package hosted on the Github repository. I have not tried, but maybe this can be achieved by running the following command:

pip install git+https://github.com/stla/jackpy.git

I have not benchmarked so I don’t know how the speed compares with my implementations in other languages. By the way I improved the Haskell implementation, and it seems to be faster than the Julia implementation now.