@@ -1575,6 +1575,55 @@ def is_atomic(self):
15751575 """
15761576 return self .is_molecular () and len (self .support ()[0 ]) == 1
15771577
1578+ def tilde (self ):
1579+ r"""
1580+ Return the tilde species of ``self``.
1581+
1582+ The tilde species `\tilde F` of a species `F` has as
1583+ structures the set of pairs `(s, a)`, consisting of an
1584+ `F`-structure `s` and an automorphism `a` of `s`.
1585+
1586+ We use https://mathoverflow.net/a/480852 to compute it.
1587+
1588+ EXAMPLES::
1589+
1590+ sage: from sage.rings.species import AtomicSpecies, MolecularSpecies, PolynomialSpecies
1591+ sage: M = MolecularSpecies("X")
1592+ sage: P = PolynomialSpecies(QQ, "X")
1593+ sage: sortkey = lambda x: (len(x[1]), sum(x[1].coefficients()), str(x[0]))
1594+ sage: n=4; table(sorted([(m, P.monomial(m).tilde()) for m in M.subset(n)], key=sortkey))
1595+ X^4 X^4
1596+ X^2*E_2 2*X^2*E_2
1597+ {((1,2)(3,4),)} 2*{((1,2)(3,4),)}
1598+ X*C_3 3*X*C_3
1599+ C_4 4*C_4
1600+ E_2^2 4*E_2^2
1601+ Pb_4 4*Pb_4
1602+ X*E_3 X*E_3 + X^2*E_2 + X*C_3
1603+ Eo_4 Eo_4 + 2*X*C_3 + Pb_4
1604+ P_4 2*P_4 + E_2^2 + Pb_4 + C_4
1605+ E_4 E_4 + E_2^2 + X*C_3 + P_4 + C_4
1606+
1607+ sage: P.<X,Y> = PolynomialSpecies(QQ)
1608+ sage: E2 = PolynomialSpecies(QQ, "X")(SymmetricGroup(2))
1609+ sage: E2(X*Y).tilde()
1610+ 2*E_2(XY)
1611+ """
1612+ P = self .parent ()
1613+ M = P ._indices
1614+ P_one = P .one ()
1615+ one = ZZ .one ()
1616+ result = P .zero ()
1617+ for m , c in self :
1618+ result_m = P_one
1619+ for a , e in m :
1620+ G , pi = a .permutation_group ()
1621+ result_a = P .sum (P (G .centralizer (g ), pi )
1622+ for g in G .conjugacy_classes_representatives ())
1623+ result_m *= result_a ** e
1624+ result += c * result_m
1625+ return result
1626+
15781627 def hadamard_product (self , other ):
15791628 r"""
15801629 Compute the hadamard product of ``self`` and ``other``.
0 commit comments