Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

Environment to perform calculations of equivariant vector bundles on homogeneous varieties

1842 views
License: GPL3
ubuntu2204
1
2
3
# This file was *autogenerated* from the file Cartan_Group.sage
4
from sage.all_cmdline import * # import sage library
5
6
_sage_const_1 = Integer(1); _sage_const_2 = Integer(2); _sage_const_3 = Integer(3); _sage_const_6 = Integer(6); _sage_const_8 = Integer(8); _sage_const_4 = Integer(4); _sage_const_0 = Integer(0)
7
from Equivariant_Vector_Bundles_On_Homogeneous_Varieties.Foundation.Structure import Irreducible_Structure , Direct_Sum_Of_Structures
8
9
10
11
class Cartan_Group ( object ) :
12
13
ADMISSIBLE_CARTAN_FAMILIES = { 'A' : ( _sage_const_1 , +infinity ) ,
14
'B' : ( _sage_const_2 , +infinity ) ,
15
'C' : ( _sage_const_2 , +infinity ) ,
16
'D' : ( _sage_const_3 , +infinity ) ,
17
'E' : ( _sage_const_6 , _sage_const_8 ) ,
18
'F' : ( _sage_const_4 , _sage_const_4 ) ,
19
'G' : ( _sage_const_2 , _sage_const_2 )
20
}
21
22
23
def __add__ ( self , other:"Cartan_Group" ) -> "Irreducible_Cartan_Group" or "Direct_Sum_Of_Cartan_Groups" :
24
"""Returns the coproduct of two Cartan groups."""
25
assert isinstance( other , type(self).__bases__[_sage_const_1 ] ) , 'The input for ``other`` need to be an object of the class '+str( type(self).__bases__[_sage_const_1 ] )+'.'
26
New_Constituent_Parts = self.Constituent_Parts() + other.Constituent_Parts()
27
if len(New_Constituent_Parts) == _sage_const_1 :
28
Single_Part = New_Constituent_Parts[_sage_const_0 ]
29
return Single_Part
30
else :
31
return Direct_Sum_Of_Cartan_Groups( New_Constituent_Parts )
32
33
34
def Cartan_Type ( self ) -> CartanType:
35
"""Returns the Cartan type."""
36
return CartanType( self.Cartan_String() )
37
38
39
@staticmethod
40
def Constructor ( *Input:tuple ) -> "Irreducible_Cartan_Group" or "Direct_Sum_Of_Cartan_Groups" :
41
42
def Get_Cartan_Group_From_String ( String:str ) -> "Irreducible_Cartan_Group" or "Direct_Sum_Of_Cartan_Groups" :
43
Summands = []
44
for String_Part_Counter , String_Part in enumerate( String.split('x') , start=_sage_const_1 ) :
45
Cartan_Family = String_Part[_sage_const_0 ]
46
try : Cartan_Degree = int(String_Part[_sage_const_1 :])
47
except : raise ValueError('The algorithm is not able to extract a Cartan degree from the '+str(String_Part_Counter)+'-th string part `'+String_Part+'`.')
48
Summands += [ Irreducible_Cartan_Group( Cartan_Family , Cartan_Degree ) ]
49
50
if len(Summands) == _sage_const_1 :
51
Single_Summand = Summands[_sage_const_0 ]
52
return Single_Summand
53
else :
54
return Direct_Sum_Of_Cartan_Groups( Summands )
55
56
def Get_Cartan_Group_From_2Tuple ( Tuple:tuple ) -> "Irreducible_Cartan_Group" :
57
assert len(Tuple) == _sage_const_2 , ValueError('The algorithm can not extract Cartan data from a tuple of length '+str(len(Tuple))+'; it expects a tuple of length 2.')
58
59
assert type(Tuple[_sage_const_0 ]) == str , TypeError('The algorithm can not extract Cartan family from the first entry of the tuple: Tuple[0] = '+str(Tuple[_sage_const_0 ])+'.')
60
Cartan_Family = Tuple[_sage_const_0 ]
61
62
assert Tuple[_sage_const_1 ] in ZZ , TypeError('The algorithm can not extract Cartan degree from the second entry of the tuple: Tuple[1] = '+str(Tuple[_sage_const_1 ])+'.')
63
Cartan_Degree = Tuple[_sage_const_1 ]
64
65
return Irreducible_Cartan_Group( Cartan_Family , Cartan_Degree )
66
67
if len(Input) == _sage_const_0 :
68
return Direct_Sum_Of_Cartan_Groups( [] )
69
70
elif len(Input) == _sage_const_1 :
71
Input = Input[_sage_const_0 ]
72
73
if Input in [ None , _sage_const_0 , "" ] :
74
return Direct_Sum_Of_Cartan_Groups( [] )
75
76
elif type(Input) == str :
77
return Get_Cartan_Group_From_String( Input )
78
79
elif type(Input) == list :
80
Result = Direct_Sum_Of_Cartan_Groups( [] )
81
for Entry_Counter , Entry in enumerate( Input , start=_sage_const_1 ) :
82
if type(Entry) == str : Result += Get_Cartan_Group_From_String( Entry )
83
elif type(Entry) == tuple : Result += Get_Cartan_Group_From_2Tuple( Entry )
84
elif type(Entry) == Irreducible_Cartan_Group : Result += Entry
85
elif type(Entry) == Direct_Sum_Of_Cartan_Groups : Result += Entry
86
elif Entry in [ None , _sage_const_0 , "" ] : pass
87
else : raise TypeError('The '+str(Entry_Counter)+'-th entry of the input is of an inappropriate type.')
88
if Result.Is_Irreducible() : return Result[_sage_const_0 ]
89
else : return Result
90
91
elif len(Input) == _sage_const_2 :
92
if type(Input[_sage_const_0 ]) == str and type(Input[_sage_const_1 ]) == int : return Get_Cartan_Group_From_2Tuple( *Input )
93
else : return Cartan_Group.Constructor( list(Input) )
94
95
else :
96
return Cartan_Group.Constructor( list(Input) )
97
98
99
# Synonyms for the method ``Weyl_Character``.
100
def rmV ( self , Highest_Weight:"Weight" ) -> "Weyl_Character" :
101
"""Returns the Weyl character associated to given highest weights."""
102
return self.Weyl_Character( Highest_Weight=Highest_Weight )
103
104
105
def Weyl_Character ( self , Highest_Weight:"Weight" ) -> "Weyl_Character" :
106
"""Returns the Weyl character associated to a given highest weight."""
107
WCR = self.Weyl_Character_Ring()
108
return WCR( Highest_Weight )
109
110
111
def Weyl_Character_Ring ( self , Style:str='coroots' ) -> "Weyl_Character_Ring" :
112
"""Returns the Weyl character ring associated to the Cartan type of G."""
113
return WeylCharacterRing( self.Cartan_Type() , style=Style )
114
115
116
117
class Irreducible_Cartan_Group ( Irreducible_Structure , Cartan_Group ) :
118
119
def __init__ ( self , Cartan_Family:str , Cartan_Degree:int ) -> None :
120
"""
121
Initialize an irreducible algebraic group of given cartan type.
122
123
INPUT:
124
- ``Cartan_Family`` -- str;
125
- ``Cartan_Degree`` -- int;
126
127
OUTPUT: None.
128
"""
129
assert Cartan_Family in self.ADMISSIBLE_CARTAN_FAMILIES.keys() , ValueError('The input for ``Cartan_Degree`` need to be a letter from the alphabet '+str(self.ADMISSIBLE_CARTAN_FAMILIES.keys())+'.')
130
self._Cartan_Family = Cartan_Family
131
132
assert Cartan_Degree in ZZ , ValueError('The input for ``Cartan_Degree`` need to be an integer.')
133
Lower_Bound , Upper_Bound = self.ADMISSIBLE_CARTAN_FAMILIES[Cartan_Family]
134
assert Lower_Bound <= Cartan_Degree and Cartan_Degree <= Upper_Bound , ValueError('If the Cartan family is '+str(Cartan_Family)+', then the input for ``Cartan_Degree`` need to between '+str(Lower_Bound)+' and '+str(Upper_Bound)+'.')
135
self._Cartan_Degree = Cartan_Degree
136
137
138
def __repr__ ( self ) -> ( str , int ) :
139
"""Returns all attributes which are necessary to initialize the object."""
140
return self.Cartan_Family() , self.Cartan_Degree()
141
142
143
def __str__ ( self ) :
144
"""Returns a one-line string as short description."""
145
return 'Irreducible Cartan Group of type '+str(self.Cartan_String())+'.'
146
147
148
def __truediv__ ( self , other:"Parabolic_Subgroup_In_Irreducible_Cartan_Group" ) -> "Irreducible_Homogeneous_Variety" :
149
"""Returns the homogeneous variety G/P."""
150
from Equivariant_Vector_Bundles_On_Homogeneous_Varieties.Base_Space.Parabolic_Subgroup import Parabolic_Subgroup_In_Irreducible_Cartan_Group
151
assert type( other ) == Parabolic_Subgroup_In_Irreducible_Cartan_Group , TypeError('The divisor need to be a parabolic subgroup.')
152
assert self == other.Parent_Group() , ValueError('The parabolic subgroup (divisor) need to have ``self`` as parent group.')
153
from Equivariant_Vector_Bundles_On_Homogeneous_Varieties.Base_Space.Homogeneous_Variety import Irreducible_Homogeneous_Variety
154
return Irreducible_Homogeneous_Variety( other )
155
156
157
def Borel_Subgroup( self ) -> "Parabolic_Subgroup_In_Irreducible_Cartan_Group" :
158
"""Returns the Borel subgroup of G (= minimal parabolic, i.e. no nodes are included)."""
159
return self.Parabolic_Subgroup( Included_Nodes=set({}) , Excluded_Nodes=None )
160
161
162
def Cartan_Degree ( self ) -> int :
163
"""Returns the attribute ``_Cartan_Degree``."""
164
return self._Cartan_Degree
165
166
167
def Cartan_Family ( self ) -> str :
168
"""Returns the attribute ``_Cartan_Family``."""
169
return self._Cartan_Family
170
171
172
def Cartan_String ( self ) -> str :
173
"""Returns the Cartan string."""
174
return self.Cartan_Family()+str(self.Cartan_Degree())
175
176
177
def Dimension ( self ) -> int :
178
"""
179
Return the dimension of ``self`.
180
181
INPUT:
182
- ``self`` -- Cartan_Group; the Cartan group G.
183
184
OUTPUT:
185
- ``Output`` -- Integer; the dimension of G
186
187
ALGORITHM:
188
Thanks to the post by Pieter Belmans concerning the dimension of partial flag varieties
189
from Jun 14th, 2017 on his blog (cf. to [Blog_PieterBelmans]_). The link is
190
https://pbelmans.ncag.info/blog/2017/06/14/dimensions-of-partial-flag-varieties/
191
(Date: Apr 21st, 2021).
192
193
For the Borel group B ⊂ G: dim B = # of positive roots + rank (which accounts for the center)
194
For G: dim G = # of roots in the root system + rank (which accounts for the center)
195
i.e. # of roots in the root system = # of positive roots + # negative roots
196
and # of positive roots = # negative roots
197
so # of roots in the root system = 2 * # of positive roots
198
199
REFERENCE:
200
[Blog_PieterBelmans] https://pbelmans.ncag.info/blog/
201
"""
202
Rank = self.Cartan_Type().dynkin_diagram().rank()
203
Number_Of_Positive_Roots = len( list( self.Cartan_Type().root_system().root_lattice().positive_roots() ) )
204
return Rank + _sage_const_2 * Number_Of_Positive_Roots
205
206
207
def Is_Exceptional ( self ) -> bool :
208
"""Test if the Cartan family of ``self`` is out of [ E , F , G ]."""
209
return self.ADMISSIBLE_CARTAN_FAMILIES[self.Cartan_Family()][_sage_const_1 ] < +infinity
210
211
212
def Is_Ordinary ( self ) -> bool :
213
"""Test if the Cartan family of ``self`` is out of [ A , B , C , D ]."""
214
return not self.Is_Exceptional()
215
216
217
def Maximal_Parabolic_Subgroup ( self , Excluded_Node :int ) -> "Parabolic_Subgroup_In_Irreducible_Cartan_Group" :
218
"""
219
Returns the maximal parabolic subgroup associated to the excluded node.
220
It is the parabolic subgroup obtained by adding all neative roots except the ``ExcludedNode``-th one.
221
"""
222
Nodes = set( self.Cartan_Type().index_set() )
223
assert Excluded_Node in Nodes , ValueError('The excluded node neet to be an element of the set of all nodes ' + str(Nodes) + '.')
224
return self.Parabolic_Subgroup( Included_Nodes=None , Excluded_Nodes={ Excluded_Node } )
225
226
227
def Parabolic_Subgroup ( self , Included_Nodes :set[ int ] or None =None , Excluded_Nodes :set[ int ] or None =None ) -> "Parabolic_Subgroup_In_Irreducible_Cartan_Group" :
228
"""Returns the parabolic subgroup associated to the included nodes.
229
230
INPUT:
231
- ``self`` -- Irreducible_Cartan_Group; the Cartan group G.
232
- ``Included_Nodes`` -- set or None (default: None);
233
- ``Excluded_Nodes`` -- set or None (default: None);
234
235
OUTPUT:
236
- ``Output`` -- Parabolic subgroup; the parabolic subgroup P ⊂ G associated to the included nodes.
237
238
.. NOTE::
239
The Borel subgroup B ⊂ G is the minimal parabolic subgroup obtained by all positive roots and the center.
240
Any further parabolic subgroup is an extension of B by adding a certain amount of negative roots.
241
So ``Included_Nodes`` is the data which negative roots are taken into account.
242
"""
243
Nodes = set( self.Cartan_Type().index_set() )
244
245
# Test the input for ``Included_Nodes`` and ``Excluded_Nodes``
246
if Included_Nodes == None and Excluded_Nodes == None :
247
raise ValueError('There need to be an input for either ``Included_Nodes`` or ``Excluded_Nodes``.')
248
249
elif type(Included_Nodes) == set and Excluded_Nodes == None :
250
assert Included_Nodes.issubset( Nodes ) , ValueError('The set of included nodes need to be a subset of set of all nodes ' + str( Nodes ) + '.')
251
252
elif Included_Nodes == None and type(Excluded_Nodes) == set :
253
assert Excluded_Nodes.issubset( Nodes ) , ValueError('The set of excluded nodes need to be a subset of set of all nodes ' + str( Nodes ) + '.')
254
Included_Nodes = Nodes.difference( Excluded_Nodes )
255
256
elif type(Included_Nodes) == set and type(Excluded_Nodes) == set :
257
assert Included_Nodes.union(Excluded_Nodes) == Nodes , ValueError('The union of included and excluded nodes need to be a the set of all nodes ' + str( Nodes ) + '.')
258
assert Included_Nodes.intersection(Excluded_Nodes) == set([]) , ValueError('The intersection of included and excluded nodes need to be empty.')
259
260
else :
261
raise ValueError('The inputs for ``Included_Nodes`` and ``Excluded_Nodes`` are of inappropriate values.')
262
263
from Equivariant_Vector_Bundles_On_Homogeneous_Varieties.Base_Space.Parabolic_Subgroup import Parabolic_Subgroup_In_Irreducible_Cartan_Group
264
return Parabolic_Subgroup_In_Irreducible_Cartan_Group( Parent_Group=self , Included_Nodes=Included_Nodes )
265
266
267
268
class Direct_Sum_Of_Cartan_Groups ( Direct_Sum_Of_Structures , Cartan_Group ) :
269
270
def __init__ ( self , Summands:list[Irreducible_Cartan_Group] ) -> None :
271
"""
272
Initialize an algebraic group of given cartan type.
273
274
INPUT:
275
- ``Input`` -- list[Irreducible_Cartan_Group];
276
277
..ToDo: Do not initalize if len == 0 or == 1.
278
279
OUTPUT: None.
280
"""
281
self._Summands = []
282
for Summand_Counter , Summand in enumerate( Summands , start=_sage_const_1 ) :
283
assert type(Summand) == Irreducible_Cartan_Group , TypeError('The '+str(Summand_Counter)+'-th component need to be an object of the class ``Irreducible_Cartan_Group``.')
284
self._Summands += [ Summand ]
285
286
287
def __repr__ ( self ) -> list[ Irreducible_Cartan_Group ] :
288
"""Returns all attributes which are necessary to initialize the object."""
289
return self.Summands()
290
291
292
def __str__ ( self ) :
293
"""Returns a one-line string as short description."""
294
if len(self) == _sage_const_0 : return 'Trivial group.'
295
else : return 'Direct sum of Cartan groups of type '+str(self.Cartan_String())+'.'
296
297
298
def Cartan_Degree ( self ) -> list[int] :
299
"""Returns the Cartan degree of each component of ``self``."""
300
return [ Summand.Cartan_Degree() for Summand in self.Summands() ]
301
302
303
def Cartan_Family ( self ) -> list[str] :
304
"""Returns the Cartan family of each component of ``self``."""
305
return [ Summand.Cartan_Family() for Summand in self.Summands() ]
306
307
308
def Cartan_String ( self ) -> str :
309
"""Returns the Cartan string."""
310
return 'x'.join([ Summand.Cartan_String() for Summand in self.Summands() ])
311
312
313
def Dimension ( self ) -> int :
314
"""Return the dimension of ``self`."""
315
return sum([ Summand.Dimension() for Summand in self.Summands() ])
316
317
318
def Is_Exceptional ( self ) -> list[bool] :
319
"""Test if the Cartan family of each component of ``self`` is out of [ E , F , G ]."""
320
return [ Summand.Is_Exceptional() for Summand in self.Summands() ]
321
322
323
def Is_Ordinary ( self ) -> list[bool] :
324
"""Test if the Cartan family of each component of ``self`` is out of [ A , B , C , D ]."""
325
return [ Summand.Is_Ordinary() for Summand in self.Summands() ]
326
327
328
329
330
331