Symmetric group¶
Permutations of \(S_n\) as 0-indexed one-line tuples.
A permutation \(\sigma\) of \(\{0, \dots, n-1\}\) is the tuple \((\sigma(0), \dots, \sigma(n-1))\), and composition is \((\pi\sigma)(i) = \pi(\sigma(i))\). This module provides composition, inverses, cycle types, and the conjugacy classes of \(S_n\) with their sizes, which the character sums elsewhere in the package run over.
permutation_identity ¶
The identity permutation on {0, ..., n-1}.
Examples:
permutation_compose ¶
Multiply two permutation (pi * sigma)(i) = pi(sigma(i))
Examples:
>>> permutation_compose((1, 0, 2), (0, 2, 1))
(1, 2, 0)
>>> permutation_compose((0, 1, 2), (2, 0, 1))
(2, 0, 1)
Source code in src/schur_weyl/symmetric_group.py
permutation_inverse ¶
The inverse permutation.
Examples:
Source code in src/schur_weyl/symmetric_group.py
all_permutations ¶
All permutations of Sn
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
int
|
n |
required |
Yields:
| Type | Description |
|---|---|
Generator[tuple[int, ...], None, None]
|
the permutations |
Source code in src/schur_weyl/symmetric_group.py
all_permutations_by_cycle_type ¶
All permutations of Sn assigned to their cycle type
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
int
|
n |
required |
Yields:
| Type | Description |
|---|---|
dict[tuple[int, ...], list[tuple[int, ...]]]
|
the cycle type and its permutations |
Source code in src/schur_weyl/symmetric_group.py
permutation_cycle_type ¶
Give the cycle type of a permutation. The disjoint sets of perms
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
perm
|
tuple[int, ...]
|
The permutation |
required |
Returns:
| Type | Description |
|---|---|
tuple[int, ...]
|
Cycle type |
Examples:
>>> permutation_cycle_type((1, 2, 0, 4, 3))
(3, 2)
>>> permutation_cycle_type((0, 1, 2))
(1, 1, 1)
>>> permutation_cycle_type((1, 0, 2))
(2, 1)
Source code in src/schur_weyl/symmetric_group.py
permutation_conjugacy_classes ¶
All the permutation conjugacy class represented by their cycle type. Simply the partitions of k.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
k
|
int
|
The size of the Symmetric group |
required |
Yields:
| Type | Description |
|---|---|
Generator[tuple[int, ...], None, None]
|
description |
Source code in src/schur_weyl/symmetric_group.py
permutation_conjugacy_class_size ¶
The number of permutations of the same cycle type
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
cycle_type
|
tuple[int, ...]
|
The cycle type |
required |
Returns:
| Type | Description |
|---|---|
int
|
The number of permutations of the same cycle type |
Examples: