# imaginary unit and subspaces of the complex polynomial ring?

I am trying to work with the complex, multivariate polynomial ring R.<x,y> = CC['x,y']. When I try to create an element in my ring R f = x + I*y i get parent(f) is a symbolic ring and not R, which seems to happen due to the "I". Is there a way to interpret "I" as an element in my R?

Also if I have a long list "L" of elements in the ring "R" is there an easy way to define a real subspace of R (alternatively R could also be a real polynomial ring) spanned by the elements of L and to check whether a given polynomial f lies in this span?

edit retag close merge delete

Sort by » oldest newest most voted

Here are two ways to solve your first problem.

• use the Python version of the complex imaginary unit, 1j.

sage: R.<x,y> = CC['x,y']
sage:  f = x + 1j*y
sage: f
x + 1.00000000000000*I*y
sage: f.parent()
Multivariate Polynomial Ring in x, y over Complex Field with 53 bits of precision

• redefine I to be the imaginary unit in CC.

sage: I = CC.gen()
sage: I = CC.gen()
sage: f = x + I * y
sage: f
x + 1.00000000000000*I*y
sage: f.parent()
Multivariate Polynomial Ring in x, y over Complex Field with 53 bits of precision


Regarding your second problem, the following fails because R is not a principal ideal domain.

sage: span([f], R)

more