flipper.kernel.permutation.Permutation

class flipper.kernel.permutation.Permutation(permutation)[source]

Bases: object

This represents a permutation in Sym(n).

compressed_string()[source]

Return this permutation as a single concatenated string.

embed(new_n)[source]

Return the inclusion of this permutation into Sym(new_n).

new_n must be at least len(self).

inverse()[source]

Return the inverse of this permutation.

is_even()[source]

Return if this permutation is even.

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.