Ask Your Question
1

Finding coefficients of complex polynomials [closed]

asked 2022-03-26 00:09:51 +0100

FKalker gravatar image

Hello,

I've found that the function coefficients() behaves differently when the coefficients of a polynomial are complex instead of real. For example:

sage: R.<x, y> = PolynomialRing(ZZ[I], 2) 
sage: F = 2*I*x*y + 3*x^2*y^3
sage: F.coefficients()
[[2*I*y, 1], [3*y^3, 2]]
sage: G = 2*x*y + 3*x^2*y^3
sage: G.coefficients()
[3, 2]

Also a similar thing happens with univariate polynomials over CC.

sage: S.<z> = PolynomialRing(CC)
sage: f = z^2 + z + I
sage: f.coefficients()
[[1.00000000000000*I, 0], [1.00000000000000, 1], [1.00000000000000, 2]]
sage: g = z^2 + z + 1
sage: g.coefficients()
[1.00000000000000, 1.00000000000000, 1.00000000000000]

Why is there this difference? How can I find a list of the coefficients like when the polynomials are purely real? This is in SageMath version 8.1, is it maybe the issue that this version is outdated?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by FKalker
close date 2022-03-26 00:22:22.737520

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-03-26 00:21:58 +0100

FKalker gravatar image

It is indeed the case that my sagemath version is outdated

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-03-26 00:04:25 +0100

Seen: 205 times

Last updated: Mar 26 '22