Ask Your Question

Revision history [back]

number of arguments does not match number of variables in parent

Thanks a lot for your reading and help. I want to calculate one polynomial in 6 variables, arising from elliptic curves. I use two methods. These are my code.

1.

sage: R.<x, y,="" a1,="" a2,="" a3,="" a4="">= RationalField()[];R

Multivariate Polynomial Ring in x, y, a1, a2, a3, a4 over Rational Field

sage: a1(3x^2+2a2x+a4-a1y)(2y+a1x+a3)-(a2+2x)(2y+a1x+a3)^2+(3x^2+2a2x+a4-a1*y)^2


TypeError Traceback (most recent call last) <ipython-input-4-d31ceec0d0e8> in <module> ----> 1 a1(Integer(3)xInteger(2)+Integer(2)a2x+a4-a1y)(Integer(2)y+a1x+a3)-(a2+Integer(2)x)(Integer(2)y+a1x+a3)Integer(2)+(Integer(3)xInteger(2)+Integer(2)a2x+a4-a1*y)Integer(2)

/usr/lib/python3/dist-packages/sage/rings/polynomial/multi_polynomial_libsingular.pyx in sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular.__call__ (build/cythonized/sage/rings/polynomial/multi_polynomial_libsingular.cpp:20530)() 2116 2117 if l != parent._ring.N: -> 2118 raise TypeError("number of arguments does not match number of variables in parent") 2119 2120 try:

TypeError: number of arguments does not match number of variables in parent

2.

sage: PolynomialRing(RationalField(),6,'a')

Multivariate Polynomial Ring in a0, a1, a2, a3, a4, a5 over Rational Field

sage: a1(3a0^2+2a2a5+a4-a1a5)(2a5+a1a0+a3)-(a2+2a0)(2a5+a1a0+a3)^2+(3a0^2+2a2a0+a4-a1*a5)^2


NameError Traceback (most recent call last) <ipython-input-10-157192839bba> in <module> ----> 1 a1(Integer(3)a0Integer(2)+Integer(2)a2a5+a4-a1a5)(Integer(2)a5+a1a0+a3)-(a2+Integer(2)a0)(Integer(2)a5+a1a0+a3)Integer(2)+(Integer(3)a0Integer(2)+Integer(2)a2a0+a4-a1*a5)Integer(2)

NameError: name 'a0' is not defined

Could anyone tell me how to make it work? Thanks very much!

number of arguments does not match number of variables in parent

Thanks a lot for your reading and help. I want to calculate one polynomial in 6 variables, arising from elliptic curves. I use two methods. These are my code.

1.

sage: R.<x, y,="" a1,="" a2,="" a3,="" a4="">= RationalField()[];R

y, a1, a2, a3, a4>= RationalField()[];R Multivariate Polynomial Ring in x, y, a1, a2, a3, a4 over Rational Field

Field sage: a1(3x^2+2a2x+a4-a1y)(2y+a1x+a3)-(a2+2x)(2y+a1x+a3)^2+(3x^2+2a2x+a4-a1*y)^2


a1(3*x^2+2*a2*x+a4-a1*y)(2*y+a1*x+a3)-(a2+2*x)(2*y+a1*x+a3)^2+(3*x^2+2*a2*x+a4-a1*y)^2 ---------------------------------------------------------------------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-4-d31ceec0d0e8> in <module> ----> 1 a1(Integer(3)xInteger(2)+Integer(2)a2x+a4-a1y)(Integer(2)y+a1x+a3)-(a2+Integer(2)x)(Integer(2)y+a1x+a3)Integer(2)+(Integer(3)xInteger(2)+Integer(2)a2x+a4-a1*y)Integer(2)

a1(Integer(3)*x**Integer(2)+Integer(2)*a2*x+a4-a1*y)(Integer(2)*y+a1*x+a3)-(a2+Integer(2)*x)(Integer(2)*y+a1*x+a3)**Integer(2)+(Integer(3)*x**Integer(2)+Integer(2)*a2*x+a4-a1*y)**Integer(2) /usr/lib/python3/dist-packages/sage/rings/polynomial/multi_polynomial_libsingular.pyx in sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular.__call__ (build/cythonized/sage/rings/polynomial/multi_polynomial_libsingular.cpp:20530)() 2116 2117 if l != parent._ring.N: -> 2118 raise TypeError("number of arguments does not match number of variables in parent") 2119 2120 try:

try: TypeError: number of arguments does not match number of variables in parent

parent

2.

sage: PolynomialRing(RationalField(),6,'a')

PolynomialRing(RationalField(),6,'a') Multivariate Polynomial Ring in a0, a1, a2, a3, a4, a5 over Rational Field

Field sage: a1(3a0^2+2a2a5+a4-a1a5)(2a5+a1a0+a3)-(a2+2a0)(2a5+a1a0+a3)^2+(3a0^2+2a2a0+a4-a1*a5)^2


a1(3*a0^2+2*a2*a5+a4-a1*a5)(2*a5+a1*a0+a3)-(a2+2*a0)(2*a5+a1*a0+a3)^2+(3*a0^2+2*a2*a0+a4-a1*a5)^2 --------------------------------------------------------------------------- NameError Traceback (most recent call last) <ipython-input-10-157192839bba> in <module> ----> 1 a1(Integer(3)a0Integer(2)+Integer(2)a2a5+a4-a1a5)(Integer(2)a5+a1a0+a3)-(a2+Integer(2)a0)(Integer(2)a5+a1a0+a3)Integer(2)+(Integer(3)a0Integer(2)+Integer(2)a2a0+a4-a1*a5)Integer(2)

a1(Integer(3)*a0**Integer(2)+Integer(2)*a2*a5+a4-a1*a5)(Integer(2)*a5+a1*a0+a3)-(a2+Integer(2)*a0)(Integer(2)*a5+a1*a0+a3)**Integer(2)+(Integer(3)*a0**Integer(2)+Integer(2)*a2*a0+a4-a1*a5)**Integer(2) NameError: name 'a0' is not defined

defined

Could anyone tell me how to make it work? Thanks very much!

click to hide/show revision 3
retagged

number of arguments does not match number of variables in parent

Thanks a lot for your reading and help. I want to calculate one polynomial in 6 variables, arising from elliptic curves. I use two methods. These are my code.

1.

sage: R.<x, y, a1, a2, a3, a4>= RationalField()[];R

Multivariate Polynomial Ring in x, y, a1, a2, a3, a4 over Rational Field

sage: a1(3*x^2+2*a2*x+a4-a1*y)(2*y+a1*x+a3)-(a2+2*x)(2*y+a1*x+a3)^2+(3*x^2+2*a2*x+a4-a1*y)^2

----------------------------------------------------------------------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-4-d31ceec0d0e8> in <module>
----> 1 a1(Integer(3)*x**Integer(2)+Integer(2)*a2*x+a4-a1*y)(Integer(2)*y+a1*x+a3)-(a2+Integer(2)*x)(Integer(2)*y+a1*x+a3)**Integer(2)+(Integer(3)*x**Integer(2)+Integer(2)*a2*x+a4-a1*y)**Integer(2)

/usr/lib/python3/dist-packages/sage/rings/polynomial/multi_polynomial_libsingular.pyx in sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular.__call__ (build/cythonized/sage/rings/polynomial/multi_polynomial_libsingular.cpp:20530)()
   2116
   2117         if l != parent._ring.N:
-> 2118             raise TypeError("number of arguments does not match number of variables in parent")
   2119
   2120         try:

TypeError: number of arguments does not match number of variables in parent

2.

sage: PolynomialRing(RationalField(),6,'a')

Multivariate Polynomial Ring in a0, a1, a2, a3, a4, a5 over Rational Field

sage: a1(3*a0^2+2*a2*a5+a4-a1*a5)(2*a5+a1*a0+a3)-(a2+2*a0)(2*a5+a1*a0+a3)^2+(3*a0^2+2*a2*a0+a4-a1*a5)^2

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-10-157192839bba> in <module>
----> 1 a1(Integer(3)*a0**Integer(2)+Integer(2)*a2*a5+a4-a1*a5)(Integer(2)*a5+a1*a0+a3)-(a2+Integer(2)*a0)(Integer(2)*a5+a1*a0+a3)**Integer(2)+(Integer(3)*a0**Integer(2)+Integer(2)*a2*a0+a4-a1*a5)**Integer(2)

NameError: name 'a0' is not defined

Could anyone tell me how to make it work? Thanks very much!