Ask Your Question

david marquis's profile - activity

2021-01-14 22:59:10 +0200 received badge  Supporter (source)
2021-01-14 22:59:08 +0200 received badge  Scholar (source)
2021-01-14 03:01:56 +0200 received badge  Student (source)
2021-01-14 01:28:46 +0200 received badge  Editor (source)
2021-01-13 22:24:28 +0200 asked a question Converting multivariable polynomial with complex coefficients to a polynomial with integer coefficients

If we make a polynomial involving $\sqrt{-2}$ like this

X = PolynomialRing(CC, names='X').gen()
r0 = (X**2 + 2).roots()[0][0]
A,B = PolynomialRing(CC, 2, names='A,B').gens()
poly = (A + B + r0)*(A + B - r0)

we get $poly = A^2 + 2.00AB + B^2 + 2.00.$

How can this be changed into a polynomial with integer coefficients ?

If we had a univariate polynomial we could do this by mapping list(poly) to a list of integers and then defining a new polynomial with those. But this approach can't be translated directly to multivariable polynomials.