Skip to content

Commit

Permalink
sagemathgh-39310: expand and explain doctest of _preprocess_intertwin…
Browse files Browse the repository at this point in the history
…ing_relations

    
This is related to sagemath#39307.  I need to understand precisely how
manipulation of `_P`, `_compute_possible_block_values`, etc. interact,
and this is a tiny step in this direction.
    
URL: sagemath#39310
Reported by: Martin Rubey
Reviewer(s): David Coudert, Martin Rubey
  • Loading branch information
Release Manager committed Jan 19, 2025
2 parents dc2f416 + 7d53e28 commit 3fb753e
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/sage/combinat/bijectionist.py
Original file line number Diff line number Diff line change
Expand Up @@ -2124,11 +2124,6 @@ def _preprocess_intertwining_relations(self):
In particular, if `P` consists only if singletons, this
method has no effect.
.. TODO::
create one test with one and one test with two
intertwining relations
.. TODO::
it is not clear whether this method makes sense
Expand All @@ -2144,6 +2139,17 @@ def _preprocess_intertwining_relations(self):
sage: bij._P
{{'a'}, {'b'}, {'c'}, {'d'}}
However, adding that ``'a'`` and ``'c'`` are in the same block,
we can infer that also ``'b'`` and ``'d'`` are in the same
block::
sage: bij.set_constant_blocks([['a', 'c']])
sage: bij._P
{{'a', 'c'}, {'b'}, {'d'}}
sage: bij._preprocess_intertwining_relations()
sage: bij._P
{{'a', 'c'}, {'b', 'd'}}
Let a group act on permutations::
sage: A = B = Permutations(3)
Expand All @@ -2152,6 +2158,11 @@ def _preprocess_intertwining_relations(self):
sage: bij._preprocess_intertwining_relations()
sage: bij._P
{{[1, 2, 3]}, {[1, 3, 2]}, {[2, 1, 3]}, {[2, 3, 1]}, {[3, 1, 2]}, {[3, 2, 1]}}
Thus, in this case we do not detect the constant blocks::
sage: bij.constant_blocks(optimal=True)
{{[1, 2, 3], [3, 2, 1]}, {[1, 3, 2], [2, 3, 1]}, {[2, 1, 3], [3, 1, 2]}}
"""
A = self._A
P = self._P
Expand Down

0 comments on commit 3fb753e

Please sign in to comment.