A python package for manipulation of symmetric polynomials.
Project description
pySymmPol: Symmetric Polynomials
This is a python package for manipulation of some symmetric polynomials (or functions). Among them, we have
- Complete homogeneous Symmetric Functions
- Elementary symmetric polynomials
- Monomial symmetric polynomials
- Schur polynomials
- Hall-Littlewood polynomials
Moreover, we have a module with basic functionalities for integer partitions and Young Diagrams manipulation.
Documentation
The documentation is [here], where I also included some [tutorials].
Dependencies
This package was tested on:
- Python 3.12
- Sympy 1.12
- Numpy 1.26.4
Installation
The package can be installed with pip:
$ pip install pysymmpol
Basic Usage
PySymmPol
has seven main classes for manipulation of different
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 difference between these two classes are the different representations of the diagrams. YoungDiagram represents them using a monotonic decreasing sequence; and ConjugacyClass as a sequence representing the cycle of the symmetric group S_n. Let us create the partition (3,2,1) represented as a tuple in the YoungDiagram class, and as a dictionary in the ConjugacyClass {1: 1, 2: 1, 3: 1},
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 gives the output (the argument 4 means that we draw the octothorpe, there are 4 other symbols).
#
# #
# # #
#
# #
# # #
Description of the other functionalities can be seen 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
in the utils
module, for convenience.
Let us create the polynomials at the level n=3. We can instanciate them, and find
the explicit expression using the method explicit(t)
, there t
are the
Miwa coordinates.
n = 3
t = create_miwa(n)
homogeneous = HomogeneousPolynomial(n)
elementary = ElementaryPolynomial(n)
print(f"homogeneous: {homogeneous.explicit(t)}")
print(f"elementary: {elementary.explicit(t)})
that gives the output
homogeneous: t1**3/6 + t1*t2 + t3
elementary: t1**3/6 - t1*t2 + t3
Schur Polynomials
For Schur polynomials, we need to instanciate a partition before the polynomial itself. Let us use the Young diagram we considered a few lines above,
from pysymmpol import YoungDiagram
from pysymmpol import SchurPolynomial
from pysymmpol.utils import create_miwa
The class Young diagram has a getter for the number of boxes in the diagram. We use it to built the Miwa coordinates. The class SchurPolynomial is instanciated using the young diagram.
young = YoungDiagram((3,2,1))
t = create_miwa(young.boxes)
schur = SchurPolynomial(young)
print(f"schur: {schur.explicit(t)}")
that gives the output
schur: t1**6/45 - t1**3*t3/3 + t1*t5 - t3**2
In the documentation and tutorial, you can find some examples 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 that we import the function create_x_coord
from the utils
module.
young = YoungDiagram((3,2,1))
n = 3
x = create_x_coord(n)
monomial = MonomialPolynomial(young)
print(f"monomial: {monomial.explicit(x)}")
that 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
Finally, for the Hall-Littlewood polynomials, besides the partitions, we also need the deformation parameter Q (because 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.
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)}")
that gives the output
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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pysymmpol-0.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 885928ede2095e92fef024bf6f27fd47fc25186adae1b2769f2c92048735399f |
|
MD5 | ac561ec764a36f36544e96df56ec8034 |
|
BLAKE2b-256 | e50f6d64503e8a3a88b0142a533033ea4873efde64176012c6a220903fc403ac |