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.Mon, 23 May 2016 19:17:44 +0200Pass a list of variable names as parameter to a polynomial ringhttps://ask.sagemath.org/question/33526/pass-a-list-of-variable-names-as-parameter-to-a-polynomial-ring/ I am trying to write a function that compute a vector space basis $B$ for the quotient ring $k[x_1,\dots,x_n]/I$. I want to make the list of variables as the input parameter.
I tried this:
var("x,y")
Vlist=[x,y]
P.<Vlist>=PolynomialRing(QQ,order='degrevlex')
f=x^2+y^3
f.lm()
It gave me error message. I also tried
Vlist=['x,y']
or
Vlist=["x,y"]
None of them works.
I know that
P.<x,y>=PolynomialRing(QQ,order='degrevlex')
f=x^2+y^3
f.lm()
works. So I can just type this before I run my function. But is there a way that I can make this as input of the function?KittyLMon, 23 May 2016 19:17:44 +0200https://ask.sagemath.org/question/33526/Specifying names of variables in output of self.coordinate_ring()https://ask.sagemath.org/question/32524/specifying-names-of-variables-in-output-of-selfcoordinate_ring/Let
E = EllipticCurve([1,2,3,4,5])
Then E.coordinate_ring() outputs a ring with generators.
E.coordinate_ring().gens()
yields
(xbar,ybar,zbar)
Is there a way to change the names of these variables at any point in this process?
EDIT
The goal is to have sage treat the underlying rings to be treated as unique objects. Currently if I execute
E1 = EllipticCurve([1,2,3,4,5]).coordinate_ring()
E1._names = ('a','b','c')
E2 = EllipticCurve([1,2,3,4,5]).coordinate_ring()
E2._names =('l','m','n')
E1;E2
I get
Quotient of Multivariate Polynomial Ring in x, y, z over Rational Field by the ideal (-x^3 - 2*x^2*z + x*y*z + y^2*z - 4*x*z^2 + 3*y*z^2 - 5*z^3)
Quotient of Multivariate Polynomial Ring in x, y, z over Rational Field by the ideal (-x^3 - 2*x^2*z + x*y*z + y^2*z - 4*x*z^2 + 3*y*z^2 - 5*z^3)
(An indication that the rings are "the same":
E1sing = E1._singular_()
E2sing = E2._singular_()
ProdE1E2sing = singular.ringtensor(E1sing,E2sing);
ProdE1E2.sage()
gives
Quotient of Multivariate Polynomial Ring in x, y, z over Rational Field by the ideal (-x^3 - 2*x^2*z + x*y*z + y^2*z - 4*x*z^2 + 3*y*z^2 - 5*z^3)
whereas there should be 6 variables if the two rings were unique.)
---
Note: I have also tried to change the _gens, as well as injecting variables at every stage, but all with the same outcome.admiraltsoThu, 11 Feb 2016 06:18:32 +0100https://ask.sagemath.org/question/32524/