In order to use Hecke, it needs loading:

In [1]:
using Hecke

Welcome to Nemo version 0.16.4-dev

Nemo comes with absolutely no warranty whatsoever

Welcome to

$\require{action}$
    _    _           _
| |  | |         | |
| |__| | ___  ___| | _____
|  __  |/ _ \/ __| |/ / _ \
| |  | |  __/ (__|   <  __/
|_|  |_|\___|\___|_|\_\___|

Version 0.7.3-dev ...
... which comes with absolutely no warranty whatsoever
(c) 2015-2019 by Claus Fieker, Tommy Hofmann and Carlo Sircana



Do define number fields, in general we need polynmials, so we define a polynomial ring, then a number field. $a$ will be the primitive element, hence a root of $x^2-10$

In [2]:
Qx, x = FlintQQ["x"]
k, a = number_field(x^2-10)

Out[2]:
($k$, $\alpha$)

To extend further, we need polynomials over $k$, then we can define an extension.

In [3]:
kt,t = k["t"]

Out[3]:
($kt$, $t$)
In [4]:
K, b = number_field(t^3-a*t+a+1)

Out[4]:
(Relative number field over
Number field over Rational Field with defining polynomial x^2-10
with defining polynomial t^3+(-_a)*t+(_a+1), _$) For many algorithm, finding a primitive element is important. The maps are the isomorphism between the relative and absolute fields and the embedding from$k$. In [5]: Ka, m1, m2 = absolute_field(K)  Out[5]: ($Ka$,$m1: Ka\to K$,$m2: k\to Ka$) To check that$m_2$is indeed the embedding, we veryify$m_2(a)^2 = 10$: In [6]: m2(a)  Out[6]:$-\frac{1}{2}x^{5} - \frac{1}{2}x^{4} - \frac{1}{2}x^{3} - \frac{1}{2}x^{2} + \frac{9}{2}x - \frac{11}{2}$In [7]: ans^2  Out[7]:$10$Given that we did not assign a name to the primitive element of$K_a$it is printed generically: In [17]: preimage(m1, b)  Out[17]:$x$Checking that is still satisfies the equation for$b$: In [18]: ans^3-m2(a)*ans+m2(a)  Out[18]:$-1$and some invariants.. In [10]: norm(b), discriminant(K), norm(b, FlintQQ)  Out[10]: ($-\alpha-1$,$-14\alpha-297$,$-9$) In addition to absolute and relative fields given via a polynomial (hence a primitive element) we also have {\em non-simple} fields, given via the roots of several polynomials. Note: the ideal defined by the polynomials needs to be maximal. This is not verified. In [11]: k, g = number_field([x^2-3, x^2-5, x^2-7])  Out[11]: (Non-simple number field with defining polynomials fmpq_mpoly[x1^2 - 3, x2^2 - 5, x3^2 - 7], NfAbsNSElem[_$1, _$2, _$3])
In [12]:
g[1]^2

Out[12]:
3
In [13]:
[x^2 for x = basis(k)]

Out[13]:
$[1, 3, 5, 15, 7, 21, 35, 105]$

Similar to above, we can convert to a primitive representation:

In [14]:
ks, ms = simple_extension(k)

Out[14]:
($ks$, $ms: ks\to k$)
In [15]:
ms\g[1]

Out[15]:
$\frac{3}{7552}\alpha^{7} - \frac{121}{7552}\alpha^{5} - \frac{663}{7552}\alpha^{3} + \frac{11405}{7552}\alpha$
In [16]:
ans^2

Out[16]:
$3$