curver.kernel.permutation.Permutation

class curver.kernel.permutation.Permutation(perm)[source]

Bases: object

This represents a permutation on 0, 1, …, N-1.

cycle_lengths()[source]

Return the sorted list of cycle lengths of this Permutation.

This is a total conjugacy invariant.

classmethod from_dict(dictionary, ordering=None)[source]

Return a Permutation from a dictionary.

The order of the elements within the dictionary may also be specified.

classmethod from_index(N, index)[source]

Return the permutation in Sym(N) with the given index.

index()[source]

Return the index of this permutation in the (sorted) list of all permutations on this many symbols.

inverse()[source]

Return the inverse of this permutation.

is_conjugate_to(other)[source]

Return whether this permutation in conjugate to other.

Two permutations are conjugate iff they have the same cycle lengths.

is_even()[source]

Return whether this permutation is the composition of an even number of transposiions.

matrix()[source]

Return the corresponding permutation matrix.

That is, a matrix M such that M * e_i == e_{self[i]}.

order()[source]

Return the order of this permutation.