Decorated permutations

AUTHORS:

  • Martin Rubey (2020): Initial version

class sage.combinat.decorated_permutation.DecoratedPermutation(parent, pi, check=True)[source]

Bases: ClonableArray

A decorated permutation.

A decorated permutation is a signed permutation where all non-fixed points have positive sign.

check()[source]

Check that self is a valid decorated permutation.

EXAMPLES:

sage: S = DecoratedPermutations(3)
sage: elt = S([2, 1, -3])
sage: elt.check()
sage: elt = S([2, -1, 3])
Traceback (most recent call last):
...
ValueError: invalid decorated permutation
>>> from sage.all import *
>>> S = DecoratedPermutations(Integer(3))
>>> elt = S([Integer(2), Integer(1), -Integer(3)])
>>> elt.check()
>>> elt = S([Integer(2), -Integer(1), Integer(3)])
Traceback (most recent call last):
...
ValueError: invalid decorated permutation
size()[source]

Return the size of the decorated permutation.

EXAMPLES:

sage: DecoratedPermutation([2, 1, -3]).size()
3
>>> from sage.all import *
>>> DecoratedPermutation([Integer(2), Integer(1), -Integer(3)]).size()
3
to_signed_permutation()[source]

Return self as a signed permutation.

EXAMPLES:

sage: DecoratedPermutation([2, 1, -3]).to_signed_permutation()
[2, 1, -3]
>>> from sage.all import *
>>> DecoratedPermutation([Integer(2), Integer(1), -Integer(3)]).to_signed_permutation()
[2, 1, -3]
class sage.combinat.decorated_permutation.DecoratedPermutations(n)[source]

Bases: UniqueRepresentation, Parent

Class of all decorated permutations of \(n\).

A decorated permutation is a signed permutation where all non-fixed points have positive sign.

INPUT:

  • n – integer; the size of the decorated permutations

EXAMPLES:

This will create an instance to manipulate the decorated permutations of size 3:

sage: S = DecoratedPermutations(3); S
Decorated permutations of size 3
sage: S.cardinality()
16
>>> from sage.all import *
>>> S = DecoratedPermutations(Integer(3)); S
Decorated permutations of size 3
>>> S.cardinality()
16
Element[source]

alias of DecoratedPermutation

cardinality()[source]

Return the cardinality of self.

The number of decorated permutations of size \(n\) is equal to

\[\sum_{k=0^n} \frac{n!}{k!}\]

EXAMPLES:

sage: [DecoratedPermutations(n).cardinality() for n in range(11)]
[1, 2, 5, 16, 65, 326, 1957, 13700, 109601, 986410, 9864101]
>>> from sage.all import *
>>> [DecoratedPermutations(n).cardinality() for n in range(Integer(11))]
[1, 2, 5, 16, 65, 326, 1957, 13700, 109601, 986410, 9864101]