@@ -83,11 +83,6 @@ def __init__(self, R):
83
83
cat = Algebras (R ).Commutative ().WithBasis ()
84
84
Parent .__init__ (self , base = R , category = cat .WithRealizations ())
85
85
86
- S = self .S ()
87
- B = self .B ()
88
- B .module_morphism (S ._from_binomial_basis , codomain = S ).register_as_coercion ()
89
- S .module_morphism (B ._from_shifted_basis , codomain = B ).register_as_coercion ()
90
-
91
86
_shorthands = ["B" , "S" ]
92
87
93
88
def _repr_ (self ) -> str :
@@ -555,6 +550,11 @@ def _element_constructor_(self, x):
555
550
if P is not self .base_ring ():
556
551
return self .element_class (self , x .monomial_coefficients ())
557
552
553
+ if isinstance (P , IntegerValuedPolynomialRing .Binomial ):
554
+ phi = P .module_morphism (self ._from_binomial_basis ,
555
+ codomain = self )
556
+ return phi (x )
557
+
558
558
# ok, not a integer-valued polynomial ring element
559
559
R = self .base_ring ()
560
560
# coercion via base ring
@@ -655,6 +655,8 @@ def _coerce_map_from_(self, R):
655
655
# that coerces in:
656
656
if isinstance (R , IntegerValuedPolynomialRing .Shifted ):
657
657
return self .base_ring ().has_coerce_map_from (R .base_ring ())
658
+ if isinstance (R , IntegerValuedPolynomialRing .Binomial ):
659
+ return self .base_ring ().has_coerce_map_from (R .base_ring ())
658
660
return self .base_ring ().has_coerce_map_from (R )
659
661
660
662
def _poly (self , i ):
@@ -991,6 +993,11 @@ def _element_constructor_(self, x):
991
993
if P is not self .base_ring ():
992
994
return self .element_class (self , x .monomial_coefficients ())
993
995
996
+ if isinstance (P , IntegerValuedPolynomialRing .Shifted ):
997
+ psi = P .module_morphism (self ._from_shifted_basis ,
998
+ codomain = self )
999
+ return psi (x )
1000
+
994
1001
# ok, not a integer-valued polynomial ring element
995
1002
R = self .base_ring ()
996
1003
# coercion via base ring
@@ -1087,6 +1094,8 @@ def _coerce_map_from_(self, R):
1087
1094
# that coerces in:
1088
1095
if isinstance (R , IntegerValuedPolynomialRing .Binomial ):
1089
1096
return self .base_ring ().has_coerce_map_from (R .base_ring ())
1097
+ if isinstance (R , IntegerValuedPolynomialRing .Shifted ):
1098
+ return self .base_ring ().has_coerce_map_from (R .base_ring ())
1090
1099
return self .base_ring ().has_coerce_map_from (R )
1091
1100
1092
1101
def _poly (self , i ):
0 commit comments