ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 19 Aug 2016 11:27:10 -0500Real number fieldhttp://ask.sagemath.org/question/34531/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).
Thank you for your help.
OlivierFri, 19 Aug 2016 07:05:17 -0500http://ask.sagemath.org/question/34531/real-number-field/Answer by FrédéricC for <p>Hello,</p>
<p>I have matrices of the following form: M = [[ sqrt(2), 1], [14, cos(pi/8)]]. </p>
<p>All of the entries are totally real algebraic numbers. I would like to study the signature of the conjugates of M. </p>
<p>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.</p>
<p>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?</p>
<p>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).</p>
<p>Thank you for your help.</p>
<p>Olivier</p>
http://ask.sagemath.org/question/34531/real-number-field/?answer=34534#post-id-34534Well, 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())[0]; 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]Fri, 19 Aug 2016 11:27:10 -0500http://ask.sagemath.org/question/34531/real-number-field/?answer=34534#post-id-34534