Hello,

A friend of mine wanted to know all the conjugates of a particular
algebraic number, and I was trying to figure out the right way of
finding them with Sage. Sorry if this is too trivial a question.

This is what I tried:

    sage: t = sqrt(2-sqrt(2)) + i*sqrt(sqrt(2)-1)
    sage: p = t.minpoly(); p
    x^8 - 12*x^6 + 6*x^4 - 12*x^2 + 1
    sage: K.<a> = NumberField(p)
    sage: a.galois_conjugates(K)
    [a, -a, a^7 - 12*a^5 + 6*a^3 - 12*a, -a^7 + 12*a^5 - 6*a^3 + 12*a]

I copied this result into a text editor to replace 'a' with 'x', then
did

    sage: ts = [q(t).exp_simplify() for q in [x, -x, x^7 - 12*x^5 +
6*x^3 - 12*x, -x^7 + 12*x^5 - 6*x^3 + 12*x]]; ts
    [sqrt(sqrt(2) - 1)*I + sqrt(2 - sqrt(2)),
     -sqrt(sqrt(2) - 1)*I - sqrt(2 - sqrt(2)),
     sqrt(sqrt(2) - 1)*I - sqrt(2 - sqrt(2)),
     sqrt(2 - sqrt(2)) - sqrt(sqrt(2) - 1)*I]

which are indeed conjugates, so it's good. But what about the other 4
roots? I guess the problem is that NumberField(p) is not big enough to
contain all the conjugates. Trying

    sage: a.galois_conjugates(CC)

does give all 8 conjugates, but in decimal numbers, not in terms of
radicals, while one can get all 8 by using:

    sage: a.galois_conjugates(QQ[t,i])
    [a^7 + (-12)*a^5 + 6*a^3 + (-12)*a,
     (-1/8*I - 3/8)*a^7 + (11/8*I + 35/8)*a^5 + (5/8*I - 5/8)*a^3 +
(17/8*I + 21/8)*a,
     (1/8*I - 3/8)*a^7 + (-11/8*I + 35/8)*a^5 + (-5/8*I - 5/8)*a^3 +
(-17/8*I + 21/8)*a,
     (-1)*a,
     a,
     (-1/8*I + 3/8)*a^7 + (11/8*I - 35/8)*a^5 + (5/8*I + 5/8)*a^3 +
(17/8*I - 21/8)*a,
     (1/8*I + 3/8)*a^7 + (-11/8*I - 35/8)*a^5 + (-5/8*I + 5/8)*a^3 +
(-17/8*I - 21/8)*a,
     (-1)*a^7 + 12*a^5 + (-6)*a^3 + 12*a]

after which replacing the 'a's with 'x' and pasting it back as above
gives all the conjugates:

    sage: ts = [q(t).exp_simplify() for q in (--replaced expression,
snipped--) ]; ts

    [sqrt(sqrt(2) - 1)*I - sqrt(2 - sqrt(2)),
     (-sqrt(2) - 1)*sqrt(sqrt(2) - 1) + (-sqrt(2) - 1)*sqrt(2 - sqrt
(2)),
     sqrt(sqrt(2) - 1)*(sqrt(2) + 1) + (-sqrt(2) - 1)*sqrt(2 - sqrt
(2)),
     -sqrt(sqrt(2) - 1)*I - sqrt(2 - sqrt(2)),
     sqrt(sqrt(2) - 1)*I + sqrt(2 - sqrt(2)),
     sqrt(2 - sqrt(2))*(sqrt(2) + 1) + (-sqrt(2) - 1)*sqrt(sqrt(2) -
1),
     sqrt(sqrt(2) - 1)*(sqrt(2) + 1) + sqrt(2 - sqrt(2))*(sqrt(2) +
1),
     sqrt(2 - sqrt(2)) - sqrt(sqrt(2) - 1)*I]

So Sage completely helped with the question, which is great. :-)

My question is whether there is a better way to do this. In
particular:

1. Is there a way to avoid manually replacing 'a' with 'x' as above?
2. Here, K=NumberField(p) was not a big enough field, but K[i] was. Is
it possible to automatically choose an appropriately big field? [I
tried a.galois_conjugates(K.galois_closure('a1')) as in the
documentation, but wasn't sure how to interpret the result.]
3. It seems that while p.roots() returns an empty list and
p.complex_roots() returns the roots in decimals,

    sage: (x^8 - 12*x^6 + 6*x^4 - 12*x^2 + 1).roots()

does find all roots, in terms of radicals. So might it be possible to
write a conjugates() function in cases where the polynomial *can* be
solved with radicals?
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to