Skip to content

Commit

Permalink
multisort set-like species
Browse files Browse the repository at this point in the history
  • Loading branch information
mantepse committed Jan 18, 2025
1 parent 886bad4 commit 81ded32
Showing 1 changed file with 32 additions and 14 deletions.
46 changes: 32 additions & 14 deletions src/sage/rings/species.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
from sage.combinat.cyclic_sieving_phenomenon import orbit_decomposition
from sage.combinat.free_module import CombinatorialFreeModule
from sage.combinat.integer_vector import IntegerVectors
from sage.combinat.integer_vector_weighted import WeightedIntegerVectors
from sage.combinat.partition import Partitions, _Partitions
from sage.combinat.sf.sf import SymmetricFunctions
from sage.groups.perm_gps.constructor import PermutationGroupElement
Expand Down Expand Up @@ -592,7 +593,7 @@ def _rename(self, n):
self(PermutationGroup(gens), pi, check=False).rename(f"Pb_{n}" + sort)

if self._arity == 1:
_ = _atomic_set_like_species(n)
_ = _atomic_set_like_species(n, self._names)

def __contains__(self, x):
r"""
Expand Down Expand Up @@ -2513,39 +2514,56 @@ def factor(s, c, d):


@cached_function
def _atomic_set_like_species(n):
def _atomic_set_like_species(n, names):
r"""
Return a list of the atomic set like species of degree `n`,
and provide their traditional names.
INPUT:
- ``n`` -- positive integer, the degree
- ``names`` -- an iterable of strings for the sorts of the
species
EXAMPLES::
sage: from sage.rings.species import _atomic_set_like_species
sage: _atomic_set_like_species(6)
sage: _atomic_set_like_species(6, "X")
[E_2(E_3), E_2(X*E_2), E_2(X^3), E_3(E_2), E_3(X^2), E_6]
sage: oeis([len(_atomic_set_like_species(n)) for n in range(1,10)]) # optional - internet
sage: l = [len(_atomic_set_like_species(n, "X")) for n in range(12)]
sage: l
[0, 1, 1, 1, 3, 1, 6, 1, 10, 4, 12, 1]
sage: oeis(l) # optional - internet
0: A007650: Number of set-like atomic species of degree n.
sage: _atomic_set_like_species(4, "U, V")
[E_2(E_2(V)), E_2(E_2(U)), E_2(V^2), E_2(U*V), E_2(U^2), E_4(U), E_4(V)]
"""
M = MolecularSpecies("X")
if not n:
return []
M1 = MolecularSpecies("X")
M = MolecularSpecies(names)
if n == 1:
return [M(SymmetricGroup(1))]
return [M(SymmetricGroup(1), {s: [1]}) for s in range(M._arity)]
result = []
for d in divisors(n):
if d == 1:
continue
E_d = M(SymmetricGroup(d))
if d == n:
result.append(E_d)
result.extend(M(SymmetricGroup(n), {s: range(1, n+1)})
for s in range(M._arity))
continue
for pi in Partitions(n // d):
for l_F in cartesian_product([_atomic_set_like_species(p) for p in pi]):
G = prod(l_F)
F = E_d(G)
F.support()[0].rename(f"E_{d}({G})")
result.append(F)
E_d = M1(SymmetricGroup(d))
l = []
w = []
for degree in range(1, n // d + 1):
a_degree = _atomic_set_like_species(degree, names)
l.extend(a_degree)
w.extend([degree]*len(a_degree))
for a in WeightedIntegerVectors(n // d, w):
G = prod(F ** e for F, e in zip(l, a))
F = E_d(G)
F.support()[0].rename(f"E_{d}({G})")
result.append(F)
return result

0 comments on commit 81ded32

Please sign in to comment.