Ask Your Question
2

multivariate polynomial ring over complex numbers

asked 2016-09-02 19:33:45 +0100

nebuckandazzer gravatar image

updated 2023-01-10 00:01:06 +0100

tmonteil gravatar image

I want to factorize bivariate polynomials over C. For single variable case we do this as follow:

R=CC[x]
x=R.gen()
f=x^2+1
f.factor()

How to do this for multivariate case ?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
4

answered 2016-09-03 12:36:43 +0100

tmonteil gravatar image

updated 2021-07-29 14:59:40 +0100

It seems not implemented on the floating-point complex numbers, nor on the complex algebraic numbers:

sage: R.<x,y> = CC[]
sage: P = x^2-y^2
sage: P.factor()
NotImplementedError: proof = True factorization not implemented.  Call factor with proof=False.
sage: P.factor(proof=False)
TypeError: Singular error:
   ? not implemented
   ? error occurred in or before STDIN line 26: `def sage12=factorize(sage11);`

sage: R.<x,y> = CDF[]
sage: P = x^2-y^2
sage: P.factor(proof=False)
NotImplementedError:

sage: R.<x,y> = QQbar[]
sage: P = x^2-y^2
sage: P.factor(proof=False)
TypeError: no conversion of this ring to a Singular ring defined

However, it is implemented for multivariate polynomials with integer or rational coefficients:

sage: R.<x,y> = ZZ[]
sage: P = x^2-y^2
sage: P.factor()
(x - y) * (x + y)

But note that the factorization is done with respect to the given ring, so you will get:

sage: P = x^2+1
sage: P.factor()
x^2 + 1

EDIT (July 2021)

Now, the factorization works on the field of algebraic numbers:

sage: R.<x,y> = QQbar[]
sage: P = x^2-y^2
sage: P.factor()
(x - y) * (x + y)

sage: P = x^2 + y^2
sage: P.factor()
(x + (-1*I)*y) * (x + 1*I*y)

sage: R.<x,y> = QQbar[]
sage: P = x^2+1
sage: P.factor()
(x - 1*I) * (x + 1*I)

sage: P = x^2+x*y+y^2
sage: P.factor()
(x + (0.50000000000000000? - 0.866025403784439?*I)*y) * (x + (0.50000000000000000? + 0.866025403784439?*I)*y)

This issue was likely fixed by trac ticket 25390

edit flag offensive delete link more

Comments

Too bad that this is not possible. It would be nice to factorize x^2+y^2 or x^2+x*y+y^2 for example.

Thrash gravatar imageThrash ( 2017-08-14 19:13:24 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-09-02 19:33:45 +0100

Seen: 1,311 times

Last updated: Jul 29 '21