|
43 | 43 | from sage.combinat.cyclic_sieving_phenomenon import orbit_decomposition |
44 | 44 | from sage.combinat.free_module import CombinatorialFreeModule |
45 | 45 | from sage.combinat.integer_vector import IntegerVectors |
| 46 | +from sage.combinat.integer_vector_weighted import WeightedIntegerVectors |
46 | 47 | from sage.combinat.partition import Partitions, _Partitions |
47 | 48 | from sage.combinat.sf.sf import SymmetricFunctions |
48 | 49 | from sage.groups.perm_gps.constructor import PermutationGroupElement |
@@ -592,7 +593,7 @@ def _rename(self, n): |
592 | 593 | self(PermutationGroup(gens), pi, check=False).rename(f"Pb_{n}" + sort) |
593 | 594 |
|
594 | 595 | if self._arity == 1: |
595 | | - _ = _atomic_set_like_species(n) |
| 596 | + _ = _atomic_set_like_species(n, self._names) |
596 | 597 |
|
597 | 598 | def __contains__(self, x): |
598 | 599 | r""" |
@@ -2513,39 +2514,56 @@ def factor(s, c, d): |
2513 | 2514 |
|
2514 | 2515 |
|
2515 | 2516 | @cached_function |
2516 | | -def _atomic_set_like_species(n): |
| 2517 | +def _atomic_set_like_species(n, names): |
2517 | 2518 | r""" |
2518 | 2519 | Return a list of the atomic set like species of degree `n`, |
2519 | 2520 | and provide their traditional names. |
2520 | 2521 |
|
2521 | 2522 | INPUT: |
2522 | 2523 |
|
2523 | 2524 | - ``n`` -- positive integer, the degree |
| 2525 | + - ``names`` -- an iterable of strings for the sorts of the |
| 2526 | + species |
2524 | 2527 |
|
2525 | 2528 | EXAMPLES:: |
2526 | 2529 |
|
2527 | 2530 | sage: from sage.rings.species import _atomic_set_like_species |
2528 | | - sage: _atomic_set_like_species(6) |
| 2531 | + sage: _atomic_set_like_species(6, "X") |
2529 | 2532 | [E_2(E_3), E_2(X*E_2), E_2(X^3), E_3(E_2), E_3(X^2), E_6] |
2530 | 2533 |
|
2531 | | - sage: oeis([len(_atomic_set_like_species(n)) for n in range(1,10)]) # optional - internet |
| 2534 | + sage: l = [len(_atomic_set_like_species(n, "X")) for n in range(12)] |
| 2535 | + sage: l |
| 2536 | + [0, 1, 1, 1, 3, 1, 6, 1, 10, 4, 12, 1] |
| 2537 | + sage: oeis(l) # optional - internet |
2532 | 2538 | 0: A007650: Number of set-like atomic species of degree n. |
| 2539 | +
|
| 2540 | + sage: _atomic_set_like_species(4, "U, V") |
| 2541 | + [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)] |
2533 | 2542 | """ |
2534 | | - M = MolecularSpecies("X") |
| 2543 | + if not n: |
| 2544 | + return [] |
| 2545 | + M1 = MolecularSpecies("X") |
| 2546 | + M = MolecularSpecies(names) |
2535 | 2547 | if n == 1: |
2536 | | - return [M(SymmetricGroup(1))] |
| 2548 | + return [M(SymmetricGroup(1), {s: [1]}) for s in range(M._arity)] |
2537 | 2549 | result = [] |
2538 | 2550 | for d in divisors(n): |
2539 | 2551 | if d == 1: |
2540 | 2552 | continue |
2541 | | - E_d = M(SymmetricGroup(d)) |
2542 | 2553 | if d == n: |
2543 | | - result.append(E_d) |
| 2554 | + result.extend(M(SymmetricGroup(n), {s: range(1, n+1)}) |
| 2555 | + for s in range(M._arity)) |
2544 | 2556 | continue |
2545 | | - for pi in Partitions(n // d): |
2546 | | - for l_F in cartesian_product([_atomic_set_like_species(p) for p in pi]): |
2547 | | - G = prod(l_F) |
2548 | | - F = E_d(G) |
2549 | | - F.support()[0].rename(f"E_{d}({G})") |
2550 | | - result.append(F) |
| 2557 | + E_d = M1(SymmetricGroup(d)) |
| 2558 | + l = [] |
| 2559 | + w = [] |
| 2560 | + for degree in range(1, n // d + 1): |
| 2561 | + a_degree = _atomic_set_like_species(degree, names) |
| 2562 | + l.extend(a_degree) |
| 2563 | + w.extend([degree]*len(a_degree)) |
| 2564 | + for a in WeightedIntegerVectors(n // d, w): |
| 2565 | + G = prod(F ** e for F, e in zip(l, a)) |
| 2566 | + F = E_d(G) |
| 2567 | + F.support()[0].rename(f"E_{d}({G})") |
| 2568 | + result.append(F) |
2551 | 2569 | return result |
0 commit comments