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 Structure.sage
4
from sage.all_cmdline import * # import sage library
5
6
_sage_const_1 = Integer(1); _sage_const_0 = Integer(0); _sage_const_2 = Integer(2)
7
from typing import Iterator
8
9
class Structure ( object ) :
10
11
def __eq__ ( self , other:"Structure" ) -> bool :
12
"""Tests if two objects of the same class and if they coincide."""
13
if isinstance( other , self.__class__ ) :
14
if self.__repr__() == other.__repr__() : return True
15
else : return False
16
else : return False
17
18
19
def __getitem__ ( self , Input:int or slice ) -> "Structure" or list[ "Structure" ] :
20
"""Returns a single datum or slices of data."""
21
if Input in ZZ :
22
Index = Input
23
if Index <= -len(self)-_sage_const_1 : return None
24
elif Index in (ellipsis_range( -len(self) ,Ellipsis, -_sage_const_1 )) : Index += len(self)
25
elif Index in (ellipsis_range( _sage_const_0 ,Ellipsis, len(self) )) : pass
26
else : return None
27
Single_Part = self.Constituent_Parts()[Index]
28
return Single_Part
29
30
elif isinstance( Input , slice ) :
31
Slice = Input
32
New_Constituent_Parts = self.Constituent_Parts()[Slice]
33
if len(New_Constituent_Parts) == _sage_const_0 :
34
return None
35
elif len(New_Constituent_Parts) == _sage_const_1 :
36
Single_Part = New_Constituent_Parts[_sage_const_0 ]
37
return Single_Part
38
else :
39
return self.__class__( New_Constituent_Parts )
40
41
else :
42
raise ValueError('The variable ``Input`` is inappropriate.')
43
44
45
def __ne__ ( self , other:"Structure" ) -> bool :
46
"""Tests if two objects do not coincide."""
47
return not self == other
48
49
50
def Is_Irreducible ( self ) -> bool :
51
"""Tests if ``self`` is irreducible/ simple."""
52
return len(self) == _sage_const_1
53
54
55
def Is_Not_Trivial ( self ) -> bool :
56
"""Tests if ``self`` is not trivial."""
57
return not self.Is_Trivial()
58
59
60
def Is_Reducible ( self ) -> bool :
61
"""Tests if ``self`` is reducible/ non-simple, i.e. it is trivial/ zero or consists of multiple summands/ components."""
62
return not self.Is_Irreducible()
63
64
65
# Synonyms for the method ``Is_Irreducible``
66
def Is_Simple ( self ) -> bool :
67
"""Tests if ``self`` is irreducible/ simple, i.e. consists only of a single summand/ component."""
68
return self.Is_Irreducible()
69
70
71
def Is_Trivial ( self ) -> bool :
72
"""Tests if ``self`` has no components."""
73
return len(self) == _sage_const_0
74
75
76
77
class Irreducible_Structure ( Structure ) :
78
79
def __iter__ ( self ) -> Iterator[ "Irreducible_Structure" ] :
80
"""Returns an iterator of ``self``."""
81
yield self
82
83
84
def __len__ ( self ) -> int :
85
"""Returns the number of components of ``self``."""
86
return _sage_const_1
87
88
89
def Constituent_Parts ( self ) -> list[ "Irreducible_Structure" ] :
90
"""Returns ``self`` in a list ."""
91
return [ self ]
92
93
94
def Irreducible_Components ( self ) -> Iterator[ "Irreducible_Structure" ] :
95
"""Returns ``self``."""
96
yield self
97
98
99
100
class Direct_Sum_Of_Structures ( Structure ) :
101
102
def __eq__ ( self , other:"Direct_Sum_Of_Structures" ) -> bool :
103
"""Tests if two objects of the class ``Direct_Sum_Of_Structures`` coincide."""
104
if type( other ) == self.__class__ :
105
if len( other ) == len( self ) :
106
107
Remaining_Summands = other.Summands()
108
for Summand in self.Summands() :
109
try : Remaining_Summands.remove( Summand )
110
except : return False
111
112
if len( Remaining_Summands ) == _sage_const_0 : return True
113
114
else : return False
115
else : return False
116
else : return False
117
118
119
def __iter__ ( self ) -> Iterator[ Structure ] :
120
"""Returns an iterator of ``self``."""
121
for Summand in self.Summands() :
122
yield Summand
123
124
125
def __len__ ( self ) -> int :
126
"""Returns the number of components of ``self``."""
127
return len( self.Summands() )
128
129
130
def Constituent_Parts ( self ) -> list[ Structure ] :
131
"""Returns the summands of ``self`` as list."""
132
return self.Summands()
133
134
135
def Irreducible_Components ( self ) -> Iterator[ Irreducible_Structure ] :
136
"""Returns the irreducible components of ``self`` as list."""
137
for Summand in self.Summands() :
138
for Irreducible_Component in Summand.Irreducible_Components() :
139
yield Irreducible_Component
140
141
142
def Summands ( self ) -> list[ Structure ] :
143
"""Returns the attribute ``_Summands``."""
144
return self._Summands
145
146
147
148
class Extension_Of_Structures ( Structure ) :
149
150
def __iter__ ( self ) -> Iterator[ Structure ] :
151
"""Returns an iterator of ``self``."""
152
for Part in self.Constituent_Parts() :
153
yield Part
154
155
156
def __len__ ( self ) -> int :
157
"""Returns the number of constituent parts of ``self``."""
158
return _sage_const_2
159
160
161
def Constituent_Parts ( self ) -> "Extension_Of_Structures" :
162
"""Returns the summands of ``self`` as list."""
163
return [ self ]
164
165
166
def Irreducible_Components ( self ) -> Iterator[ Irreducible_Structure ] :
167
"""Returns the attribute ``_Components``."""
168
for Component in [ self.Quotient() , self.Subobject() ] :
169
for Irreducible_Component in Component.Irreducible_Components() :
170
yield Irreducible_Component
171
172
173
def Quotient ( self ) -> Structure :
174
"""Returns the attribute ``_Quotient``."""
175
return self._Quotient
176
177
178
def Subobject ( self ) -> Structure :
179
"""Returns the attribute ``_Subobject``."""
180
return self._Subobject
181
182
183
184
185