pySymmPol: Symmetric Polynomials
This Python package is designed for the manipulation of various symmetric polynomials or functions. It includes the following types:
1. Complete homogeneous Symmetric Functions
2. Elementary symmetric polynomials
3. Monomial symmetric polynomials
4. Schur polynomials
5. Hall-Littlewood polynomials
Additionally, the package contains a module with basic functionalities for manipulating integer partitions and Young diagrams.
Read our Statement of need here.
Tutorials can be found in the documentation page.
Dependencies
This package has been tested with the following versions:
- Python >= 3.11
- SymPy >= 1.11
- NumPy >= 1.26.2
Installation
The package can be installed with pip:
$ pip install pysymmpol
Basic Usage
The PySymmPol package has seven main classes for manipulating various symmetric polynomials.
YoungDiagram and ConjugacyClass
For the construction and manipulation of Young diagrams, we need to import the YoungDiagram and the ConjugacyClass classes.
from pysymmpol import YoungDiagram, ConjugacyClass
The distinction between these two classes lies in the representations of the diagrams they handle. The YoungDiagram class represents diagrams using a monotonic decreasing sequence, while the ConjugacyClass class represents them as a sequence representing the cycle of the symmetric group SnSn. For example, let's consider the partition (3,2,1), which is represented as a tuple in the YoungDiagram class and as a dictionary in the ConjugacyClass class {1: 1, 2: 1, 3: 1}, respectively.
young = YoungDiagram((3,2,1))
conjugacy = ConjugacyClass({1: 1, 2: 1, 3: 1})
Both objects describe the same mathematical entity, the partition 6=3+2+1. In fact, we have the usual pictorial representation
young.draw_diagram(4)
conjugacy.draw_diagram(4)
that give the same output (the argument 4 means that we draw the octothorpe, and there are 4 other symbols available).
#
# #
# # #
#
# #
# # #
Further details on the other functionalities can be found in the tutorial.
Homogeneous and Elementary Polynomials
These classes can be initialized as
from pysymmpol import HomogeneousPolynomial, ElementaryPolynomial
from pysymmpol.utils import create_miwa
We also imported the function create_miwa from the utils module for convenience.
Now, let's create the polynomials at level n=3. We can instantiate
them and find their explicit expressions using the explicit(t) method, where t
represents the Miwa coordinates. The block
n = 3
t = create_miwa(n)
homogeneous = HomogeneousPolynomial(n)
elementary = ElementaryPolynomial(n)
print(f"homogeneous: {homogeneous.explicit(t)}")
print(f"elementary: {elementary.explicit(t)}")
gives the output
homogeneous: t1**3/6 + t1*t2 + t3
elementary: t1**3/6 - t1*t2 + t3
Schur Polynomials
To create Schur polynomials, we first need to instantiate a partition before defining the polynomial itself. Let's use the Young diagram we considered a few lines above, then
from pysymmpol import YoungDiagram
from pysymmpol import SchurPolynomial
from pysymmpol.utils import create_miwa
The YoungDiagram class includes a getter method for retrieving the number of boxes in the diagram, which we utilize to construct the Miwa coordinates. Subsequently, the SchurPolynomial class is instantiated using the Young diagram. Then
young = YoungDiagram((3,2,1))
t = create_miwa(young.boxes)
schur = SchurPolynomial(young)
print(f"schur: {schur.explicit(t)}")
gives
schur: t1**6/45 - t1**3*t3/3 + t1*t5 - t3**2
The documentation and tutorial contain examples demonstrating how to find skew-Schur polynomials.
Monomial Symmetric Polynomials
For Monomial symmetric polynomials, we have a similar structure.
from pysymmpol import YoungDiagram
from pysymmpol import MonomialPolynomial
from pysymmpol.utils import create_x_coord
The only difference is the function create_x_coord from the utils module. Therefore,
young = YoungDiagram((3,2,1))
n = 3
x = create_x_coord(n)
monomial = MonomialPolynomial(young)
print(f"monomial: {monomial.explicit(x)}")
gives the output
monomial: x1*x2*x3*(x1**2*x2 + x1**2*x3 + x1*x2**2 + x1*x3**2 + x2**2*x3 + x2*x3**2)
Hall-Littlewood Polynomials
In addition to partitions, for the Hall-Littlewood polynomials, we also require the deformation parameter Q (as t has been used to denote the Miwa coordinates).
from sympy import Symbol
from pysymmpol import YoungDiagram
from pysymmpol import HallLittlewoodPolynomial
from pysymmpol.utils import create_x_coord
The method explicit(x, Q) needs another argument. Finally, the code
Q = Symbol('Q')
young = YoungDiagram((3,2,1))
n = 3
x = create_x_coord(n)
hall_littlewood = HallLittlewoodPolynomial(young)
print(f"hall-littlewood: {hall_littlewood.explicit(x, Q)}")
gives
hall-littlewood: x1*x2*x3*(-Q**2*x1*x2*x3 - Q*x1*x2*x3 + x1**2*x2 + x1**2*x3 + x1*x2**2 + 2*x1*x2*x3 + x1*x3**2 + x2**2*x3 + x2*x3**2)
References
Here are some recommended resources covering symmetric polynomials, combinatorics, and their significance in theoretical physics:
- Symmetric Functions and Hall Polynomials - Ian Macdonald
- An Introduction to Symmetric Functions and Their Combinatorics - Eric S. Egge
- Counting with Symmetric Functions - Mendes and Remmel
- Solitons: Differential Equations, Symmetries and Infinite Dimensional Algebras - Miwa, Jimbo and Date
- The uses of random partitions - Andrei Okounkov
Citation & Contributing
If you found this package useful in your research, please consider citing the companion paper available here: arxiv.org/abs/2403.13580.
@article{Araujo:2024piv,
author = "Araujo, Thiago",
title = "{PySymmPol: Symmetric Polynomials in Python}",
eprint = "2403.13580",
archivePrefix = "arXiv",
primaryClass = "math.CO",
month = "3",
year = "2024"
}
Feeling like contributing? Fork the project and open a pull request with your modifications. Found a bug? Just open a GitHub issue.
Metadata
Release files for pysymmpol 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pysymmpol-0.1.2.tar.gz | 27.2 kB | Without provenance | Details for pysymmpol-0.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pysymmpol-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for pysymmpol-0.1.2-py3-none-any.whl |
Total release size: 57.7 kB
Release files / pysymmpol-0.1.2.tar.gz
| Download URL | pysymmpol-0.1.2.tar.gz |
|---|---|
| Size | 27.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
aa3ef5fbba300290a515b10739cf7ad006c5d4fa1c80518e1b8147cfdc7cbe41
|
|
BLAKE2b-256 checksum How to use checksums |
91c203f3bfc06991f75c01e6c720a0f302aeb14a822ebc2b5a0c2ff4ba5d5768
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.3 Linux/6.8.9-200.fc39.x86_64
|
Release files / pysymmpol-0.1.2-py3-none-any.whl
| Download URL | pysymmpol-0.1.2-py3-none-any.whl |
|---|---|
| Size | 30.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b0dcdcd2b58694dc635bc7245e5b3b0676afb32b11417067d9fbfaf9a2d0f36c
|
|
BLAKE2b-256 checksum How to use checksums |
713928a99f9f08ffc3c68df6611b433a8dc541c2ab1bb50858b5dc23e3ec34d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.3 CPython/3.12.3 Linux/6.8.9-200.fc39.x86_64
|
Security for pysymmpol 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.