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
galois_closure()
seems to be what I was looking for, so you can make it an answer, even though it's not completely general. I know only need to find out how things work further, but manuals should help with that. – yo' Nov 18 '13 at 22:15