Absolute versus Relative Number Fields
(and source code -- how it works right now)
William Stein
Jan 15, 2016 (part 1)
Let's build a tower of number fields
Type
in a file term.term
or browse to that file on Github:
https://github.com/sagemath/sage/blob/master/src/sage/rings/number_field/number_field_element.pyx
I also put a copy of number_field_element.pyx in our lecture notes directory here. Also see the corresponding pxd file, which defines the *data* of a number field element.
In SMC you can select all text (in number_field_element.pyx), then type Control+Q to fold all code. This gives you a nice top-down view of the file.
Look at the file.
All number field elements are represented in terms of a single absolute polynomial over and a denominator using the NTL C++ number theory library.
This is simple, but it means that in some cases arithmetic can be stupidly slow compared to Magma (and in others, very fast).
The structure
method allows you to recover an explicit isomorphisms between and :
WARNING: use these morphisms! Do not get lazy and just try turning things into lists and converting them (copying and pasting). It'll lead to subtle bugs.