haarpy 0.0.4

Creator: bradpython12

Last updated:

0 purchases

TODO
Add to Cart

Description:

haarpy 0.0.4

Haarpy is a Python library for the symbolic calculation of Weingarten functions and related averages of unitary matrices U(d) sampled uniformly at random from the Haar measure.
The original Mathematica version of this code, for the calculation of Weingarten functions of the unitary group, can be found here.
Haarpy in action
The main functions of Haarpy are weingarten_class and weingarten_element allowing for the calculation of Weingarten functions. These functions vary in their parameters. We recommend importing the following when working with Haarpy.
from sympy import Symbol
from sympy.combinatorics import Permutation

d = Symbol("d")

weingarten_class
Takes a partition, labeling a conjugacy class of Sp, and a dimension d as arguments. For the conjugacy class labeled by partition {3,1}, the function returns
from haarpy import weingarten_class
weingarten_class((3,1),d)

(2*d**2 - 3)/(d**2*(d - 3)*(d - 2)*(d - 1)*(d + 1)*(d + 2)*(d + 3))

The previous can also be called with integer values as such
weingarten_class((3,1),4)

29/20160

weingarten_element
Takes an element and the degree p of the symmetric group Sp, and a dimension d as arguments, the conjugacy class being obtained from the first two.
from haarpy import weingarten_element
weingarten_element(Permutation(0,1,2), 4, d)

(2*d**2 - 3)/(d**2*(d - 3)*(d - 2)*(d - 1)*(d + 1)*(d + 2)*(d + 3))

Which yields the same result as before since {3,1} is the class of permutation (0,1,2) in S4.
Auxiliary functions include, but are not limited to, the following. For a comprehensive list of functionalities, please refer to the documentation.
murn_naka
Implementation of the Murnaghan-Nakayama rule for the characters irreducible representations of the symmetric group Sp. Takes a partition characterizing an irrep of Sp and a conjugacy class and yields the associate character.
from haarpy import murn_naka
murn_naka((3,1), (1,1,1,1))

3

get_class
Returns the class of a given element of Sp when given the order and the element.
from haarpy import get_class
get_class(Permutation(0,1,2), 4)

(3,1)

sn_dimension
Takes a partition labeling an irrep of Sp and returns the dimension of this irrep.
from haarpy import sn_dimension
sn_dimension((5,4,2,1,1,1))

63063

ud_dimension
Takes a partition labeling an irrep of the unitary group U(d), as well as the dimension d, and returns the dimension of this irrep.
from haarpy import ud_dimension
ud_dimension((5, 4, 2, 1, 1, 1),d)

d**2*(d - 5)*(d - 4)*(d - 3)*(d - 2)*(d - 1)**2*(d + 1)**2*(d + 2)**2*(d + 3)*(d + 4)/1382400

Which can also be done numerically.
ud_dimension((5, 4, 2, 1, 1, 1),8)

873180

Tables of Weingarten functions for n≤5
The following have been retrieved using the weingarten_class function. Weingarten functions of symmetric groups of higher degrees can just as easily be obtained.
Symmetric group S2



Class
Weingarten




{2}
−1(d−1)d(d+1)


{1,1}
1(d−1)(d+1)



Symmetric group S3



Class
Weingarten




{3}
2(d−2)(d−1)d(d+1)(d+2)


{2,1}
−1(d−2)(d−1)(d+1)(d+2)


{1,1,1}
d2−2(d−2)(d−1)d(d+1)(d+2)



Symmetric group S4



Class
Weingarten




{4}
−5(d−3)(d−2)(d−1)d(d+1)(d+2)(d+3)


{3,1}
2d2−3(d−3)(d−2)(d−1)d2(d+1)(d+2)(d+3)


{2,2}
d2+6(d−3)(d−2)(d−1)d2(d+1)(d+2)(d+3)


{2,1,1}
−1(d−3)(d−1)d(d+1)(d+3)


{1,1,1,1}
d4−8d2+6(d−3)(d−2)(d−1)d2(d+1)(d+2)(d+3)



Symmetric group S5



Class
Weingarten




{5}
14(d−4)(d−3)(d−2)(d−1)d(d+1)(d+2)(d+3)(d+4)


{4,1}
24−5d2(d−4)(d−3)(d−2)(d−1)d2(d+1)(d+2)(d+3)(d+4)


{3,2}
−2(d2+12)(d−4)(d−3)(d−2)(d−1)d2(d+1)(d+2)(d+3)(d+4)


{3,1,1}
2(d−4)(d−2)(d−1)d(d+1)(d+2)(d+4)


{2,2,1}
−d4+14d2−24(d−4)(d−3)(d−2)(d−1)d2(d+1)(d+2)(d+3)(d+4)


{1,1,1,1,1}
d4−20d2+78(d−4)(d−3)(d−2)(d−1)d(d+1)(d+2)(d+3)(d+4)



Installation
Haarpy requires Python version 3.9 or later. Installation can be done through the pip command
pip install haarpy

Compiling from source
Haarpy has the following dependencies:

Python >= 3.9
NumPy >= 1.26.4
SymPy >= 1.12

Documentation
Haarpy documentation is available online on Read the Docs.
How to cite this work
Please cite as:
@misc{cardin2024haarpy,
author={Cardin, Yanic and de Guise, Hubert and Quesada, Nicol{\'a}s},
title={Haarpy, a Python library for the symbolic calculation of Weingarten functions},
year={2024},
publisher={GitHub},
journal={GitHub repository},
howpublished = {\url{https://github.com/polyquantique/haarpy}},
version = {0.0.4}
}

Authors

Yanic Cardin, Hubert de Guise, Nicolás Quesada.

License
Haarpy is free and open source, released under the Apache License, Version 2.0.

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files:

Customer Reviews

There are no reviews.