Ask Your Question

Revision history [back]

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 + 1jy sage: f x + 1.00000000000000I*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.00000000000000Iy 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)

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 + 1jy
    1j*y
    sage: f
    x + 1.00000000000000I*y
    1.00000000000000*I*y
    sage: f.parent()
    Multivariate Polynomial Ring in x, y over Complex Field with 53 bits of precision

    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.00000000000000Iy
    1.00000000000000*I*y
    sage: f.parent()
    Multivariate Polynomial Ring in x, y over Complex Field with 53 bits of precision

    precision

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

sage: span([f], R)