Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Project: Math 582b
Views: 2495

Q\overline{\QQ}

William Stein

Jan 15, 2016 (part 0)

QQbar
Algebraic Field
# Also, there's $\overline{\QQ} \cap \RR$, since that's what you need for screensavers (seriously). AA
Algebraic Real Field

Documentation for Q\overline{\QQ}

QQbar?
File: /projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/rings/qqbar.py Signature : QQbar(self, x=0, *args, **kwds) Docstring : The field of all algebraic complex numbers.

Google for

sage reference manual QQbar

to find: http://doc.sagemath.org/html/en/reference/number_fields/sage/rings/qqbar.html
reset('x') v = (x^2 - 2).roots(ring=QQbar) print v
[(-1.414213562373095?, 1), (1.414213562373095?, 1)]
reset('x') v = ((x^2 - 2)^2).roots(ring=QQbar) print v
[(-1.414213562373095?, 2), (1.414213562373095?, 2)]
a = v[1][0] a
1.414213562373095?
a^2
2.000000000000000?
a^2 == 2
True
QQbar(sqrt(2)) == a
True
b = QQbar(sqrt(2)) + QQbar(sqrt(-1)) b
1.414213562373095? + 1*I
b.minpoly()
x^4 - 2*x^2 + 9
show(b.minpoly().roots(SR))
[(2i2+1\displaystyle -\sqrt{2 i \, \sqrt{2} + 1}, 1\displaystyle 1), (2i2+1\displaystyle \sqrt{2 i \, \sqrt{2} + 1}, 1\displaystyle 1), (2i2+1\displaystyle -\sqrt{-2 i \, \sqrt{2} + 1}, 1\displaystyle 1), (2i2+1\displaystyle \sqrt{-2 i \, \sqrt{2} + 1}, 1\displaystyle 1)]
# Make number field generated by b: QQ[b]
Number Field in a with defining polynomial x^4 - 2*x^2 + 9
︠eeb35931-0197-4c4a-b999-ffd48b37cdf6︠ ︠e3971e41-4df9-48fe-a9d4-e7171525b612i︠ %md $\overline{\QQ}$ makes a lot of basic **arithmetic** questions involving algebraic numbers go from extremely tedious to extremely easy. **For Example:** Define $\zeta_5$ and $\zeta_7$ (so 5th and 7th) roots of unity in $\overline{\QQ}$, and then compute the minimal polynomial of their sum.

Q\overline{\QQ} makes a lot of basic arithmetic questions involving algebraic numbers go from extremely tedious to extremely easy.

For Example: Define ζ5\zeta_5 and ζ7\zeta_7 (so 5th and 7th) roots of unity in Q\overline{\QQ}, and then compute the minimal polynomial of their sum.

a = QQbar.zeta(5); b = QQbar.zeta(7) a, b
(0.3090169943749474? + 0.9510565162951536?*I, 0.6234898018587335? + 0.7818314824680299?*I)
a+b
0.9325067962336810? + 1.732887998763184?*I
%time (a+b).minpoly()
x^24 + 10*x^23 + 54*x^22 + 208*x^21 + 637*x^20 + 1632*x^19 + 3585*x^18 + 6809*x^17 + 11108*x^16 + 15126*x^15 + 15914*x^14 + 10030*x^13 - 3306*x^12 - 18972*x^11 - 26900*x^10 - 20103*x^9 - 2236*x^8 + 13788*x^7 + 17332*x^6 + 10543*x^5 + 3306*x^4 + 331*x^3 - 35*x^2 - 12*x + 1 CPU time: 0.01 s, Wall time: 0.01 s

Exercise right now: Compute the minimal polynomial of ζ2+ζ3+ζ5+ζ7\zeta_2 + \zeta_3 + \zeta_5 + \zeta_7.

︠bc18efae-0eaa-49ff-92df-20619ffc7870︠ ︠e7863c83-dad5-4161-b033-3f575b850404︠ ︠dadc260f-dfb6-4e52-87ec-9fe2f7b25894︠ ︠1d7e4cd7-e4ea-4f82-8da0-c309db64a5a6i︠ %md ## Elliptic curves over $\overline{\QQ}$ Elliptic curves are genus one projective nonsingular curves with a distinguished rational point. They always (have an affine patch that can) be put in the form $y^2 = x^3 + Ax + B$. The set of all projective points over a field $F$ on an elliptic curve is an abelian group. Let's make point on an elliptic curve over $\overline{\QQ}$.

Elliptic curves over Q\overline{\QQ}

Elliptic curves are genus one projective nonsingular curves with a distinguished rational point.

They always (have an affine patch that can) be put in the form y2=x3+Ax+By^2 = x^3 + Ax + B. The set of all projective points over a field FF on an elliptic curve is an abelian group.

Let's make point on an elliptic curve over Q\overline{\QQ}.

E = EllipticCurve(QQ, [1,5]) show(E) E.rank()
y2=x3+x+5\displaystyle y^2 = x^{3} + x + 5
0
Ebar = E.change_ring(QQbar) Ebar
Elliptic Curve defined by y^2 = x^3 + x + 5 over Algebraic Field
P = Ebar.lift_x(4); P
(4 : 8.54400374531754? : 1)
P + P
(0.2226027397260274? : 2.287713519253134? : 1)
# Project: You could add this if you wanted; surely this point has infinite order... P.order()
Error in lines 2-2 Traceback (most recent call last): File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 905, in execute exec compile(block+'\n', '', 'single') in namespace, locals File "", line 1, in <module> File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/sage/schemes/elliptic_curves/ell_point.py", line 522, in order raise NotImplementedError("Computation of order of a point " NotImplementedError: Computation of order of a point not implemented over general fields.

Let's make some torsion points:

f3 = E.division_polynomial(3); f3
3*x^4 + 6*x^2 + 60*x - 1
# a 3-torsion point (lift_x gives point with given x coordinate) P3 = Ebar.lift_x(f3.roots(QQbar)[0][0]) P3
(-2.476162347303155? : 3.557872196485671?*I : 1)
P3 + P3
(-2.476162347303155? : -3.557872196485671?*I : 1)
P3 + P3 + P3
(0 : 1 : 0)
# a 5-torsion point f5 = E.division_polynomial(5); f5
5*x^12 + 62*x^10 + 1900*x^9 - 105*x^8 + 1200*x^7 - 6300*x^6 - 3480*x^5 - 48125*x^4 - 200400*x^3 - 6050*x^2 - 80500*x - 160799
# a 5-torsion point P5 = Ebar.lift_x(f5.roots(QQbar)[0][0]) P5
(-6.757553781121690? : 17.61641541648856?*I : 1)
P5 + P5 + P5 + P5
(-6.7575537811217? : -17.616415416489?*I : 1)
# takes a noticeable amount of time... P5 + P5 + P5 + P5 + P5
(0 : 1 : 0)

Exercise right now: Define the number field generated by the yy coordinate of P5P_5 above.

︠42377896-b7dc-4d07-9ceb-01463322a4fd︠ ︠fc5b32fa-1456-46ff-958b-7ec84dcc14e0︠ ︠aa440cd4-5abc-4833-aa76-1bb3fd99b013i︠ %md **Exercise right now:** Make another 5-torsion point that is **not** a multiple of P5 above and verify this.

Exercise right now: Make another 5-torsion point that is not a multiple of P5 above and verify this.

︠c154f9fb-1f0d-4947-a11d-01f98c6fa95a︠ ︠2e8c78ab-f21a-4dee-8593-2220d79c0331︠ ︠a6f498ed-acee-49b1-80ce-8bfbcef70f91i︠ %md **Number fields:** You can easily compute all embedings of any number field into $\overline{\QQ}$:

Number fields: You can easily compute all embedings of any number field into Q\overline{\QQ}:

reset('x') K.<a> = NumberField(x^3 + 5) K
Number Field in a with defining polynomial x^3 + 5
phi = K.embeddings(QQbar)
phi
[ Ring morphism: From: Number Field in a with defining polynomial x^3 + 5 To: Algebraic Field Defn: a |--> -1.709975946676697?, Ring morphism: From: Number Field in a with defining polynomial x^3 + 5 To: Algebraic Field Defn: a |--> 0.8549879733383485? - 1.480882609682365?*I, Ring morphism: From: Number Field in a with defining polynomial x^3 + 5 To: Algebraic Field Defn: a |--> 0.8549879733383485? + 1.480882609682365?*I ]
phi[0](a)
-1.709975946676697?
︠4fe98dde-5676-4967-abdc-dd571efdb8db︠ ︠82714925-d6b0-4142-8248-6c814c5d7dc3i︠ %md **Matrix algebra:** matrices work

Matrix algebra: matrices work

a = matrix(QQbar, 2, 2, [sqrt(2), 3^(1/5), sqrt(7), 1 + sqrt(5)]) a
[1.414213562373095? 1.245730939615518?] [2.645751311064591? 3.236067977499790?]
a.echelon_form()
[1.000000000000000? 0.?e-17] [ 0.?e-18 1.000000000000000?]
a.charpoly()
x^2 - 4.650281539872885?*x + 1.280596955819995?
a.trace()
4.650281539872885?
a^5
[ 432.6501885315129? 481.1093761693389?] [1021.8063325603541? 1136.262191138984?]

Linear algebra: even linear algebra works

b = matrix(QQbar, 2, 3, [sqrt(2), 3^(1/5),5, sqrt(7), 1 + sqrt(5), 7]) b
[1.414213562373095? 1.245730939615518? 5] [2.645751311064591? 3.236067977499790? 7]
b.row_space()
Vector space of degree 3 and dimension 2 over Algebraic Field Basis matrix: [ 1.000000000000000? 0.?e-17 5.825582574037417?] [ 0.?e-18 1.000000000000000? -2.599773178891782?]
b.right_kernel()
Vector space of degree 3 and dimension 1 over Algebraic Field Basis matrix: [ 1.000000000000000? -0.4462683595762699? -0.1716566518954946?]
v = b.right_kernel().basis()[0] v
(1.000000000000000?, -0.4462683595762699?, -0.1716566518954946?)
# HOWEVER! this takes a long time -- about a minute. v[1].minpoly()
x^40 + 85595232495330623520000/3959029936669492372081*x^38 - 1657952889063027055513191805321732125655997800/15673918039445244782432879269906644148270561*x^36 - 50374921243958209512529421690387090579491800000/15673918039445244782432879269906644148270561*x^34 + 333909027023449178625661263953661172131737073000/15673918039445244782432879269906644148270561*x^32 - 1773870088976677508645445072915352410344352427812/15673918039445244782432879269906644148270561*x^30 + 6096824399617277905290006622801097981450278920000/15673918039445244782432879269906644148270561*x^28 - 12981398069560541361776387153890283459643169681800/15673918039445244782432879269906644148270561*x^26 + 17847645938838057339954653367485752856198950950000/15673918039445244782432879269906644148270561*x^24 - 9636309801650557330312609178716006927121306517000/15673918039445244782432879269906644148270561*x^22 - 2513701495262357859654193716521651084052413456586/15673918039445244782432879269906644148270561*x^20 + 3604335859389114573353326907271909134885838240000/15673918039445244782432879269906644148270561*x^18 + 337351031463469446149698568034155703024087371400/15673918039445244782432879269906644148270561*x^16 - 315149646602436969079780531764186808729952100000/15673918039445244782432879269906644148270561*x^14 + 42699988047033648578469639649695816988450431000/15673918039445244782432879269906644148270561*x^12 - 4368172372250651966731064735274474512987222148/15673918039445244782432879269906644148270561*x^10 + 304252811905950229320124697621717257196760000/15673918039445244782432879269906644148270561*x^8 - 13998376078073597197966278327105188347637400/15673918039445244782432879269906644148270561*x^6 + 435643333998088819250891719461814101350000/15673918039445244782432879269906644148270561*x^4 - 7415099019413207131204815833832229611000/15673918039445244782432879269906644148270561*x^2 + 53680246747375952479747683856888021201/15673918039445244782432879269906644148270561 x^40 + 85595232495330623520000/3959029936669492372081*x^38 - 1657952889063027055513191805321732125655997800/15673918039445244782432879269906644148270561*x^36 - 50374921243958209512529421690387090579491800000/15673918039445244782432879269906644148270561*x^34 + 333909027023449178625661263953661172131737073000/15673918039445244782432879269906644148270561*x^32 - 1773870088976677508645445072915352410344352427812/15673918039445244782432879269906644148270561*x^30 + 6096824399617277905290006622801097981450278920000/15673918039445244782432879269906644148270561*x^28 - 12981398069560541361776387153890283459643169681800/15673918039445244782432879269906644148270561*x^26 + 17847645938838057339954653367485752856198950950000/15673918039445244782432879269906644148270561*x^24 - 9636309801650557330312609178716006927121306517000/15673918039445244782432879269906644148270561*x^22 - 2513701495262357859654193716521651084052413456586/15673918039445244782432879269906644148270561*x^20 + 3604335859389114573353326907271909134885838240000/15673918039445244782432879269906644148270561*x^18 + 337351031463469446149698568034155703024087371400/15673918039445244782432879269906644148270561*x^16 - 315149646602436969079780531764186808729952100000/15673918039445244782432879269906644148270561*x^14 + 42699988047033648578469639649695816988450431000/15673918039445244782432879269906644148270561*x^12 - 4368172372250651966731064735274474512987222148/15673918039445244782432879269906644148270561*x^10 + 304252811905950229320124697621717257196760000/15673918039445244782432879269906644148270561*x^8 - 13998376078073597197966278327105188347637400/15673918039445244782432879269906644148270561*x^6 + 435643333998088819250891719461814101350000/15673918039445244782432879269906644148270561*x^4 - 7415099019413207131204815833832229611000/15673918039445244782432879269906644148270561*x^2 + 53680246747375952479747683856888021201/15673918039445244782432879269906644148270561
50000/400.
125.000000000000
125*300
37500