curver.kernel.permutation module

A module for representing permutations in Sym(N).

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

Bases: object

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

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_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.