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

Commit 58f409b

Browse files
committed
Added convolution_product and hopf_power method
1 parent 336ae6c commit 58f409b

File tree

1 file changed

+74
-0
lines changed

1 file changed

+74
-0
lines changed

src/sage/categories/hopf_algebras.py

+74
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,79 @@ def dual(self):
6161
WithBasis = LazyImport('sage.categories.hopf_algebras_with_basis', 'HopfAlgebrasWithBasis')
6262

6363
class ElementMethods:
64+
def convolution_product(h,a,b):
65+
r"""
66+
input: h - an element of a Hopf algebra H
67+
a,b - linear maps from H to H
68+
output: [a*b](h)
69+
"""
70+
H = h.parent()
71+
out = 0
72+
for (bimonom,coef) in h.coproduct():
73+
out += coef*a(H(bimonom[0]))*b(H(bimonom[1]))
74+
return out
75+
76+
def convolution_power(h, L, n):
77+
r"""
78+
input: h - an element of a Hopf algebra H
79+
L - linear map from H to H
80+
n - the convolution power to which to take 'L'
81+
output: [L^*n](h)
82+
"""
83+
from sage.categories.tensor import tensor
84+
H = h.parent()
85+
def n_fold_coproduct(h, n):
86+
H = h.parent()
87+
if n == 0:
88+
return H(h.counit())
89+
elif n == 1:
90+
return h
91+
elif n == 2:
92+
return h.coproduct()
93+
else:
94+
# apply some kind of multilinear recursion
95+
Hn = tensor([H]*n) # or: tensor([H for i in range(n)])
96+
terms = []
97+
hh = n_fold_coproduct(h, n-1)
98+
for (monom,cof) in hh:
99+
h0 = H(monom[0]).coproduct()
100+
terms += [(tuple((h00, h01) + monom[1:]), cof0 * cof) for ((h00, h01), cof0) in h0]
101+
return Hn.sum_of_terms(terms)
102+
hhh = n_fold_coproduct(h,n)
103+
out = H.zero()
104+
for term in hhh:
105+
out += H.prod(L(H(t)) for t in term[0]) * term[1]
106+
return out
107+
108+
def hopf_power(h,n=2):
109+
r"""
110+
Input:
111+
h - an element of a Hopf algebra H
112+
n - the convolution power of the identity morphism to use
113+
Output:
114+
the nth convolution power of the identity morphism, applied to h., i.e., [id^*n](h)
115+
116+
Remark: for historical reasons (see saga of Frobenius-Schur indicators), the second power deserves special attention.
117+
we use '2' as the default value for 'n'
118+
"""
119+
H = h.parent()
120+
def Id(x):
121+
return x
122+
def S(x):
123+
return x.antipode()
124+
125+
if n<0:
126+
L = S
127+
else:
128+
L = Id
129+
130+
if n==0:
131+
return H(h.counit())
132+
elif abs(n)==1:
133+
return L(h)
134+
else:
135+
return h.convolution_power(L,abs(n))
136+
64137
def antipode(self):
65138
"""
66139
Returns the antipode of self.
@@ -86,6 +159,7 @@ def antipode(self):
86159
# This choice should be done consistently with coproduct, ...
87160
# return operator.antipode(self)
88161

162+
89163
class ParentMethods:
90164
#def __setup__(self): # Check the conventions for _setup_ or __setup__
91165
# if self.implements("antipode"):

0 commit comments

Comments
 (0)