ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Wed, 11 May 2022 11:14:24 +0200Replace coefficient to specific value on multivariate polynomialhttps://ask.sagemath.org/question/62393/replace-coefficient-to-specific-value-on-multivariate-polynomial/Hello,
I consider a multivariate polynomial ring F_p[t][x,y] with a univariate polynomial ring F_p[t] over a finite field F_p as a coefficient ring (p is prime number).
I want to generate polynomials as follows.
1. the degree of each coefficient of t is d
2. the terms of x and y are random except for the constant term
3. the constant term should have a specific value (e.g., the value obtained by substituting x=t, y=t^2 for the terms other than the constant term). I want to replace constant coefficient to them.
I have done so far. As follows,
p = 31
P.<t> = PolynomialRing(GF(p))
Q.<x,y> = PolynomialRing(P)
X = Q.random_element(degree = 2,terms = 6,choose_degree = True)
while len(list(X)) <= 5:
X = Q.random_element(degree = 2,terms = 6,choose_degree = True)
print(X)
But I can't make step 3. What should I do??yt_0429Wed, 11 May 2022 11:14:24 +0200https://ask.sagemath.org/question/62393/Roots of a Polynomial in a PolynomialRinghttps://ask.sagemath.org/question/43733/roots-of-a-polynomial-in-a-polynomialring/ If I do:
`R.<x,y>= PolynomialRing(QQ,2)`
`f=x^2-y^2`
`f.roots()`
Why it doesn't work?
And next code work:
`R.<x>= PolynomialRing(QQ)`
`f=x^2-1`
`f.roots()`
I don't understand why.
And one more things,
If I want to define all polinomials as this form -> a*x^2 - b*y^2 where $a$ and $b$ are constants.
Have I do this?
`R.<a,b,x,y>=PolynomialRing(QQ,4)`
`I=R.Ideal([a*x^2 - b*y^2])`
`f= 2*x^2 - 3*y^2`
How can I do that?
Thank you so much.ZacariasSatrusteguiSun, 23 Sep 2018 20:01:56 +0200https://ask.sagemath.org/question/43733/Lifting polynomialshttps://ask.sagemath.org/question/10591/lifting-polynomials/Hello!
I have this polynomial 'fp' that I'd lite to lift to ZZ. How do I go about doing something like this in Sage online?
Univariate Quotient Polynomial Ring in y over Ring of integers modulo 127 with modulus Y^23 + 126
fp=y^21 + 126*y^19 + y^17 + 126*y^16 + y^15 + y^14 + y^13 + y^12 + y^9 + 126*y^8 + 126*y^5 + 126*y^4 + 126*y^2 + 126*y + 1
Univariate Polynomial Ring in X over Integer Ring
Q.<X> = PolynomialRing(ZZ)
Best regards!ogwardSat, 05 Oct 2013 08:14:18 +0200https://ask.sagemath.org/question/10591/