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.Tue, 21 Jul 2020 10:46:56 +0200how to get the coefficient of a multivariate polynomial with respect to a specific variable and degree, in a quotient ring ?https://ask.sagemath.org/question/52594/how-to-get-the-coefficient-of-a-multivariate-polynomial-with-respect-to-a-specific-variable-and-degree-in-a-quotient-ring/Here is what I tried.
sage: F = ZZ.quo(3*ZZ); F
sage: A.<X, Y, Z> = PolynomialRing(F); A
sage: R.<x, y, z> = A.quotient(ideal(X^2 - 1, Y^2 - 1, Z^2 - 1))
sage: f = x*z + x*y*z + y + 1
sage: f.coefficient(z, 1)
sage: f.coefficient({z: 1})
sage: f.coeffcient(z)andriamTue, 21 Jul 2020 10:46:56 +0200https://ask.sagemath.org/question/52594/get the coefficients of polynomial of several variables?https://ask.sagemath.org/question/41526/get-the-coefficients-of-polynomial-of-several-variables/ Consider that I have a polynomial with n variables x1,x2,...,xn and want to get the coefficient of that polynomial. For example I can have:
x1+2*x1*x5^2+3*x1^2*x4-5*x2*x5^2+1/2*x2*x3+x6^2*x7*x8+9*x3*x9^3
I would like to ask Sage to give coefficient for the polynomial with variables x1..x9 and the result should be something like this:
coefficient,(exponent of x1..x9);
1,(1,0,0,0,0,0,0,0,0);
2,(1,0,0,0,2,0,0,0,0);
3,(2,0,0,1,0,0,0,0,0);
-5,(0,1,0,0,2,0,0,0,0);
1/2,(0,1,1,0,0,0,0,0,0);
1,(0,0,0,0,0,2,1,1);
9,(0,0,1,0,0,0,0,0,3)
How can I achieve this?
DanialBaghWed, 14 Mar 2018 03:12:52 +0100https://ask.sagemath.org/question/41526/