Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add cycle_type() and fix to_cycle() to SignedPermutation. #36224

Merged
merged 6 commits into from
Sep 16, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions src/sage/combinat/colored_permutations.py
Original file line number Diff line number Diff line change
Expand Up @@ -1195,8 +1195,7 @@ def to_cycles(self, singletons=True, use_min=True, negative_cycles=True):

The cycles are returned in the order of increasing smallest
elements, and each cycle is returned as a tuple which starts
with its smallest positive element. We do not include the
corresponding negative cycles.
with its smallest positive element.

INPUT:

Expand Down Expand Up @@ -1269,13 +1268,22 @@ def cycle_type(self):
Return a pair of partitions of ``len(self)`` corresponding to the
signed cycle type of ``self``.

A *negative cycle* is a cycle `C = (c_0, \ldots, c_{2k-1})` such that
`c_0 = c_k`. Any other cycle is positive. For any cycle `C`, we
ignore the cycle `-C` (provided this is a different cycle).
A *cycle* is a tuple `C = (c_0, \ldots, c_k)` with `\pi(c_i) = c_{i+1}`
for `0 \leq i < k` and `\pi(c_k) = c_0`. If `C` is a cycle,
`\overline{C} = (-c_0, \ldots, -c_k)` is also a cycle. A cycle is
*negative*, if `C = \overline{C}` up to cyclic reordering. In this
case, `k` is necessarily even and the length of `C` is `k/2`.
A *positive cycle* is a pair `C \overline{C}`, its length is `k`.

Let `\alpha` be the partition whose parts are the lengths of the
positive cycles and let `\beta` be the partition whose parts are
the lengths of the negative cycles. Then `(\alpha, \beta)` is
the cycle type of `\pi`.

EXAMPLES::

sage: pi = SignedPermutations(7)([2,-1,4,-6,-5,-3,7])
sage: G = SignedPermutations(7)
sage: pi = G([2, -1, 4, -6, -5, -3, 7])
sage: pi.cycle_type()
([3, 1], [2, 1])

Expand Down