music.transpose_permutation

music.transpose_permutation(permutation, step=1)[source]

Transposes (shifts) the elements of a permutation by a given step.

Parameters:
permutationsympy.combinatorics.Permutation

The permutation to be transposed.

stepint, optional

The number of positions to shift each element of the permutation, by default 1.

Returns:
sympy.combinatorics.Permutation

A new permutation with elements shifted by the specified step.

Notes

If step is 0, the function returns the original permutation.

Examples

>>> from sympy.combinatorics import Permutation
>>> perm = Permutation([2, 0, 1])
>>> transpose_permutation(perm, 1)
Permutation([3, 1, 2])
>>> transpose_permutation(perm, 0)
Permutation([2, 0, 1])