Skip to content

Commit d6c38e5

Browse files
author
Release Manager
committed
gh-35060: a bijectionist's toolkit
We provide a toolkit for the combinatorialist to help find functions ("statistics") s: A -> Z and bijections A -> B given sequences of finite sets A and B that satisfy various constraints. Closes #33238 ### 📝 Checklist - [x] I have made sure that the title is self-explanatory and the description concisely explains the PR. - [x] I have linked an issue or discussion. - [x] I have created tests covering the changes. - [x] I have updated the documentation accordingly. URL: #35060 Reported by: Martin Rubey Reviewer(s): Martin Rubey, Matthias Köppe, Travis Scrimshaw
2 parents 1aa2370 + a72bd65 commit d6c38e5

File tree

3 files changed

+27
-36
lines changed

3 files changed

+27
-36
lines changed

build/pkgs/configure/checksums.ini

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
tarball=configure-VERSION.tar.gz
2-
sha1=387297d7e488eb9db6de3ceb80e204d2bdedcfdf
3-
md5=21203b7dbe667c4633c98139bb1b51fb
4-
cksum=4016304194
2+
sha1=7b3a894056b94b6a8c83596e7d116fa7eaf3abc9
3+
md5=64679ca3d2223ceed53d9a93edf8eafe
4+
cksum=2254406620
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
96f5cd2fb8aa1a83f1e0ae8112883a64e79031e5
1+
200b6b70e21670d0867e0076fc5d943f238d2b8a

src/sage/combinat/bijectionist.py

Lines changed: 23 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,41 +1575,32 @@ def _forced_constant_blocks(self):
15751575
sage: bij.set_statistics((alpha1, beta1), (alpha2, beta2))
15761576
sage: from sage.combinat.cyclic_sieving_phenomenon import orbit_decomposition
15771577
sage: bij.set_constant_blocks(orbit_decomposition(A, rotate_permutation))
1578-
sage: for p in bij.constant_blocks(): print(list(p))
1579-
[[2, 1, 3, 4], [1, 2, 4, 3], [1, 3, 2, 4], [4, 2, 3, 1]]
1580-
[[3, 2, 1], [1, 3, 2], [2, 1, 3]]
1581-
[[2, 4, 3, 1], [3, 2, 4, 1], [2, 3, 1, 4], [1, 3, 4, 2]]
1582-
[[1, 4, 2, 3], [3, 1, 2, 4], [4, 2, 1, 3], [4, 1, 3, 2]]
1578+
sage: P = bij.constant_blocks()
1579+
sage: P = [sorted(p, key=lambda p: (len(p), p)) for p in P]
1580+
sage: P = sorted(P, key=lambda p: (len(next(iter(p))), len(p)))
1581+
sage: for p in P:
1582+
....: print(p)
1583+
[[1, 3, 2], [2, 1, 3], [3, 2, 1]]
15831584
[[1, 4, 3, 2], [3, 2, 1, 4]]
15841585
[[2, 1, 4, 3], [4, 3, 2, 1]]
1585-
[[2, 4, 1, 3], [3, 4, 2, 1], [4, 3, 1, 2], [3, 1, 4, 2]]
1586-
1587-
sage: for p in bij.constant_blocks(optimal=True): sorted(p, key=len)
1586+
[[1, 2, 4, 3], [1, 3, 2, 4], [2, 1, 3, 4], [4, 2, 3, 1]]
1587+
[[1, 3, 4, 2], [2, 3, 1, 4], [2, 4, 3, 1], [3, 2, 4, 1]]
1588+
[[1, 4, 2, 3], [3, 1, 2, 4], [4, 1, 3, 2], [4, 2, 1, 3]]
1589+
[[2, 4, 1, 3], [3, 1, 4, 2], [3, 4, 2, 1], [4, 3, 1, 2]]
1590+
1591+
sage: P = bij.constant_blocks(optimal=True)
1592+
sage: P = [sorted(p, key=lambda p: (len(p), p)) for p in P]
1593+
sage: P = sorted(P, key=lambda p: (len(next(iter(p))), len(p)))
1594+
sage: for p in P:
1595+
....: print(p)
15881596
[[1], [1, 2], [1, 2, 3], [1, 2, 3, 4]]
1589-
[[1, 3, 2],
1590-
[2, 1, 3],
1591-
[3, 2, 1],
1592-
[2, 3, 4, 1],
1593-
[1, 3, 4, 2],
1594-
[2, 1, 3, 4],
1595-
[1, 3, 2, 4],
1596-
[2, 3, 1, 4],
1597-
[1, 2, 4, 3],
1598-
[3, 2, 4, 1],
1599-
[2, 1, 4, 3],
1600-
[2, 4, 3, 1],
1601-
[4, 2, 3, 1],
1602-
[4, 3, 2, 1],
1603-
[1, 4, 3, 2],
1604-
[3, 2, 1, 4]]
1605-
[[1, 4, 2, 3],
1606-
[4, 2, 1, 3],
1607-
[2, 4, 1, 3],
1608-
[4, 3, 1, 2],
1609-
[4, 1, 3, 2],
1610-
[3, 4, 2, 1],
1611-
[3, 1, 2, 4],
1612-
[3, 1, 4, 2]]
1597+
[[1, 3, 2], [2, 1, 3], [3, 2, 1],
1598+
[1, 2, 4, 3], [1, 3, 2, 4], [1, 3, 4, 2], [1, 4, 3, 2],
1599+
[2, 1, 3, 4], [2, 1, 4, 3], [2, 3, 1, 4], [2, 3, 4, 1],
1600+
[2, 4, 3, 1], [3, 2, 1, 4], [3, 2, 4, 1], [4, 2, 3, 1],
1601+
[4, 3, 2, 1]]
1602+
[[1, 4, 2, 3], [2, 4, 1, 3], [3, 1, 2, 4], [3, 1, 4, 2],
1603+
[3, 4, 2, 1], [4, 1, 3, 2], [4, 2, 1, 3], [4, 3, 1, 2]]
16131604
16141605
The permutation `[2, 1]` is in none of these blocks::
16151606

0 commit comments

Comments
 (0)