# Real number field

Hello,

I have matrices of the following form: M = [[ sqrt(2), 1], [14, cos(pi/8)]].

All of the entries are totally real algebraic numbers. I would like to study the signature of the conjugates of M.

So basically, I would like to create a number field containing the two elements sqrt(2), cos(pi/8) and use the different embeddings into R (or C) to study the signature.

The following does not work: QQ[sqrt(2)][cos(pi/8)] because the minimal polynomial of cos(pi/8) is not irreducible over Q[sqrt(2)]. How can I get it to work?

I could compute it manually, but I would like to make the process automatic since the matrices are all of the above form (with expressions like sqrt(2), cos(pi/8) regardless of the fact that one can be written in terms of the other).

Olivier

edit retag close merge delete

Sort by » oldest newest most voted Well, there is a method "composite_fields" for number fields:

sage: x=polygen(QQ,'x')
sage: K1=NumberField(x*x-2,'a')
sage: K2=CyclotomicField(8,'b')
sage: K2.subfield(K2.gen()+K2.gen().conjugate())

(Number Field in b0 with defining polynomial x^2 - 2, Ring morphism:
From: Number Field in b0 with defining polynomial x^2 - 2
To:   Cyclotomic Field of order 8 and degree 4
Defn: b0 |--> -b^3 + b)

sage: K3=K2.subfield(K2.gen()+K2.gen().conjugate()); K3
Number Field in b0 with defining polynomial x^2 - 2
sage: K3.composite_fields(K1)
[Number Field in b0 with defining polynomial x^2 - 2]

more