Skip to content

Commit 8e26e27

Browse files
author
Release Manager
committed
gh-37634: The Glaisher-Franklin bijections on integer partitions The Glaisher-Franklin bijections, for a positive integer $s$, map the set of parts divisible by $s$ to the set of parts which occur at least $s$ times, see https://www.findstat.org/MapsDatabase/Mp00312 for the $s=2$ case. This generalizes and streamlines the code from findstat. URL: #37634 Reported by: Martin Rubey Reviewer(s): Martin Rubey, Travis Scrimshaw
2 parents 13a555d + af97e6d commit 8e26e27

File tree

1 file changed

+112
-0
lines changed

1 file changed

+112
-0
lines changed

src/sage/combinat/partition.py

+112
Original file line numberDiff line numberDiff line change
@@ -2485,6 +2485,118 @@ def conjugate(self):
24852485
par = Partitions_n(sum(self))
24862486
return par.element_class(par, conjugate(self))
24872487

2488+
def glaisher_franklin(self, s):
2489+
r"""
2490+
Apply the Glaisher-Franklin bijection to ``self``.
2491+
2492+
The Franklin-Glaisher bijection, with parameter `s`, returns
2493+
a partition whose set of parts that are repeated at least `s`
2494+
times equals the set of parts divisible by `s` in ``self``,
2495+
after dividing each part by `s`.
2496+
2497+
INPUT:
2498+
2499+
- ``s`` -- positive integer
2500+
2501+
EXAMPLES::
2502+
2503+
sage: Partition([4, 3, 2, 2, 1]).glaisher_franklin(2)
2504+
[3, 2, 2, 1, 1, 1, 1, 1]
2505+
2506+
TESTS:
2507+
2508+
The map preserves the size::
2509+
2510+
sage: all(mu.glaisher_franklin(s).size() == n
2511+
....: for n in range(20) for mu in Partitions(n)
2512+
....: for s in range(1, 5))
2513+
True
2514+
2515+
The map is bijective::
2516+
2517+
sage: l = [[mu.glaisher_franklin(s)
2518+
....: for n in range(20) for mu in Partitions(n)]
2519+
....: for s in range(1, 5)]
2520+
sage: all(len(set(ls)) == len(ls) for ls in l)
2521+
True
2522+
2523+
The map transports the statistics::
2524+
2525+
sage: d = lambda la, s: set(p / s for p in la if p % s == 0)
2526+
sage: r = lambda la, s: set(p for p in la if list(la).count(p) >= s)
2527+
sage: all(d(mu, s) == r(mu.glaisher_franklin(s), s)
2528+
....: for n in range(20) for mu in Partitions(n)
2529+
....: for s in range(1, 5))
2530+
True
2531+
2532+
For `s=2`, the map is known to findstat::
2533+
2534+
sage: findmap(Partitions, lambda mu: mu.glaisher_franklin(2)) # optional - internet
2535+
0: Mp00312 (quality [100])
2536+
"""
2537+
s = ZZ(s)
2538+
if s.is_one():
2539+
return self
2540+
mu = []
2541+
for p, m in enumerate(self.to_exp(), 1):
2542+
if not p % s:
2543+
mu.extend([p // s] * (m*s))
2544+
else:
2545+
for i, v in enumerate(m.digits(s)):
2546+
mu.extend([p * s**i]*v)
2547+
2548+
P = self.parent()
2549+
return P.element_class(P, sorted(mu, reverse=True))
2550+
2551+
def glaisher_franklin_inverse(self, s):
2552+
r"""
2553+
Apply the inverse of the Glaisher-Franklin bijection to ``self``.
2554+
2555+
The inverse of the Franklin-Glaisher bijection, with
2556+
parameter `s`, returns a partition whose set of parts that
2557+
are divisible by `s`, after dividing each by `s`, equals the
2558+
equals the set of parts repeated at least `s` times in
2559+
``self``.
2560+
2561+
INPUT:
2562+
2563+
- ``s`` -- positive integer
2564+
2565+
EXAMPLES::
2566+
2567+
sage: Partition([4, 3, 2, 2, 1]).glaisher_franklin(2)
2568+
[3, 2, 2, 1, 1, 1, 1, 1]
2569+
sage: Partition([3, 2, 2, 1, 1, 1, 1, 1]).glaisher_franklin_inverse(2)
2570+
[4, 3, 2, 2, 1]
2571+
2572+
TESTS:
2573+
2574+
The map is inverse to :meth:`glaisher_franklin`::
2575+
2576+
sage: all(mu.glaisher_franklin(s).glaisher_franklin_inverse(s) == mu
2577+
....: and mu.glaisher_franklin_inverse(s).glaisher_franklin(s) == mu
2578+
....: for n in range(20) for mu in Partitions(n)
2579+
....: for s in range(1, 5))
2580+
True
2581+
2582+
For `s=2`, the map is known to findstat::
2583+
2584+
sage: findmap(Partitions, lambda mu: mu.glaisher_franklin_inverse(2)) # optional - internet
2585+
0: Mp00313 (quality [100])
2586+
"""
2587+
s = ZZ(s)
2588+
if s.is_one():
2589+
return self
2590+
mu = []
2591+
for p, m in enumerate(self.to_exp(), 1):
2592+
p = ZZ(p)
2593+
mu.extend([p * s] * (m // s))
2594+
m1, p1 = p.val_unit(s)
2595+
mu.extend([p1] * ((m % s) * s**m1))
2596+
2597+
P = self.parent()
2598+
return P.element_class(P, sorted(mu, reverse=True))
2599+
24882600
def suter_diagonal_slide(self, n, exp=1):
24892601
r"""
24902602
Return the image of ``self`` in `Y_n` under Suter's diagonal slide

0 commit comments

Comments
 (0)