Symmetric group#

This module provides tools to work with the symmetric group in the context of Weingarten calculus.

Symmetric group Python interface

References

[1] Collins, B. (2003). Moments and cumulants of polynomial random variables on unitarygroups, the Itzykson-Zuber integral, and free probability. International Mathematics Research Notices, 2003(17), 953-982.

[2] Matsumoto, S. (2013). Weingarten calculus for matrix ensembles associated with compact symmetric spaces. arXiv preprint arXiv:1301.5401.

[3] Macdonald, I. G. (1998). Symmetric functions and Hall polynomials. Oxford university press.

haarpy.symmetric.get_conjugacy_class(permutation)[source]#

Returns the conjugacy class of an element of the symmetric group \(S_p\)

Parameters:

permutation (Permutation) – A permutation of the symmetric group

Returns:

The conjugacy class (cycle-type) of the permutation

Return type:

tuple[int, ...]

Raises:

TypeError – The cycle must be of type sympy.combinatorics.Permutation

Examples

>>> from sympy.combinatorics import Permutation
>>> from haarpy import get_conjugacy_class
>>> get_conjugacy_class(Permutation(5)(0,1,3))
(3, 1, 1, 1)
haarpy.symmetric.derivative_tableaux(tableau, increment, partition)[source]#

Takes a single tableau and adds the selected number to its contents in a way that keeps it semi-standard. All possible tableaux are yielded.

Parameters:
  • tableau (tuple[tuple[int, ...], ...]) – An incomplete Young tableau

  • increment (int) – Integer to be added to the tableaux

  • partition (tuple[int, ...]) – A partition characterizing an irrep of the symmetric group

Returns:

Yielded modified tableaux

Return type:

Iterator[tuple[tuple[int, ...], ...]]

haarpy.symmetric.semi_standard_young_tableaux(partition, conjugacy_class)[source]#

All eligible semi-standard young tableaux based of the partition

Parameters:
  • partition (tuple[int, ...]) – A partition characterizing an irrep of the symmetric group

  • conjugacy_class (tuple[int, ...]) – A conjugacy class, in partition form, of the symmetric group

Returns:

All eligible semi-standard young tableaux

Return type:

set[tuple[tuple[int, ...], ...]]

Examples

>>> from haarpy import semi_standard_young_tableaux
>>> semi_standard_young_tableaux((3, 1), (2, 1, 1))
{((0, 1, 2), (0,)), ((0, 0, 2), (1,)), ((0, 0, 1), (2,))}
>>> semi_standard_young_tableaux((3,2),(4,1))
{((0, 0, 1), (0, 0)), ((0, 0, 0), (0, 1))}
haarpy.symmetric.proper_border_strip(tableau, conjugacy_class)[source]#

Returns True if input Young tableau is a valid border-strip tableau

Parameters:
  • tableau (tuple[tuple[int, ...], ...]) – A semi-standard Young tableau

  • conjugacy_class (tuple[int, ...]) – A conjugacy class, in partition form, of the symmetric group

Returns:

True if the tableau is a border-strip

Return type:

bool

Examples

>>> from haarpy import proper_border_strip
>>> ap.proper_border_strip(((0, 0, 0), (0, 1)), (4,1))
True
>>> ap.proper_border_strip(((0, 0, 1), (0, 0)), (4,1))
False
haarpy.symmetric.murn_naka_rule(partition, conjugacy_class)[source]#

Implementation of the Murnaghan-Nakayama rule for the characters irreducible representations of the symmetric group

Parameters:
  • partition (tuple[int, ...]) – A partition characterizing an irrep of the symmetric group

  • conjugacy_class (tuple[int, ...]) – A conjugacy class, in partition form, of the symmetric group

Returns:

The character of the input permutation in the given irrep of the symmetric group

Return type:

int

Examples

>>> from haarpy import murn_naka_rule
>>> murn_naka_rule((4, 1, 1), (3, 2, 1))
-1
>>> murn_naka_rule((3, 1), (1, 1, 1, 1))
3

See also

haarpy.symmetric.semi_standard_young_tableaux()

Returns all eligible semi-standard young tableaux based of the partition

haarpy.symmetric.irrep_dimension(partition)[source]#

Returns the dimension of the irrep of the symmetric group labelled by the input partition

Parameters:

partition (tuple[int, ...]) – A partition labelling an irrep of the symmetric group

Returns:

The dimension of the irrep

Return type:

int

Examples

>>> from haarpy import irrep_dimension
>>> irrep_dimension((2, 1, 1))
3
haarpy.symmetric.sorting_permutation(*sequence)[source]#

Returns the sorting permutation of a given sequence. If two sequences are given as parameters, the function returns the permutation sending the first sequence to the second.

Parameters:

*sequence (tuple[int, ...]) – One or two unorderd sequences

Returns:

Tthe sorting permutation

Return type:

Permutation

Raises:
  • ValueError – If the two sequences are incompatible

  • TypeError – If more than two sequences are passed as arguments

Notes

If the sorting permutation is not unique, the function returns the first permutation obtained.

Examples

>>> from haarpy import sorting_permutation
>>> sequence_1, sequence_2 = (2, 1, 2, 1, 3), (3, 2, 2, 1, 1)
>>> sorting_permutation(sequence_1)
Permutation(4)(0, 1, 3, 2)
>>> sorting_permutation(sequence_1, sequence_2)
Permutation(0, 4, 3, 1)
haarpy.symmetric.YoungSubgroup(partition)[source]#

Returns the Young subgroup of a given input partition

Parameters:

partition (tuple[int, ...]) – A partition

Returns:

The associated Young subgroup

Return type:

PermutationGroup

Raises:
  • TypeError – If the partition is neither a tuple or a list

  • TypeError – If the partition is not made of positive integers

Examples

>>> from haarpy import YoungSubgroup
>>> young = YoungSubgroup((2, 2))
>>> list(young.generate())
[Permutation(3), Permutation(3)(0, 1), Permutation(2, 3), Permutation(0, 1)(2, 3)]
haarpy.symmetric.stabilizer_coset(*sequence)[source]#

Returns all permutations that sends the first sequences to the second. For a single input, the function returns the stabilizer group with respect to the sequence. For two inputs, it returns the stabilizer of the first sequence with respect to the second.

Parameters:

*sequence (tuple) – The sequences acted upon

Returns:

The stabilizer group

Return type:

Iterator[Permutation]

Raises:

TypeError – If the sequence argument contains more than two sequences

Examples

>>> from haarpy import stabilizer_coset
>>> sequence_1, sequence_2 = (2, 2, 1, 3), (3, 2, 2, 1)
>>> list(stabilizer_coset(sequence_1))
[Permutation(3), Permutation(3)(0, 1)]
>>> list(stabilizer_coset(sequence_1, sequence_2))
[Permutation(0, 3, 2, 1), Permutation(0, 3, 2)]

See also

haarpy.symmetric.YoungSubgroup()

The Young subgroup of a given input partition

haarpy.symmetric.HyperoctahedralGroup(degree)[source]#

Returns the hyperoctahedral group \(H_p\)

Parameters:

degree (int) – The degree \(p\) of the hyperoctahedral group \(H_p\)

Returns:

The hyperoctahedral group

Return type:

PermutationGroup

Raises:

TypeError – If the degree is not an integer

Examples

>>> from haarpy import HyperoctahedralGroup
>>> hyperoctahedral = ap.HyperoctahedralGroup(3)
>>> hyperoctahedral.order()
48
haarpy.symmetric.hyperoctahedral_transversal(degree)[source]#

Yields the permutations of \(M_{2p}\), the complete set of coset representatives of the quotient group \(S_{2p}/H_p\)

Parameters:

degree (int) – The degree \(2p\) of the associated symmetric group \(S_{2p}\)

Returns:

The permutations of \(M_{2p}\)

Return type:

Iterator[Permutation]

Examples

>>> from haarpy import hyperoctahedral_transversal
>>> transversal = ap.hyperoctahedral_transversal(4)
>>> list(transversal)
[Permutation(3), Permutation(3)(1, 2), Permutation(1, 3, 2)]

See also

haarpy.partition.pair_partitions()

Yields the pairings of a given set

haarpy.symmetric.coset_type(permutation)[source]#

Returns the coset-type of a given permutation of the symmetric group

Parameters:

permutation (Permutation) – A permutation of the symmetric group \(S_{2p}\)

Returns:

The coset-type as a partition of \(p\)

Return type:

tuple[int, ...]

Raises:
  • TypeError – If the permutation is of incorrect type

  • ValueError – If the symmetric group is of odd degree

Examples

>>> from sympy.combinatorics import Permutation
>>> from haarpy import coset_type
>>> coset_type(Permutation(0, 5, 4, 2, 1, 3))
(2, 1)
haarpy.symmetric.coset_type_representative(partition)[source]#

Returns a representative permutation of the symmetric group \(S_{2p}\) for a given input coset-type

Parameters:

partition (tuple[int, ...]) – The coset-type as a partition of \(p\)

Returns:

The representative

Return type:

Permutation

Raises:

TypeError – If the input partition is of incorrect type

Examples

>>> from haarpy import coset_type_representative
>>> coset_type_representative((2, 1))
Permutation(5)(1, 3, 2)