@@ -64,16 +64,37 @@ class ParentMethods:
64
64
65
65
def convolution_product (self , * maplist ):
66
66
"""
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.
68
76
69
77
MATH::
70
78
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)} := \b igl(\Delta \otimes \mathrm{Id}^{\otimes(k-1)}\b igr) \circ \Delta^{(k-1)}`,
82
+ with `\Delta^{(1)} = \Delta` (the ordinary coproduct) and `\Delta^{(0)} = \mathrm{Id}`;
83
+ and with `\mu^{(k)} := \mu \circ \b igl(\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]_.)
72
87
73
88
.. SEEALSO::
74
89
75
90
:meth:`sage.categories.bialgebras.ElementMethods.convolution_product`
76
91
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
+
77
98
.. TODO::
78
99
79
100
Remove dependency on modules_with_basis methods.
@@ -123,14 +144,13 @@ def convolution_product(self, *maplist):
123
144
n = len (T )
124
145
H = self
125
146
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:
131
148
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_ ())
133
150
151
+ # SPEED-NOTE:
152
+ # The code below, written as a composition of morphisms, is
153
+ # much slower than the code appearing under ElementMethods below.
134
154
if n == 0 :
135
155
return H .module_morphism (on_basis = lambda x : H .one () * H .term (x ).counit (), codomain = H )
136
156
elif n == 1 :
@@ -143,6 +163,16 @@ def convolution_product(self, *maplist):
143
163
144
164
return Mu_n * apply_T * Delta_n
145
165
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
+
146
176
class ElementMethods :
147
177
148
178
def adams_operator (self , n ):
@@ -159,8 +189,7 @@ def adams_operator(self, n):
159
189
160
190
.. SEEALSO::
161
191
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`
164
193
165
194
(In the literature, this is also called a Hopf power or Sweedler power, cf. [AL2015]_.)
166
195
@@ -172,7 +201,7 @@ def adams_operator(self, n):
172
201
173
202
.. TODO::
174
203
175
- Move to hopf_algebras.py (i.e., remove dependency on modules_with_basis methods) .
204
+ Remove dependency on modules_with_basis methods.
176
205
177
206
TESTS::
178
207
@@ -196,16 +225,30 @@ def adams_operator(self, n):
196
225
197
226
"""
198
227
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 )
201
236
202
237
def convolution_product (self , * maplist ):
203
238
"""
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``.
205
248
206
249
MATH::
207
250
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),
209
252
210
253
where `\Delta^{(k)} := \b igl(\Delta \otimes \mathrm{Id}^{\otimes(k-1)}\b igr) \circ \Delta^{(k-1)}`,
211
254
with `\Delta^{(1)} = \Delta` (the ordinary coproduct) and `\Delta^{(0)} = \mathrm{Id}`;
@@ -224,6 +267,10 @@ def convolution_product(self, *maplist):
224
267
Moss Sweedler.
225
268
W.A. Benjamin, Math Lec Note Ser., 1969.
226
269
270
+ AUTHORS:
271
+
272
+ Amy Pang - 12 June 2015 - Sage Days 65
273
+
227
274
.. TODO::
228
275
229
276
Remove dependency on modules_with_basis methods.
@@ -310,6 +357,10 @@ def convolution_product(self, *maplist):
310
357
T = maplist
311
358
312
359
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
+
313
364
n = len (T )
314
365
if n == 0 :
315
366
return H .one () * self .counit ()
@@ -333,53 +384,16 @@ def convolution_product(self, *maplist):
333
384
#Apply final map `T_n` to last term, `y`, and multiply.
334
385
out = HH .module_morphism (on_basis = lambda (x ,y ): H .term (x )* T [n - 1 ](H .term (y )), codomain = H )(out )
335
386
336
- # #ALGORITHM:
337
-
338
387
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
-
378
388
379
389
380
390
def coproduct_iterated (self , n = 1 ):
381
391
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.
383
397
384
398
EXAMPLES::
385
399
0 commit comments