Environment to perform calculations of equivariant vector bundles on homogeneous varieties
Equivariant_Vector_Bundles_On_Homogeneous_Varieties__0-2 / src / Equivariant_Vector_Bundles_On_Homogeneous_Varieties / Base_Space / Cartan_Group.sage.py
1842 viewsLicense: GPL3
ubuntu2204
12# This file was *autogenerated* from the file Cartan_Group.sage3from sage.all_cmdline import * # import sage library45_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)6from Equivariant_Vector_Bundles_On_Homogeneous_Varieties.Foundation.Structure import Irreducible_Structure , Direct_Sum_Of_Structures78910class Cartan_Group ( object ) :1112ADMISSIBLE_CARTAN_FAMILIES = { 'A' : ( _sage_const_1 , +infinity ) ,13'B' : ( _sage_const_2 , +infinity ) ,14'C' : ( _sage_const_2 , +infinity ) ,15'D' : ( _sage_const_3 , +infinity ) ,16'E' : ( _sage_const_6 , _sage_const_8 ) ,17'F' : ( _sage_const_4 , _sage_const_4 ) ,18'G' : ( _sage_const_2 , _sage_const_2 )19}202122def __add__ ( self , other:"Cartan_Group" ) -> "Irreducible_Cartan_Group" or "Direct_Sum_Of_Cartan_Groups" :23"""Returns the coproduct of two Cartan groups."""24assert 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 ] )+'.'25New_Constituent_Parts = self.Constituent_Parts() + other.Constituent_Parts()26if len(New_Constituent_Parts) == _sage_const_1 :27Single_Part = New_Constituent_Parts[_sage_const_0 ]28return Single_Part29else :30return Direct_Sum_Of_Cartan_Groups( New_Constituent_Parts )313233def Cartan_Type ( self ) -> CartanType:34"""Returns the Cartan type."""35return CartanType( self.Cartan_String() )363738@staticmethod39def Constructor ( *Input:tuple ) -> "Irreducible_Cartan_Group" or "Direct_Sum_Of_Cartan_Groups" :4041def Get_Cartan_Group_From_String ( String:str ) -> "Irreducible_Cartan_Group" or "Direct_Sum_Of_Cartan_Groups" :42Summands = []43for String_Part_Counter , String_Part in enumerate( String.split('x') , start=_sage_const_1 ) :44Cartan_Family = String_Part[_sage_const_0 ]45try : Cartan_Degree = int(String_Part[_sage_const_1 :])46except : raise ValueError('The algorithm is not able to extract a Cartan degree from the '+str(String_Part_Counter)+'-th string part `'+String_Part+'`.')47Summands += [ Irreducible_Cartan_Group( Cartan_Family , Cartan_Degree ) ]4849if len(Summands) == _sage_const_1 :50Single_Summand = Summands[_sage_const_0 ]51return Single_Summand52else :53return Direct_Sum_Of_Cartan_Groups( Summands )5455def Get_Cartan_Group_From_2Tuple ( Tuple:tuple ) -> "Irreducible_Cartan_Group" :56assert 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.')5758assert 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 ])+'.')59Cartan_Family = Tuple[_sage_const_0 ]6061assert 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 ])+'.')62Cartan_Degree = Tuple[_sage_const_1 ]6364return Irreducible_Cartan_Group( Cartan_Family , Cartan_Degree )6566if len(Input) == _sage_const_0 :67return Direct_Sum_Of_Cartan_Groups( [] )6869elif len(Input) == _sage_const_1 :70Input = Input[_sage_const_0 ]7172if Input in [ None , _sage_const_0 , "" ] :73return Direct_Sum_Of_Cartan_Groups( [] )7475elif type(Input) == str :76return Get_Cartan_Group_From_String( Input )7778elif type(Input) == list :79Result = Direct_Sum_Of_Cartan_Groups( [] )80for Entry_Counter , Entry in enumerate( Input , start=_sage_const_1 ) :81if type(Entry) == str : Result += Get_Cartan_Group_From_String( Entry )82elif type(Entry) == tuple : Result += Get_Cartan_Group_From_2Tuple( Entry )83elif type(Entry) == Irreducible_Cartan_Group : Result += Entry84elif type(Entry) == Direct_Sum_Of_Cartan_Groups : Result += Entry85elif Entry in [ None , _sage_const_0 , "" ] : pass86else : raise TypeError('The '+str(Entry_Counter)+'-th entry of the input is of an inappropriate type.')87if Result.Is_Irreducible() : return Result[_sage_const_0 ]88else : return Result8990elif len(Input) == _sage_const_2 :91if type(Input[_sage_const_0 ]) == str and type(Input[_sage_const_1 ]) == int : return Get_Cartan_Group_From_2Tuple( *Input )92else : return Cartan_Group.Constructor( list(Input) )9394else :95return Cartan_Group.Constructor( list(Input) )969798# Synonyms for the method ``Weyl_Character``.99def rmV ( self , Highest_Weight:"Weight" ) -> "Weyl_Character" :100"""Returns the Weyl character associated to given highest weights."""101return self.Weyl_Character( Highest_Weight=Highest_Weight )102103104def Weyl_Character ( self , Highest_Weight:"Weight" ) -> "Weyl_Character" :105"""Returns the Weyl character associated to a given highest weight."""106WCR = self.Weyl_Character_Ring()107return WCR( Highest_Weight )108109110def Weyl_Character_Ring ( self , Style:str='coroots' ) -> "Weyl_Character_Ring" :111"""Returns the Weyl character ring associated to the Cartan type of G."""112return WeylCharacterRing( self.Cartan_Type() , style=Style )113114115116class Irreducible_Cartan_Group ( Irreducible_Structure , Cartan_Group ) :117118def __init__ ( self , Cartan_Family:str , Cartan_Degree:int ) -> None :119"""120Initialize an irreducible algebraic group of given cartan type.121122INPUT:123- ``Cartan_Family`` -- str;124- ``Cartan_Degree`` -- int;125126OUTPUT: None.127"""128assert 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())+'.')129self._Cartan_Family = Cartan_Family130131assert Cartan_Degree in ZZ , ValueError('The input for ``Cartan_Degree`` need to be an integer.')132Lower_Bound , Upper_Bound = self.ADMISSIBLE_CARTAN_FAMILIES[Cartan_Family]133assert 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)+'.')134self._Cartan_Degree = Cartan_Degree135136137def __repr__ ( self ) -> ( str , int ) :138"""Returns all attributes which are necessary to initialize the object."""139return self.Cartan_Family() , self.Cartan_Degree()140141142def __str__ ( self ) :143"""Returns a one-line string as short description."""144return 'Irreducible Cartan Group of type '+str(self.Cartan_String())+'.'145146147def __truediv__ ( self , other:"Parabolic_Subgroup_In_Irreducible_Cartan_Group" ) -> "Irreducible_Homogeneous_Variety" :148"""Returns the homogeneous variety G/P."""149from Equivariant_Vector_Bundles_On_Homogeneous_Varieties.Base_Space.Parabolic_Subgroup import Parabolic_Subgroup_In_Irreducible_Cartan_Group150assert type( other ) == Parabolic_Subgroup_In_Irreducible_Cartan_Group , TypeError('The divisor need to be a parabolic subgroup.')151assert self == other.Parent_Group() , ValueError('The parabolic subgroup (divisor) need to have ``self`` as parent group.')152from Equivariant_Vector_Bundles_On_Homogeneous_Varieties.Base_Space.Homogeneous_Variety import Irreducible_Homogeneous_Variety153return Irreducible_Homogeneous_Variety( other )154155156def Borel_Subgroup( self ) -> "Parabolic_Subgroup_In_Irreducible_Cartan_Group" :157"""Returns the Borel subgroup of G (= minimal parabolic, i.e. no nodes are included)."""158return self.Parabolic_Subgroup( Included_Nodes=set({}) , Excluded_Nodes=None )159160161def Cartan_Degree ( self ) -> int :162"""Returns the attribute ``_Cartan_Degree``."""163return self._Cartan_Degree164165166def Cartan_Family ( self ) -> str :167"""Returns the attribute ``_Cartan_Family``."""168return self._Cartan_Family169170171def Cartan_String ( self ) -> str :172"""Returns the Cartan string."""173return self.Cartan_Family()+str(self.Cartan_Degree())174175176def Dimension ( self ) -> int :177"""178Return the dimension of ``self`.179180INPUT:181- ``self`` -- Cartan_Group; the Cartan group G.182183OUTPUT:184- ``Output`` -- Integer; the dimension of G185186ALGORITHM:187Thanks to the post by Pieter Belmans concerning the dimension of partial flag varieties188from Jun 14th, 2017 on his blog (cf. to [Blog_PieterBelmans]_). The link is189https://pbelmans.ncag.info/blog/2017/06/14/dimensions-of-partial-flag-varieties/190(Date: Apr 21st, 2021).191192For the Borel group B ⊂ G: dim B = # of positive roots + rank (which accounts for the center)193For G: dim G = # of roots in the root system + rank (which accounts for the center)194i.e. # of roots in the root system = # of positive roots + # negative roots195and # of positive roots = # negative roots196so # of roots in the root system = 2 * # of positive roots197198REFERENCE:199[Blog_PieterBelmans] https://pbelmans.ncag.info/blog/200"""201Rank = self.Cartan_Type().dynkin_diagram().rank()202Number_Of_Positive_Roots = len( list( self.Cartan_Type().root_system().root_lattice().positive_roots() ) )203return Rank + _sage_const_2 * Number_Of_Positive_Roots204205206def Is_Exceptional ( self ) -> bool :207"""Test if the Cartan family of ``self`` is out of [ E , F , G ]."""208return self.ADMISSIBLE_CARTAN_FAMILIES[self.Cartan_Family()][_sage_const_1 ] < +infinity209210211def Is_Ordinary ( self ) -> bool :212"""Test if the Cartan family of ``self`` is out of [ A , B , C , D ]."""213return not self.Is_Exceptional()214215216def Maximal_Parabolic_Subgroup ( self , Excluded_Node :int ) -> "Parabolic_Subgroup_In_Irreducible_Cartan_Group" :217"""218Returns the maximal parabolic subgroup associated to the excluded node.219It is the parabolic subgroup obtained by adding all neative roots except the ``ExcludedNode``-th one.220"""221Nodes = set( self.Cartan_Type().index_set() )222assert Excluded_Node in Nodes , ValueError('The excluded node neet to be an element of the set of all nodes ' + str(Nodes) + '.')223return self.Parabolic_Subgroup( Included_Nodes=None , Excluded_Nodes={ Excluded_Node } )224225226def Parabolic_Subgroup ( self , Included_Nodes :set[ int ] or None =None , Excluded_Nodes :set[ int ] or None =None ) -> "Parabolic_Subgroup_In_Irreducible_Cartan_Group" :227"""Returns the parabolic subgroup associated to the included nodes.228229INPUT:230- ``self`` -- Irreducible_Cartan_Group; the Cartan group G.231- ``Included_Nodes`` -- set or None (default: None);232- ``Excluded_Nodes`` -- set or None (default: None);233234OUTPUT:235- ``Output`` -- Parabolic subgroup; the parabolic subgroup P ⊂ G associated to the included nodes.236237.. NOTE::238The Borel subgroup B ⊂ G is the minimal parabolic subgroup obtained by all positive roots and the center.239Any further parabolic subgroup is an extension of B by adding a certain amount of negative roots.240So ``Included_Nodes`` is the data which negative roots are taken into account.241"""242Nodes = set( self.Cartan_Type().index_set() )243244# Test the input for ``Included_Nodes`` and ``Excluded_Nodes``245if Included_Nodes == None and Excluded_Nodes == None :246raise ValueError('There need to be an input for either ``Included_Nodes`` or ``Excluded_Nodes``.')247248elif type(Included_Nodes) == set and Excluded_Nodes == None :249assert Included_Nodes.issubset( Nodes ) , ValueError('The set of included nodes need to be a subset of set of all nodes ' + str( Nodes ) + '.')250251elif Included_Nodes == None and type(Excluded_Nodes) == set :252assert Excluded_Nodes.issubset( Nodes ) , ValueError('The set of excluded nodes need to be a subset of set of all nodes ' + str( Nodes ) + '.')253Included_Nodes = Nodes.difference( Excluded_Nodes )254255elif type(Included_Nodes) == set and type(Excluded_Nodes) == set :256assert 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 ) + '.')257assert Included_Nodes.intersection(Excluded_Nodes) == set([]) , ValueError('The intersection of included and excluded nodes need to be empty.')258259else :260raise ValueError('The inputs for ``Included_Nodes`` and ``Excluded_Nodes`` are of inappropriate values.')261262from Equivariant_Vector_Bundles_On_Homogeneous_Varieties.Base_Space.Parabolic_Subgroup import Parabolic_Subgroup_In_Irreducible_Cartan_Group263return Parabolic_Subgroup_In_Irreducible_Cartan_Group( Parent_Group=self , Included_Nodes=Included_Nodes )264265266267class Direct_Sum_Of_Cartan_Groups ( Direct_Sum_Of_Structures , Cartan_Group ) :268269def __init__ ( self , Summands:list[Irreducible_Cartan_Group] ) -> None :270"""271Initialize an algebraic group of given cartan type.272273INPUT:274- ``Input`` -- list[Irreducible_Cartan_Group];275276..ToDo: Do not initalize if len == 0 or == 1.277278OUTPUT: None.279"""280self._Summands = []281for Summand_Counter , Summand in enumerate( Summands , start=_sage_const_1 ) :282assert type(Summand) == Irreducible_Cartan_Group , TypeError('The '+str(Summand_Counter)+'-th component need to be an object of the class ``Irreducible_Cartan_Group``.')283self._Summands += [ Summand ]284285286def __repr__ ( self ) -> list[ Irreducible_Cartan_Group ] :287"""Returns all attributes which are necessary to initialize the object."""288return self.Summands()289290291def __str__ ( self ) :292"""Returns a one-line string as short description."""293if len(self) == _sage_const_0 : return 'Trivial group.'294else : return 'Direct sum of Cartan groups of type '+str(self.Cartan_String())+'.'295296297def Cartan_Degree ( self ) -> list[int] :298"""Returns the Cartan degree of each component of ``self``."""299return [ Summand.Cartan_Degree() for Summand in self.Summands() ]300301302def Cartan_Family ( self ) -> list[str] :303"""Returns the Cartan family of each component of ``self``."""304return [ Summand.Cartan_Family() for Summand in self.Summands() ]305306307def Cartan_String ( self ) -> str :308"""Returns the Cartan string."""309return 'x'.join([ Summand.Cartan_String() for Summand in self.Summands() ])310311312def Dimension ( self ) -> int :313"""Return the dimension of ``self`."""314return sum([ Summand.Dimension() for Summand in self.Summands() ])315316317def Is_Exceptional ( self ) -> list[bool] :318"""Test if the Cartan family of each component of ``self`` is out of [ E , F , G ]."""319return [ Summand.Is_Exceptional() for Summand in self.Summands() ]320321322def Is_Ordinary ( self ) -> list[bool] :323"""Test if the Cartan family of each component of ``self`` is out of [ A , B , C , D ]."""324return [ Summand.Is_Ordinary() for Summand in self.Summands() ]325326327328329330331