File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -3065,23 +3065,32 @@ def q(self):
3065
3065
"""
3066
3066
return self ._q
3067
3067
3068
- def _coerce_start (self , x ):
3068
+ def _element_constructor_ (self , x ):
3069
3069
"""
3070
3070
EXAMPLES::
3071
3071
3072
3072
sage: H3 = HeckeAlgebraSymmetricGroupT(QQ, 3)
3073
- sage: H3._coerce_start ([2,1])
3073
+ sage: H3([2,1]) # indirect doc test
3074
3074
T[2, 1, 3]
3075
+ sage: H3( SymmetricGroup(3).an_element() )
3076
+ [1, 3, 2]
3077
+ sage: H3( [2, 1] )
3075
3078
"""
3076
3079
###################################################
3077
3080
# Coerce permutations of size smaller that self.n #
3078
3081
###################################################
3079
3082
if not x :
3080
3083
return self .one ()
3081
- if len (x ) < self .n and x in Permutations ():
3082
- return self .monomial (self ._indices (list (x ) +
3083
- list (range (len (x ) + 1 ,
3084
- self .n + 1 ))))
3084
+ if x in Permutations ():
3085
+ if len (x ) < self .n :
3086
+ return self .monomial (self ._indices (
3087
+ list (x ) + list (range (len (x ) + 1 , self .n + 1 ))
3088
+ ))
3089
+ if all (x [i ] == i for i in range (self .n + 1 , len (x ))):
3090
+ return self .monomial (self ._indices (x [:self .n ]))
3091
+
3092
+ return self ._indices (x )
3093
+
3085
3094
raise TypeError
3086
3095
3087
3096
You can’t perform that action at this time.
0 commit comments