In order to use Hecke, it needs loading:
using Hecke
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$
Qx, x = FlintQQ["x"]
k, a = number_field(x^2-10)
To extend further, we need polynomials over $k$, then we can define an extension.
kt,t = k["t"]
K, b = number_field(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$.
Ka, m1, m2 = absolute_field(K)
To check that $m_2$ is indeed the embedding, we veryify $m_2(a)^2 = 10$:
m2(a)
ans^2
Given that we did not assign a name to the primitive element of $K_a$ it is printed generically:
preimage(m1, b)
Checking that is still satisfies the equation for $b$:
ans^3-m2(a)*ans+m2(a)
and some invariants..
norm(b), discriminant(K), norm(b, FlintQQ)
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.
k, g = number_field([x^2-3, x^2-5, x^2-7])
g[1]^2
[x^2 for x = basis(k)]
Similar to above, we can convert to a primitive representation:
ks, ms = simple_extension(k)
ms\g[1]
ans^2