Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

159

160

161

162

163

164

165

166

167

168

169

170

171

172

173

174

175

176

177

178

179

180

181

182

r""" 

Hopf algebras 

""" 

from __future__ import absolute_import 

#***************************************************************************** 

# Copyright (C) 2008 Teresa Gomez-Diaz (CNRS) <Teresa.Gomez-Diaz@univ-mlv.fr> 

# Nicolas M. Thiery <nthiery at users.sf.net> 

# 

# Distributed under the terms of the GNU General Public License (GPL) 

# http://www.gnu.org/licenses/ 

#****************************************************************************** 

from sage.misc.lazy_import import LazyImport 

from .category import Category 

from .category_types import Category_over_base_ring 

from sage.categories.bialgebras import Bialgebras 

from sage.categories.tensor import TensorProductsCategory # tensor 

from sage.categories.realizations import RealizationsCategory 

from sage.categories.super_modules import SuperModulesCategory 

from sage.misc.cachefunc import cached_method 

#from sage.misc.lazy_attribute import lazy_attribute 

 

class HopfAlgebras(Category_over_base_ring): 

""" 

The category of Hopf algebras 

 

EXAMPLES:: 

 

sage: HopfAlgebras(QQ) 

Category of hopf algebras over Rational Field 

sage: HopfAlgebras(QQ).super_categories() 

[Category of bialgebras over Rational Field] 

 

TESTS:: 

 

sage: TestSuite(HopfAlgebras(ZZ)).run() 

""" 

 

def super_categories(self): 

""" 

EXAMPLES:: 

 

sage: HopfAlgebras(QQ).super_categories() 

[Category of bialgebras over Rational Field] 

""" 

R = self.base_ring() 

return [Bialgebras(R)] 

 

def dual(self): 

""" 

Return the dual category 

 

EXAMPLES: 

 

The category of Hopf algebras over any field is self dual:: 

 

sage: C = HopfAlgebras(QQ) 

sage: C.dual() 

Category of hopf algebras over Rational Field 

""" 

return self 

 

WithBasis = LazyImport('sage.categories.hopf_algebras_with_basis', 'HopfAlgebrasWithBasis') 

 

class ElementMethods: 

 

def antipode(self): 

""" 

Return the antipode of self 

 

EXAMPLES:: 

 

sage: A = HopfAlgebrasWithBasis(QQ).example(); A 

An example of Hopf algebra with basis: the group algebra of the Dihedral group of order 6 as a permutation group over Rational Field 

sage: [a,b] = A.algebra_generators() 

sage: a, a.antipode() 

(B[(1,2,3)], B[(1,3,2)]) 

sage: b, b.antipode() 

(B[(1,3)], B[(1,3)]) 

 

TESTS:: 

 

sage: all(x.antipode() * x == A.one() for x in A.basis()) 

True 

""" 

return self.parent().antipode(self) 

# Variant: delegates to the overloading mechanism 

# result not guaranted to be in self 

# This choice should be done consistently with coproduct, ... 

# return operator.antipode(self) 

 

class ParentMethods: 

#def __setup__(self): # Check the conventions for _setup_ or __setup__ 

# if self.implements("antipode"): 

# coercion.declare(operator.antipode, [self], self.antipode) 

# 

#@lazy_attribute 

#def antipode(self): 

# # delegates to the overloading mechanism but 

# # guarantees that the result is in self 

# compose(self, operator.antipode, domain=self) 

pass 

 

class Morphism(Category): 

""" 

The category of Hopf algebra morphisms 

""" 

pass 

 

class Super(SuperModulesCategory): 

pass 

 

class TensorProducts(TensorProductsCategory): 

""" 

The category of Hopf algebras constructed by tensor product of Hopf algebras 

""" 

@cached_method 

def extra_super_categories(self): 

""" 

EXAMPLES:: 

 

sage: C = HopfAlgebras(QQ).TensorProducts() 

sage: C.extra_super_categories() 

[Category of hopf algebras over Rational Field] 

sage: sorted(C.super_categories(), key=str) 

[Category of hopf algebras over Rational Field, 

Category of tensor products of algebras over Rational Field, 

Category of tensor products of coalgebras over Rational Field] 

""" 

return [self.base_category()] 

 

class ParentMethods: 

# TODO: enable when tensor product of morphisms will be implemented 

#@lazy_attribute 

#def antipode(self): 

# return tensor([module.antipode for module in self.modules]) 

pass 

 

class ElementMethods: 

pass 

 

class DualCategory(Category_over_base_ring): 

""" 

The category of Hopf algebras constructed as dual of a Hopf algebra 

""" 

 

class ParentMethods: 

#@lazy_attribute 

#def antipode(self): 

# self.dual().antipode.dual() # Check that this is the correct formula 

pass 

 

class Realizations(RealizationsCategory): 

 

class ParentMethods: 

 

# TODO: 

# - Use @conditionally_defined once it's in Sage, for a nicer idiom 

# - Do the right thing (TM): once we will have proper 

# overloaded operators (as in MuPAD-Combinat; see #8900), 

# we won't need to specify explicitly to which parent one 

# should coerce the input to calculate the antipode; so it 

# will be sufficient to put this default implementation in 

# HopfAlgebras.ParentMethods. 

def antipode_by_coercion(self, x): 

""" 

Returns the image of ``x`` by the antipode 

 

This default implementation coerces to the default 

realization, computes the antipode there, and coerces the 

result back. 

 

EXAMPLES:: 

 

sage: N = NonCommutativeSymmetricFunctions(QQ) 

sage: R = N.ribbon() 

sage: R.antipode_by_coercion.__module__ 

'sage.categories.hopf_algebras' 

sage: R.antipode_by_coercion(R[1,3,1]) 

-R[2, 1, 2] 

""" 

R = self.realization_of().a_realization() 

return self(R(x).antipode())