I have a polynomial, and I would like to make a number field in Sage that would contain all roots of this polynomial. I have tried the following code but it throws an error:
R.<X>=QQ['X']
p=X^3+X^2+X-1
# extract the complex roots of `p`
pRoots=p.complex_roots();
for x in pRoots:
if x.imag()>0.01:
gamma = x
if x.imag()<-0.01:
gammabar = x
# mathematically: `K = Q(gamma)`
K.<g> = NumberField(p, embedding=gamma)
# mathematically: `L = K(gammabar) = Q(gamma,gammabar)`
L.<gg> = K.extension(p, embedding=gammabar)
The error says:
NotImplementedError: Embeddings not implemented for relative number fields
I obviously need embeddings since the minimal polynomial is the same for both gamma and gammabar
I adapted the Sage commands from that Gmane thread and got these results from an online Sage notebook:
I also verified the irreducibility of the polynomial:
Note that the degree of the extension
Lover $\mathbb{Q}$ is six, and that since this is a splitting field forf, the Galois group ofLover $\mathbb{Q}$ is order 6 as well.While
fhas only rootainK(with multiplicity 1):we get three roots of
finL(each with multiplicity 1):I think there's freedom in identifying two of these with your $\gamma$ and $\overline{\gamma}$, but let me think about it more.