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 / Foundation / Structure.sage.py
1843 viewsLicense: GPL3
ubuntu2204
12# This file was *autogenerated* from the file Structure.sage3from sage.all_cmdline import * # import sage library45_sage_const_1 = Integer(1); _sage_const_0 = Integer(0); _sage_const_2 = Integer(2)6from typing import Iterator78class Structure ( object ) :910def __eq__ ( self , other:"Structure" ) -> bool :11"""Tests if two objects of the same class and if they coincide."""12if isinstance( other , self.__class__ ) :13if self.__repr__() == other.__repr__() : return True14else : return False15else : return False161718def __getitem__ ( self , Input:int or slice ) -> "Structure" or list[ "Structure" ] :19"""Returns a single datum or slices of data."""20if Input in ZZ :21Index = Input22if Index <= -len(self)-_sage_const_1 : return None23elif Index in (ellipsis_range( -len(self) ,Ellipsis, -_sage_const_1 )) : Index += len(self)24elif Index in (ellipsis_range( _sage_const_0 ,Ellipsis, len(self) )) : pass25else : return None26Single_Part = self.Constituent_Parts()[Index]27return Single_Part2829elif isinstance( Input , slice ) :30Slice = Input31New_Constituent_Parts = self.Constituent_Parts()[Slice]32if len(New_Constituent_Parts) == _sage_const_0 :33return None34elif len(New_Constituent_Parts) == _sage_const_1 :35Single_Part = New_Constituent_Parts[_sage_const_0 ]36return Single_Part37else :38return self.__class__( New_Constituent_Parts )3940else :41raise ValueError('The variable ``Input`` is inappropriate.')424344def __ne__ ( self , other:"Structure" ) -> bool :45"""Tests if two objects do not coincide."""46return not self == other474849def Is_Irreducible ( self ) -> bool :50"""Tests if ``self`` is irreducible/ simple."""51return len(self) == _sage_const_1525354def Is_Not_Trivial ( self ) -> bool :55"""Tests if ``self`` is not trivial."""56return not self.Is_Trivial()575859def Is_Reducible ( self ) -> bool :60"""Tests if ``self`` is reducible/ non-simple, i.e. it is trivial/ zero or consists of multiple summands/ components."""61return not self.Is_Irreducible()626364# Synonyms for the method ``Is_Irreducible``65def Is_Simple ( self ) -> bool :66"""Tests if ``self`` is irreducible/ simple, i.e. consists only of a single summand/ component."""67return self.Is_Irreducible()686970def Is_Trivial ( self ) -> bool :71"""Tests if ``self`` has no components."""72return len(self) == _sage_const_073747576class Irreducible_Structure ( Structure ) :7778def __iter__ ( self ) -> Iterator[ "Irreducible_Structure" ] :79"""Returns an iterator of ``self``."""80yield self818283def __len__ ( self ) -> int :84"""Returns the number of components of ``self``."""85return _sage_const_1868788def Constituent_Parts ( self ) -> list[ "Irreducible_Structure" ] :89"""Returns ``self`` in a list ."""90return [ self ]919293def Irreducible_Components ( self ) -> Iterator[ "Irreducible_Structure" ] :94"""Returns ``self``."""95yield self96979899class Direct_Sum_Of_Structures ( Structure ) :100101def __eq__ ( self , other:"Direct_Sum_Of_Structures" ) -> bool :102"""Tests if two objects of the class ``Direct_Sum_Of_Structures`` coincide."""103if type( other ) == self.__class__ :104if len( other ) == len( self ) :105106Remaining_Summands = other.Summands()107for Summand in self.Summands() :108try : Remaining_Summands.remove( Summand )109except : return False110111if len( Remaining_Summands ) == _sage_const_0 : return True112113else : return False114else : return False115else : return False116117118def __iter__ ( self ) -> Iterator[ Structure ] :119"""Returns an iterator of ``self``."""120for Summand in self.Summands() :121yield Summand122123124def __len__ ( self ) -> int :125"""Returns the number of components of ``self``."""126return len( self.Summands() )127128129def Constituent_Parts ( self ) -> list[ Structure ] :130"""Returns the summands of ``self`` as list."""131return self.Summands()132133134def Irreducible_Components ( self ) -> Iterator[ Irreducible_Structure ] :135"""Returns the irreducible components of ``self`` as list."""136for Summand in self.Summands() :137for Irreducible_Component in Summand.Irreducible_Components() :138yield Irreducible_Component139140141def Summands ( self ) -> list[ Structure ] :142"""Returns the attribute ``_Summands``."""143return self._Summands144145146147class Extension_Of_Structures ( Structure ) :148149def __iter__ ( self ) -> Iterator[ Structure ] :150"""Returns an iterator of ``self``."""151for Part in self.Constituent_Parts() :152yield Part153154155def __len__ ( self ) -> int :156"""Returns the number of constituent parts of ``self``."""157return _sage_const_2158159160def Constituent_Parts ( self ) -> "Extension_Of_Structures" :161"""Returns the summands of ``self`` as list."""162return [ self ]163164165def Irreducible_Components ( self ) -> Iterator[ Irreducible_Structure ] :166"""Returns the attribute ``_Components``."""167for Component in [ self.Quotient() , self.Subobject() ] :168for Irreducible_Component in Component.Irreducible_Components() :169yield Irreducible_Component170171172def Quotient ( self ) -> Structure :173"""Returns the attribute ``_Quotient``."""174return self._Quotient175176177def Subobject ( self ) -> Structure :178"""Returns the attribute ``_Subobject``."""179return self._Subobject180181182183184185