Skip to content

Commit

Permalink
Merge branch 'simple-species' into lazy-species
Browse files Browse the repository at this point in the history
  • Loading branch information
mantepse committed Sep 12, 2024
2 parents 04243ac + 772b79b commit f8b1d80
Show file tree
Hide file tree
Showing 3 changed files with 393 additions and 364 deletions.
19 changes: 19 additions & 0 deletions src/sage/groups/perm_gps/permgroup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2734,6 +2734,25 @@ def conjugate(self, g):
raise TypeError("{0} does not convert to a permutation group element".format(g))
return PermutationGroup(gap_group=libgap.ConjugateGroup(self, g))

def are_conjugate(self, H1, H2):
r"""
Return whether ``H1`` and ``H2`` are conjugate subgroups in ``G``.
EXAMPLES::
sage: G = SymmetricGroup(3)
sage: H1 = PermutationGroup([(1,2)])
sage: H2 = PermutationGroup([(2,3)])
sage: G.are_conjugate(H1, H2)
True
sage: G = SymmetricGroup(4)
sage: H1 = PermutationGroup([[(1,3),(2,4)], [(1,2),(3,4)]])
sage: H2 = PermutationGroup([[(1,2)], [(1,2),(3,4)]])
sage: G.are_conjugate(H1, H2)
False
"""
return libgap.IsConjugate(self, H1, H2).sage()

def direct_product(self, other, maps=True):
"""
Wraps GAP's ``DirectProduct``, ``Embedding``, and ``Projection``.
Expand Down
12 changes: 6 additions & 6 deletions src/sage/rings/lazy_species.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,11 @@ def generating_series(self):
P._laurent_poly_ring._indices._indices.variable_names())
if P._arity == 1:
def coefficient(n):
return sum(c / M._group.cardinality()
return sum(c / M.group_and_partition()[0].cardinality()
for M, c in self[n].monomial_coefficients().items())
else:
def coefficient(n):
return sum(c / M._group.cardinality()
return sum(c / M.group_and_partition()[0].cardinality()
* P.base_ring().prod(v ** d for v, d in zip(L.gens(), M.grade()))
for M, c in self[n].monomial_coefficients().items())
return L(coefficient)
Expand Down Expand Up @@ -240,7 +240,7 @@ def cycle_index_series(self):
if P._arity == 1:
L = LazySymmetricFunctions(p)
def coefficient(n):
return sum(c * M._group.cycle_index()
return sum(c * M.group_and_partition()[0].cycle_index()
for M, c in self[n].monomial_coefficients().items())
else:
raise NotImplementedError
Expand Down Expand Up @@ -353,7 +353,7 @@ def structures(self, *labels):
if c < 0:
raise NotImplementedError("only implemented for proper non-virtual species")
types = [tuple(S(rep)._act_on_list_on_position(l))[::-1]
for rep in libgap.RightTransversal(S, M._group)]
for rep in libgap.RightTransversal(S, M.group_and_partition()[0])]
if c == 1:
for s in types:
yield s, M
Expand Down Expand Up @@ -537,14 +537,14 @@ def coefficient(n):
return R.zero()
args_flat = [[(M, c) for i in range(n+1) for M, c in g[i]]
for g in args]
weights = [[M._tc for i in range(n+1) for M, _ in g[i]]
weights = [[sum(M.grade()) for i in range(n+1) for M, _ in g[i]]
for g in args]
result = R.zero()
for i in range(n // gv + 1):
# compute homogeneous components
lF = defaultdict(R)
for M, c in self[i]:
lF[M._mc] += R._from_dict({M: c})
lF[M.grade()] += R._from_dict({M: c})
for mc, F in lF.items():
for degrees in weighted_vector_compositions(mc, n, weights):
multiplicities = [c for alpha, g_flat in zip(degrees, args_flat)
Expand Down
Loading

0 comments on commit f8b1d80

Please sign in to comment.