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 / Parabolic_Subgroup.py
1842 viewsLicense: GPL3
ubuntu2204
12# This file was *autogenerated* from the file Parabolic_Subgroup.sage3from sage.all_cmdline import * # import sage library45_sage_const_1 = Integer(1); _sage_const_0 = Integer(0); _sage_const_3 = Integer(3); _sage_const_4 = Integer(4); _sage_const_2 = Integer(2); _sage_const_5 = Integer(5)6from typing import Iterator7from Equivariant_Vector_Bundles_On_Homogeneous_Varieties.Foundation.Structure import Structure , Irreducible_Structure8from Equivariant_Vector_Bundles_On_Homogeneous_Varieties.Base_Space.Cartan_Group import Irreducible_Cartan_Group , Direct_Sum_Of_Cartan_Groups9101112class Parabolic_Subgroup ( Structure ) :13pass14151617class Parabolic_Subgroup_In_Irreducible_Cartan_Group ( Irreducible_Structure , Parabolic_Subgroup ) :1819def __init__( self , Parent_Group:Irreducible_Cartan_Group , Included_Nodes:set=set([]) ) -> None :20"""21Initialize an algebraic group of given cartan type over a base field.2223INPUT:24- ``Parent_Group`` -- Irreducible_Cartan_Group;25The parent group G26- ``Included_Nodes`` -- set;27A parabolic subgroup is uniquely determined by taking the Borel subgroup B ⊂ G and adding the negative roots which are marked.2829OUTPUT: None.30"""31assert type( Parent_Group ) == Irreducible_Cartan_Group , TypeError('The parent group must be an irreducible Cartan group.')32self._Parent_Group = Parent_Group3334assert type( Included_Nodes ) == set , TypeError('The included nodes must be given as set.')35Nodes = set( Parent_Group.Cartan_Type().index_set() )36assert Included_Nodes.issubset( Nodes ) , ValueError('The set of included nodes must be a subset of all admissible nodes ' + str(Nodes) + '.')37self._Included_Nodes = Included_Nodes383940def __repr__ ( self ) -> ( Irreducible_Cartan_Group , set ) :41"""Returns all attributes which are necessary to initialize the object."""42return self.Parent_Group() , self.Included_Nodes()434445def __str__ ( self ) -> str :46"""Returns a one-line string as short description."""47return 'Parabolic subgroup P(' + str( self.Included_Nodes() ) + ') in irreducible Cartan group of type ' + self.Parent_Group().Cartan_String() + '.'484950def Cartan_Data ( self ) -> ( str , int ) :51"""Returns the Cartan data of each irreducible component of ``self``."""52for Connected_Component in self.Connected_Components_Of_Included_Nodes() :53Cartan_Subtype = self.Parent_Group().Cartan_Type().subtype( Connected_Component )54yield Cartan_Subtype.type() , len(Cartan_Subtype.index_set())555657def Cartan_String ( self ) -> str :58"""Returns the Cartan string of ``self``."""59return 'x'.join([ Cartan_Family+str(Cartan_Degree) for Cartan_Family , Cartan_Degree in self.Cartan_Data() ])606162def Cartan_Type ( self ) -> CartanType :63"""Returns the Cartan type of ``self``."""64return CartanType( self.Cartan_String() )656667def Connected_Components_Of_Included_Nodes ( self ) -> Iterator[list]:68"""69Returns the included nodes subdivided into lists of connected components70(i.e. lists of nodes which are connected by edges).71"""72return ( list( Dict.keys() ) for Dict in self.Relabelling(Decomposition_Style='Fine') )737475def Dimension ( self ) -> int :76"""77Returns the dimension of ``self``.7879INPUT:80- ``self`` -- ParabolicSubgroup; the parabolic subgroup P of a Cartan group G.8182OUTPUT:83- ``Output`` -- Integer; the dimension of ``self``.8485ALGORITHM:86Thanks to the post by Pieter Belmans concerning the dimension of partial flag varieties87from Jun 14th, 2017 on his blog (cf. to [Blog_PieterBelmans]_). The link is88https://pbelmans.ncag.info/blog/2017/06/14/dimensions-of-partial-flag-varieties/89(Date: Apr 21st, 2021).9091For the Borel group B ⊂ G: dim B = # of positive roots + rank (which accounts for the center)92For P: dim P = dim B + # of negative roots which are added to construct P9394REFERENCE:95[Blog_PieterBelmans] https://pbelmans.ncag.info/blog/96"""97Rank = self.Parent_Group().Cartan_Type().dynkin_diagram().rank()98Number_Of_Positive_Roots = len( list( self.Parent_Group().Cartan_Type().root_system().root_lattice().positive_roots() ) )99Number_Of_Available_Negative_Roots = len( self.Negative_Roots() )100return Rank + Number_Of_Positive_Roots + Number_Of_Available_Negative_Roots101102103def Excluded_Nodes ( self , Output_Type:set or list or str=set ) -> set or list or str :104"""Returns the excluded nodes."""105Nodes = set( self.Parent_Group().Cartan_Type().index_set() )106Output = list(Nodes.difference(self.Included_Nodes()))107Output.sort()108if Output_Type != set :109if Output_Type == list : return Output110elif Output_Type == str : return ','.join(Output)111else : raise TypeError('The input for ``Output_Type`` is inappropriate.')112else :113return set(Output)114115116def Included_Nodes ( self , Output_Type:set or list or str=set ) -> set or list or str :117"""Returns the attribute ``_Included_Nodes``."""118Output = list(self._Included_Nodes)119Output.sort()120if Output_Type != set :121if Output_Type == list : return Output122elif Output_Type == str : return ','.join(Output)123else : raise TypeError('The input for ``Output_Type`` is inappropriate.')124else :125return set(Output)126127128def Initialize_As_Cartan_Group ( self ) -> Irreducible_Cartan_Group or Reducible_Cartan_Group :129"""130Returns the Cartan group associated to the Cartan string of ``self``.131Thus, one has access to the methods of the class ``Cartan_Group`` and its subclasses.132"""133Components = [ Irreducible_Cartan_Group( Cartan_Family , Cartan_Degree ) for Cartan_Family , Cartan_Degree in self.Cartan_Data() ]134if len(Components) == _sage_const_1 : return Components[_sage_const_0 ]135else : return Direct_Sum_Of_Cartan_Groups( Components )136137138# Synonym for the method ``Is_Minimal``139def Is_Borel ( self ) -> bool :140"""Test if ``self`` is Borel (i.e. it is minimal)."""141return self.Is_Minimal()142143144def Is_Complete ( self ) -> bool :145"""Test if ``self`` is complete (i.e. all nodes are included; or equivalently, no node is excluded)."""146return len( self.Excluded_Nodes(Output_Type=list) ) == _sage_const_0147148149def Is_Maximal ( self ) -> bool :150"""Test if ``self`` is maximal (i.e. almost all nodes are included; or equivalently, there is only one node excluded)."""151return len( self.Excluded_Nodes(Output_Type=list) ) == _sage_const_1152153154def Is_Minimal ( self ) -> bool :155"""Test if ``self`` is minimal (i.e. no node is included; or equivalently, all nodes are excluded)."""156return len( self.Included_Nodes(Output_Type=list) ) == _sage_const_0157158159# Synonym for the method ``Is_Complete``160def Is_Parent_Group ( self ) -> bool :161"""Test if ``self`` coincides with the parent group (i.e. it is complete)."""162return self.Is_Complete()163164165def Negative_Roots ( self ) -> list :166"""Returns a list of all negative roots which are available for ``self``."""167return [ Negative_Root for Negative_Root in list( self.Parent_Group().Cartan_Type().root_system().root_lattice().negative_roots() )168if not False in [ Node in self.Included_Nodes() for Node , Coefficient in Negative_Root ]169]170171172def Parent_Group ( self ) -> Irreducible_Cartan_Group :173"""Returns the attribute ``_Parent_Group``."""174return self._Parent_Group175176177def Relabelling ( self , Decomposition_Style:'Fine' or 'Coarse'='Coarse' ) -> dict or list[dict] :178"""Returns the relabelling of the included nodes with respect to the parent group."""179if Decomposition_Style == 'Coarse' :180return { Included_Node : Counter for Counter , Included_Node in enumerate( self.Included_Nodes(Output_Type=list) , start=_sage_const_1 ) }181182elif Decomposition_Style == 'Fine' :183Connected_Components = []184Included_Nodes = self.Included_Nodes(Output_Type=list)185Cartan_Family = self.Parent_Group().Cartan_Family()186Cartan_Degree = self.Parent_Group().Cartan_Degree()187End = Cartan_Degree188189# For the case "Cartan_Family == E", the Dynkin-diagram-ordering is sligthly is different from a lexicographical-ordering.190# In particluar, th second node is onyl one-connected to the fourth one and NOT between the third and fourth one.191if not Cartan_Family == 'E' :192Included_Nodes_In_Order_As_Given_By_Dynkin_Diagram = Included_Nodes193else :194Included_Nodes_In_Order_As_Given_By_Dynkin_Diagram = [ Included_Node for Included_Node in [ _sage_const_1 , _sage_const_3 , _sage_const_4 , _sage_const_2 ] + (ellipsis_range( _sage_const_5 ,Ellipsis, End )) if Included_Node in Included_Nodes ]195196# We establish connected components of all included nodes197for Node_Counter , Current_Node in enumerate( Included_Nodes_In_Order_As_Given_By_Dynkin_Diagram , start=_sage_const_1 ) :198Is_Current_Node_In_Some_Connected_Component = False199200# The first included nodes gives arise to the first connected component ...201if Node_Counter == _sage_const_1 :202Connected_Components += [ [ Current_Node ] ]203Is_Current_Node_In_Some_Connected_Component = True204205# Is the currently considered node element of an already existing connected component?206else :207if Cartan_Family == 'D' :208for Connected_Component in Connected_Components :209if ( ( Current_Node <= End-_sage_const_2 and Current_Node-_sage_const_1 in Connected_Component ) or # k-th node is connected with the (k-1)-th node (k <= n-2)210( Current_Node == End-_sage_const_1 and End-_sage_const_1 in Connected_Component ) or # (n-1)-th node is connected with the (n-2)-th node211( Current_Node == End and End-_sage_const_2 in Connected_Component ) # n-th node is connected with the (n-2)-th node212) :213Connected_Component += [ Current_Node ]214Is_Current_Node_In_Some_Connected_Component = True215break216217elif Cartan_Family == 'E' :218for Connected_Component in Connected_Components :219if ( ( Current_Node == _sage_const_3 and Current_Node-_sage_const_2 in Connected_Component ) or # 3rd node220( Current_Node == _sage_const_4 and Current_Node-_sage_const_1 in Connected_Component ) or # 4th node221( Current_Node == _sage_const_2 and Current_Node+_sage_const_2 in Connected_Component ) or # 2nd node222( _sage_const_5 <= Current_Node and Current_Node-_sage_const_1 in Connected_Component ) # 5th/ 6th/ ... node223) :224Connected_Component += [ Current_Node ]225Is_Current_Node_In_Some_Connected_Component = True226break227228else :229for Connected_Component in Connected_Components :230if Current_Node-_sage_const_1 in Connected_Component :231Connected_Component += [ Current_Node ]232Is_Current_Node_In_Some_Connected_Component = True233break234235# If the currently considered node seems to be not element of one of the existing connected components.236# Hence, we establish a new connected component ...237if not Is_Current_Node_In_Some_Connected_Component : Connected_Components += [ [ Current_Node ] ]238239Relabelling = []240for Connected_Component in Connected_Components :241Connected_Component.sort()242Relabelling += [ { Included_Node : Node_Counter_In_Connected_Component for Node_Counter_In_Connected_Component , Included_Node in enumerate( Connected_Component , start=_sage_const_1 ) } ]243return Relabelling244245else : raise ValueError('The input for ``Decomposition_Style`` is inappropriate.')246247248249#class Parabolic_Subgroup_In_Direct_Sum_Of_Cartan_Groups ( Direct_Sum_Of_Structures , Parabolic_Subgroup ) :250#251# def Dimension ( self ) -> int :252# """Returns the dimension of ``self``."""253# return sum([ Component.Dimension() for Component in self.Components() ])254255256257