File tree Expand file tree Collapse file tree 1 file changed +37
-2
lines changed
src/sage/rings/polynomial Expand file tree Collapse file tree 1 file changed +37
-2
lines changed Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ def from_polynomial(self, p):
188
188
"""
189
189
Convert a polynomial into the ring of integer-valued polynomials.
190
190
191
- This raises a `` ValueError` ` if this is not possible.
191
+ This raises a :class:` ValueError` if this is not possible.
192
192
193
193
INPUT:
194
194
@@ -1174,6 +1174,41 @@ def _poly(self, i):
1174
1174
return binomial (x , i )
1175
1175
1176
1176
class Element (CombinatorialFreeModule .Element ):
1177
- pass
1177
+ def variable_shift (self , k = 1 ):
1178
+ r"""
1179
+ Return the image by the shift of variables.
1180
+
1181
+ On polynomials, the action is the shift
1182
+ on variables `x \mapsto x + k`.
1183
+
1184
+ INPUT:
1185
+
1186
+ - `k` -- integer (default: 1)
1187
+
1188
+ EXAMPLES::
1189
+
1190
+ sage: A = IntegerValuedPolynomialRing(ZZ).B()
1191
+ sage: B = A.basis()
1192
+ sage: B[5].variable_shift()
1193
+ B[4] + B[5]
1194
+ sage: B[5].variable_shift(-1)
1195
+ -B[0] + B[1] - B[2] + B[3] - B[4] + B[5]
1196
+
1197
+ TESTS::
1198
+
1199
+ sage: B[5].variable_shift(0)
1200
+ B[5]
1201
+ sage: B[5].variable_shift().variable_shift(-1)
1202
+ B[5]
1203
+ """
1204
+ if k == 0 :
1205
+ return self
1206
+ A = self .parent ()
1207
+
1208
+ def on_basis (n ):
1209
+ return A ._from_dict ({A ._indices (j ): binomial (k , n - j )
1210
+ for j in range (n + 1 )})
1211
+
1212
+ return A .module_morphism (on_basis , codomain = A )(self )
1178
1213
1179
1214
B = Binomial
You can’t perform that action at this time.
0 commit comments