@@ -262,7 +262,7 @@ def gen(self, i=0):
262262 return self .algebra_generators ()[0 ]
263263
264264 @cached_method
265- def algebra_generators (self ):
265+ def algebra_generators (self ) -> Family :
266266 r"""
267267 Return the generators of this algebra.
268268
@@ -456,7 +456,7 @@ class Shifted(CombinatorialFreeModule, BindableClass):
456456 sage: 1 - S[2] * S[2] / 2
457457 S[0] - 1/2*S[2] + 3*S[3] - 3*S[4]
458458 """
459- def __init__ (self , A ):
459+ def __init__ (self , A ) -> None :
460460 r"""
461461 Initialize ``self``.
462462
@@ -700,7 +700,7 @@ def _poly(self, i):
700700 sage: F._poly(4)
701701 1/24*x^4 + 5/12*x^3 + 35/24*x^2 + 25/12*x + 1
702702 """
703- x = polygen (QQ , 'x' )
703+ x = polygen (self . base_ring () , 'x' )
704704 return binomial (x + i , i )
705705
706706 class Element (CombinatorialFreeModule .Element ):
@@ -809,7 +809,7 @@ def derivative_at_minus_one(self):
809809 """
810810 return QQ .sum (c / QQ (i ) for i , c in self if i )
811811
812- def h_vector (self ):
812+ def h_vector (self ) -> vector :
813813 """
814814 Return the numerator of the generating series of values.
815815
@@ -828,7 +828,8 @@ def h_vector(self):
828828 d = max (self .support (), default = - 1 )
829829 m = matrix (QQ , d + 1 , d + 1 ,
830830 lambda j , i : (- 1 )** (d - j ) * (d - i ).binomial (d - j ))
831- v = vector (QQ , [self .coefficient (i ) for i in range (d + 1 )])
831+ v = vector (self .base_ring (),
832+ [self .coefficient (i ) for i in range (d + 1 )])
832833 return m * v
833834
834835 def h_polynomial (self ):
0 commit comments