Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit de4fa87

Browse files
committed
In ParentMethods of bialgebras.py, added ._convolution_product_from_element() for testing purposes.
1 parent 67c0e22 commit de4fa87

File tree

2 files changed

+72
-141
lines changed

2 files changed

+72
-141
lines changed

src/sage/categories/bialgebras.py

+71-57
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,37 @@ class ParentMethods:
6464

6565
def convolution_product(self, *maplist):
6666
"""
67-
Given a maplist `(R, S, ..., T)` of length `n`, return the new map representing their convolution product.
67+
Return the convolution product (a map) of the maps in maplist.
68+
69+
INPUT:
70+
71+
- ``maplist`` -- any number of linear maps `R,S,...,T` on ``self``, say of length `n>=0`.
72+
73+
OUTPUT:
74+
75+
- the new map `R*S*...*T` representing their convolution product.
6876
6977
MATH::
7078
71-
(R*S*\cdots *T)(h) := \mu^{(n-1)} \circ (R \otimes S \otimes\cdot\otimes T) \circ \Delta^{(n-1)}(h)
79+
(R*S*\cdots *T) := \mu^{(n-1)} \circ (R \otimes S \otimes\cdot\otimes T) \circ \Delta^{(n-1)}.
80+
81+
where `\Delta^{(k)} := \bigl(\Delta \otimes \mathrm{Id}^{\otimes(k-1)}\bigr) \circ \Delta^{(k-1)}`,
82+
with `\Delta^{(1)} = \Delta` (the ordinary coproduct) and `\Delta^{(0)} = \mathrm{Id}`;
83+
and with `\mu^{(k)} := \mu \circ \bigl(\mu^{(k-1)} \otimes \mathrm{Id})` and `\mu^{(1)} = \mu`
84+
(the ordinary product). See [Sw1969]_.
85+
86+
(In the literature, one finds, e.g., `\Delta^{(2)}` for what we denote above as `\Delta^{(1)}`. See [KMN2012]_.)
7287
7388
.. SEEALSO::
7489
7590
:meth:`sage.categories.bialgebras.ElementMethods.convolution_product`
7691
92+
AUTHORS:
93+
94+
Aaron Lauve - 12 June 2015 - Sage Days 65
95+
- based off of .adams_operator() code in sage-trac ticket #18350
96+
- by Jean-Baptiste Priez
97+
7798
.. TODO::
7899
79100
Remove dependency on modules_with_basis methods.
@@ -123,14 +144,13 @@ def convolution_product(self, *maplist):
123144
n = len(T)
124145
H = self
125146

126-
# I do not know how to keep .convolution_product() from showing up in the
127-
# list of methods available to, e.g., SymmetricFunctions(QQ).
128-
# At present, the code below assumes Parent is something more like SymmetricFunctions(QQ).m()
129-
# The code should either be rewritten (I don't know how),
130-
# or we should do a check, e.g.,
147+
# TYPE-CHECK:
131148
if not H in ModulesWithBasis:
132-
raise TypeError('`self` must belong to ModulesWithBasis. Try a basis of %s' % H._repr_())
149+
raise AttributeError('`self` (%s) must belong to ModulesWithBasis. Try defining convolution product on a basis of `self` instead.' % H._repr_())
133150

151+
# SPEED-NOTE:
152+
# The code below, written as a composition of morphisms, is
153+
# much slower than the code appearing under ElementMethods below.
134154
if n == 0:
135155
return H.module_morphism(on_basis=lambda x: H.one() * H.term(x).counit(), codomain = H)
136156
elif n == 1:
@@ -143,6 +163,16 @@ def convolution_product(self, *maplist):
143163

144164
return Mu_n * apply_T * Delta_n
145165

166+
def _convolution_product_from_elements(self, *maplist):
167+
"""
168+
Return the convolution product (a map) of the maps in maplist.
169+
170+
A temporary function, created for speed-testing purposes.
171+
"""
172+
cpfe = lambda x: x.convolution_product(*maplist)
173+
return cpfe
174+
175+
146176
class ElementMethods:
147177

148178
def adams_operator(self, n):
@@ -159,8 +189,7 @@ def adams_operator(self, n):
159189
160190
.. SEEALSO::
161191
162-
:mod:`sage.categories.hopf_algebras.ElementMethods.convolution_product`
163-
:mod:`sage.categories.hopf_algebras.ElementMethods.convolution_product`
192+
:mod:`sage.categories.bialgebras.ElementMethods.convolution_product`
164193
165194
(In the literature, this is also called a Hopf power or Sweedler power, cf. [AL2015]_.)
166195
@@ -172,7 +201,7 @@ def adams_operator(self, n):
172201
173202
.. TODO::
174203
175-
Move to hopf_algebras.py (i.e., remove dependency on modules_with_basis methods).
204+
Remove dependency on modules_with_basis methods.
176205
177206
TESTS::
178207
@@ -196,16 +225,30 @@ def adams_operator(self, n):
196225
197226
"""
198227
if n < 0:
199-
raise ValueError("cannot take less than 0 coproduct iterations: %s < 0" % str(n))
200-
return self.convolution_product([lambda x: x] * n)
228+
if hasattr(self,'antipode'):
229+
T = lambda x: x.antipode()
230+
n = abs(n)
231+
else:
232+
raise AttributeError("`self` has no antipode, hence cannot take negative convolution powers of identity_map: %s < 0" % str(n))
233+
else:
234+
T = lambda x: x
235+
return self.convolution_product([T] * n)
201236

202237
def convolution_product(self, *maplist):
203238
"""
204-
Given a maplist `(R, S, ..., T)` of length `n`, compute the action of their convolution product on ``self.``
239+
Return the image of ``self`` under the convolution product (map) of the maps in ``maplist``.
240+
241+
INPUT:
242+
243+
- ``maplist`` -- any number of linear maps `R,S,...,T` on ``self.parent()``, say of length `n>=0`.
244+
245+
OUTPUT:
246+
247+
- `(R*S*...*T)` applied to ``self``.
205248
206249
MATH::
207250
208-
(R*S*\cdots *T)(h) := \mu^{(n-1)} \circ (R \otimes S \otimes\cdot\otimes T) \circ \Delta^{(n-1)}(h)
251+
(R*S*\cdots *T)(h) := \mu^{(n-1)} \circ (R \otimes S \otimes\cdot\otimes T) \circ \Delta^{(n-1)}(h),
209252
210253
where `\Delta^{(k)} := \bigl(\Delta \otimes \mathrm{Id}^{\otimes(k-1)}\bigr) \circ \Delta^{(k-1)}`,
211254
with `\Delta^{(1)} = \Delta` (the ordinary coproduct) and `\Delta^{(0)} = \mathrm{Id}`;
@@ -224,6 +267,10 @@ def convolution_product(self, *maplist):
224267
Moss Sweedler.
225268
W.A. Benjamin, Math Lec Note Ser., 1969.
226269
270+
AUTHORS:
271+
272+
Amy Pang - 12 June 2015 - Sage Days 65
273+
227274
.. TODO::
228275
229276
Remove dependency on modules_with_basis methods.
@@ -310,6 +357,10 @@ def convolution_product(self, *maplist):
310357
T = maplist
311358

312359
H = self.parent()
360+
# TYPE-CHECK:
361+
if not H in ModulesWithBasis:
362+
raise AttributeError('`parent` (%s) must belong to ModulesWithBasis. Try defining convolution product on a basis of `parent` instead.' % H._repr_())
363+
313364
n = len(T)
314365
if n == 0:
315366
return H.one() * self.counit()
@@ -333,53 +384,16 @@ def convolution_product(self, *maplist):
333384
#Apply final map `T_n` to last term, `y`, and multiply.
334385
out = HH.module_morphism(on_basis=lambda (x,y): H.term(x)*T[n-1](H.term(y)), codomain=H)(out)
335386

336-
# #ALGORITHM:
337-
338387
return out
339-
# ------------
340-
# IMPLEMENTATION NOTE:
341-
# In the `module_morphism()` version of this code (copied below), Sage sometimes throws a `TypeError`. E.g.,
342-
# -------
343-
# sage: Antipode = lambda x: x.antipode()
344-
#
345-
# sage: QS = SymmetricGroupAlgebra(QQ,3)
346-
# sage: x = QS.sum_of_terms([(p,p.length()) for p in Permutations(3)]); x
347-
# [1, 3, 2] + [2, 1, 3] + 2*[2, 3, 1] + 2*[3, 1, 2] + 3*[3, 2, 1]
348-
# sage: x.convolution_product([Antipode, Antipode])
349-
# 5*[1, 2, 3] + 2*[2, 3, 1] + 2*[3, 1, 2]
350-
#
351-
# sage: QG GroupAlgebra(SymmetricGroup(3),QQ)
352-
# sage: x = QG.sum_of_terms([(p,p.length()) for p in Permutations(3)]); x
353-
# [1, 3, 2] + [2, 1, 3] + 2*[2, 3, 1] + 2*[3, 1, 2] + 3*[3, 2, 1]
354-
# sage: x.convolution_product([Antipode,Antipode])
355-
# TypeError: Don't know how to create an element of Group algebra of group...
356-
# -------
357-
# #`split_convolve` moves terms of the form x # y to x*Ti(y1) # y2 in Sweedler notation.
358-
# split_convolve = lambda x,y: (x.tensor(y.coproduct())).apply_multilinear_morphism(convolve, codomain = HH)
359-
# convolve = lambda x,y1,y2: tensor([x * T[i](y1), y2])
360-
#
361-
# while i < n-1:
362-
# out = out.apply_multilinear_morphism(split_convolve, codomain = HH)
363-
# i += 1
364-
#
365-
# #Apply final map `T_n` to last term, `y`, and multiply.
366-
# out = out.apply_multilinear_morphism(lambda x,y: x * T[n-1](y), codomain = H)
367-
# -------
368-
# #`split_convolve` moves terms of the form x # y to x*Ti(y1) # y2 in Sweedler notation.
369-
# split_convolve = lambda (x,y): (((xy1,y2),c*d) for ((y1,y2),d) in H(y).coproduct() for (xy1,c) in H(x)*T[i](H(y1)))
370-
# while i < n-1:
371-
# out = HH.module_morphism(on_basis=lambda t: HH.sum_of_terms(split_convolve(t)), codomain = HH)(out)
372-
# i += 1
373-
374-
# #Apply final map `T_n` to last term, `y`, and multiply.
375-
# out = HH.module_morphism(on_basis=lambda (x,y): H(x)*T[n-1](H(y)), codomain=H)(out)
376-
# ------------
377-
378388

379389

380390
def coproduct_iterated(self, n=1):
381391
r"""
382-
Apply `k-1` coproducts to ``self``.
392+
Apply `n` coproducts to ``self``.
393+
394+
.. TODO::
395+
396+
Remove dependency on modules_with_basis methods.
383397
384398
EXAMPLES::
385399

src/sage/categories/hopf_algebras_with_basis.py

+1-84
Original file line numberDiff line numberDiff line change
@@ -260,90 +260,7 @@ def _test_antipode(self, **options):
260260
tester.assert_(IS(x) == self.counit(x) * self.one())
261261

262262
class ElementMethods:
263-
264-
def adams_operator(self, n):
265-
"""
266-
Compute the n-th convolution power of the identity morphism `Id` on self.
267-
268-
INPUT:
269-
270-
- ``n`` -- an integer.
271-
272-
OUTPUT:
273-
274-
- the element of self.parent() corresponding to `Id^{*n}(self)`.
275-
276-
.. SEEALSO::
277-
278-
Extends code defined in bialgebras.py...
279-
280-
:meth:`sage.categories.bialgebras.ElementMethods.adams_operator`
281-
:meth:`sage.categories.bialgebras.ElementMethods.convolution_product`
282-
283-
(In the literature, this is also called a Hopf power or Sweedler power, cf. [AL2015]_.)
284-
285-
REFERENCES:
286-
287-
.. [AL2015] The characteristic polynomial of the Adams operators on graded connected Hopf algebras.
288-
Marcelo Aguiar and Aaron Lauve.
289-
Algebra Number Theory, v.9, 2015, n.3, 2015.
290-
291-
.. TODO::
292-
293-
Move to hopf_algebras.py (i.e., remove dependency on modules_with_basis methods).
294-
295-
EXAMPLES::
296-
297-
sage: h = SymmetricFunctions(QQ).h()
298-
sage: h[5].adams_operator(2)
299-
2*h[3, 2] + 2*h[4, 1] + 2*h[5]
300-
sage: h[5].plethysm(2*h[1])
301-
2*h[3, 2] + 2*h[4, 1] + 2*h[5]
302-
sage: h([]).adams_operator(0), h([]).adams_operator(1)
303-
(h[], h[])
304-
sage: h[3,2].adams_operator(0), h[3,2].adams_operator(1)
305-
(0, h[3, 2])
306-
307-
sage: S = NonCommutativeSymmetricFunctions(QQ).S()
308-
sage: S[4].adams_operator(5)
309-
5*S[1, 1, 1, 1] + 10*S[1, 1, 2] + 10*S[1, 2, 1] + 10*S[1, 3] + 10*S[2, 1, 1] + 10*S[2, 2] + 10*S[3, 1] + 5*S[4]
310-
311-
312-
sage: QS = SymmetricGroupAlgebra(QQ,5)
313-
sage: x = QS.sum_of_terms(zip(Permutations(5)[3:6],[1,2,3])); x
314-
[1, 2, 4, 5, 3] + 2*[1, 2, 5, 3, 4] + 3*[1, 2, 5, 4, 3]
315-
sage: x.adams_operator(2)
316-
3*[1, 2, 3, 4, 5] + 2*[1, 2, 4, 5, 3] + [1, 2, 5, 3, 4]
317-
sage: x.antipode()
318-
2*[1, 2, 4, 5, 3] + [1, 2, 5, 3, 4] + 3*[1, 2, 5, 4, 3]
319-
sage: x.adams_operator(-2)
320-
3*[1, 2, 3, 4, 5] + [1, 2, 4, 5, 3] + 2*[1, 2, 5, 3, 4]
321-
322-
TESTS::
323-
324-
sage: s = SymmetricFunctions(QQ).s()
325-
sage: s[5,2,2].adams_operator(-1)
326-
-s[3, 3, 1, 1, 1]
327-
328-
sage: m = SymmetricFunctionsNonCommutingVariables(QQ).m()
329-
sage: m[[1,3],[2]].adams_operator(-2)
330-
3*m{{1}, {2, 3}} + 3*m{{1, 2}, {3}} + 6*m{{1, 2, 3}} - 2*m{{1, 3}, {2}}
331-
332-
sage: G = AlternatingGroup(5); QG = GroupAlgebra(G,QQ)
333-
sage: x = QG.sum_of_terms(zip(G[3:6],[1,2,3])); x
334-
(3,5,4) + 3*(1,2,4,3,5) + 2*(1,3,5,2,4)
335-
sage: x.adams_operator(-3)
336-
() + 3*(1,4,5,2,3) + 2*(1,5,4,3,2)
337-
sage: x.adams_operator(0), x.adams_operator(10)
338-
(6*(), 5*() + (3,5,4))
339-
"""
340-
if n < 0:
341-
T = lambda x: x.antipode()
342-
n = abs(n)
343-
else:
344-
T = lambda x: x
345-
346-
return self.convolution_product([T] * n)
263+
pass
347264

348265
class TensorProducts(TensorProductsCategory):
349266
"""

0 commit comments

Comments
 (0)