%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%
%A  numfield.tex                GAP documentation               Thomas Breuer
%%
%A  @(#)$Id: numfield.tex,v 3.13 1993/02/19 10:48:42 gap Rel $
%%
%Y  Copyright 1990-1992,  Lehrstuhl D fuer Mathematik,  RWTH Aachen,  Germany
%%
%%  This file contains descriptions of number fields in \GAP, that is,
%%  fields whose elements are cyclotomics (see "cyclotom.tex").
%%
%H  $Log: numfield.tex,v $
%H  Revision 3.13  1993/02/19  10:48:42  gap
%H  adjustments in line length and spelling
%H
%H  Revision 3.12  1993/02/12  15:56:02  felsch
%H  examples adjusted to line length 72
%H
%H  Revision 3.11  1993/02/01  13:43:17  felsch
%H  examples fixed
%H
%H  Revision 3.10  1993/01/18  09:52:38  sam
%H  adjusted some examples
%H
%H  Revision 3.9  1992/12/28  16:16:05  sam
%H  fixed typo
%H
%H  Revision 3.8  1992/04/30  12:13:19  martin
%H  changed a few sentences to avoid bold non-roman fonts
%H
%H  Revision 3.7  1992/04/07  23:05:55  martin
%H  changed the author line
%H
%H  Revision 3.6  1992/03/27  18:17:31  sam
%H  adjusted reference
%H
%H  Revision 3.5  1992/03/27  14:10:36  sam
%H  removed "'" in index entries
%H
%H  Revision 3.4  1992/03/11  15:44:04  sam
%H  renamed the chapter
%H
%H  Revision 3.3  1992/02/13  15:42:44  sam
%H  added documentation of 'GaloisGroup'
%H
%H  Revision 3.2  1992/01/14  14:04:20  sam
%H  adjusted citations
%H
%H  Revision 3.1  1991/12/30  08:08:51  sam
%H  initial revision under RCS
%H
%%
\Chapter{Subfields of Cyclotomic Fields}

The only *number fields* that {\GAP} can handle at the moment are
subfields of cyclotomic fields, e.g., $Q(\sqrt{5})$ is a number field
that is not cyclotomic but contained in the cyclotomic field
$Q_5 = Q(e^{\frac{2\pi i}{5}})$.  Although this means that {\GAP} does
not know arbitrary algebraic number fields but only those with abelian
Galois group, here we call these fields *number fields* for short.
The elements of number fields are called *cyclotomics* (see chapter
"Cyclotomics").  Thus number fields are the domains (see chapter
"Domains") related to cyclotomics; they are special field records (see
"Field Records") which are needed to specify the field extension with
respect to which e.g.\ the trace of a cyclotomic shall be computed.

In many situations cyclotomic fields need not be treated in  a special
way, except that there  may be more efficient algorithms for them than
for arbitrary number fields.  For that, there are the global variables
'NumberFieldOps' and 'CyclotomicFieldOps',  both records which contain
the field  operations stored in 'FieldOps' (see chapter "Fields")  and
in which some functions are overlaid (see "Domain Functions for Number
Fields").  If all necessary  information  about a function is  already
given  in chapter "Fields", this function is  not described here; this
is the case e.g.\ for 'Conjugates' and related functions, like 'Trace'
and  'CharPol'.  Some functions,  however,  need  further explanation,
e.g., "Coefficients for Number Fields" tells more about 'Coefficients'
for number fields.

There are some functions which are different for cyclotomic fields and
other number fields, e.g., the field constructors 'CF' resp.\ 'NF'.  In
such a situation, the special case is described in a section immediately
following the section about the general case.

Besides the single number fields, there is another domain in {\GAP}
related to number fields, the domain 'Cyclotomics' of all cyclotomics.
Although this is an abstract field, namely the field $Q^{ab}$,
'Cyclotomics' is not a field record.  It is used by 'DefaultField',
'DefaultRing', 'Domain', 'Field' and 'Ring' (see "DefaultField",
"DefaultRing", "Domain", "Field", "Ring") which are mainly interested in
the corresponding entries of 'Cyclotomics.operations' since these
functions know how to create fields resp.\ integral rings generated by
some cyclotomics.

This chapter informs about:\\
   characteristic functions (see "IsNumberField", "IsCyclotomicField"),\\
   field constructors (see "Number Field Records",
       "Cyclotomic Field Records"),\\
   (default) fields of cyclotomics
       (see "DefaultField and Field for Cyclotomics"),
       and (default) rings of cyclotomic integers
       (see "DefaultRing and Ring for Cyclotomic Integers"),\\
   Galois groups of number fields (see "GeneratorsPrimeResidues",
       "GaloisGroup for Number Fields"),\\
   vector space bases (see "ZumbroichBase",
       "Integral Bases for Number Fields", "NormalBaseNumberField") and
       coefficients (see "Coefficients for Number Fields") and\\
   overlaid functions in the operations records
       (see "Domain Functions for Number Fields").

The external functions are in the file 'LIBNAME/\"numfield.g\"'

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{IsNumberField}\index{test!for number field}

'IsNumberField( <obj> )'

returns 'true' if <obj> is a field record (see "IsField", "Field
Records") of a field of characteristic zero where '<F>.generators' is a
list of cyclotomics (see chapter "Cyclotomics"), and 'false' else.

|    gap> IsNumberField( CF(9) ); IsNumberField( NF( [ ER(3) ] ) );
    true
    true
    gap> IsNumberField( GF( 2 ) );
    false|

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{IsCyclotomicField}\index{test!for a cyclotomic field}

'IsCyclotomicField( <obj> )'

returns 'true' if <obj> is a number field record (see "IsNumberField")
where '<obj>.isCyclotomicField = true', and 'false' else.

|    gap> IsCyclotomicField( CF(9) );
    true
    gap> IsCyclotomicField( NF( [ ER(-3) ] ) );
    true
    gap> IsCyclotomicField( NF( [ ER(3) ] ) );
    false|

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Number Field Records}\index{field!number}\index{NF}

'NumberField( <gens> )'\\
'NumberField( <n>, <stab> )'\\
'NumberField( <subfield>, <poly> )'\\
'NumberField( <subfield>, <base> )'

'NumberField' may be abbreviated 'NF'; it returns number fields, namely

'NumberField( <gens> )'\:\\
     the number field generated by the cyclotomics in the list <gens>,

'NumberField( <n>, <stab> )'\:\\
     the fixed field of the prime residues in the list <stab> inside the
     cyclotomic field $Q_n$ (see "Cyclotomic Field Records"),

'NumberField( <subfield>, <poly> )'\:\\
     the splitting field of the polynomial <poly> (which must have degree
     at most 2) over the number field <subfield>; '<subfield> = 0'
     is equivalent to '<subfield> = Rationals',

'NumberField( <subfield>, <base> )'\:\\
     the extension field of the number field <subfield> which is
     as vector space generated by the elements of the list <base> of
     cyclotomics; that means, <base> must be or at least contain a vector
     space base of this extension, if <base> is a base it will be
     assigned to the 'base' field of the cyclotomic field
     (see "Coefficients for Number Fields").
     '<subfield> = 0' is equivalent to '<subfield> = Rationals'.

|    gap> NF( [ EB(7), ER(3) ] );
    NF(84,[ 1, 11, 23, 25, 37, 71 ])
    gap> NF( 7, [ 1 ] );
    CF(7)
    gap> NF( NF( [ EB(7) ] ), [ 1, 1, 1 ] );
    NF(NF(7,[ 1, 2, 4 ]),[ 1, E(3) ])
    gap> F:= NF( 0, [ 1, E(4) ] ); G:= NF( 0, NormalBaseNumberField( F ) );
    GaussianRationals
    CF( Rationals,[ 1/2-1/2*E(4), 1/2+1/2*E(4) ])
    gap> G.base; G.basechangemat; Coefficients( G, 1 );
    [ 1/2-1/2*E(4), 1/2+1/2*E(4) ]
    [ [ 1, 1 ], [ -1, 1 ] ]
    [ 1, 1 ]|

Number field records are field records (see "Field Records") representing
a number field.  Besides the obligatory record components, a number field
record <F> contains the component

'stabilizer':\\
     the list of prime residues modulo 'NofCyc( <F>.generators )' which
     fix all elements of <F>

and possibly

'isIntegralBase':\\
     'true' if '<F>.base' is an integral vector space base of the field
     extension '<F> / <F>.field', 'false' else (used by "Ring" 'Ring');
     for the case that '<F>.field' is a cyclotomic field,
     "Integral Bases for Number Fields" describes integral bases of the
     field extension;

'isNormalBase':\\
     'true' if '<F>.base' is a normal vector space base of the field
     extension '<F>/<F>.field', 'false' else;

'coeffslist':\\
     a list of integers used by "Coefficients" 'Coefficients'; (see also
     "Coefficients for Number Fields");

'coeffsmat':\\
     a matrix of cyclotomics used by "Coefficients" 'Coefficients';
     bound only if '<F>.field' is not a cyclotomic field
     (see also "Coefficients for Number Fields");

'basechangemat':\\
     square matrix of dimension '<F>.dimension', representing the
     basechange from the default base of '<F> / <F>.field'
     (see "Coefficients for Number Fields") to the base stored
     in '<F>.base' if these two are different; used by 'Coefficients'.

*Note*\:\ These fields and also the field 'base' should not be changed by
          hand!

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Cyclotomic Field Records}\index{field!cyclotomic}\index{CF}

'CyclotomicField( <n> )'\\
'CyclotomicField( <gens> )'\\
'CyclotomicField( <subfield>, <n> )'\\
'CyclotomicField( <subfield>, <base> )'

'CyclotomicField' may be abbreviated 'CF'; it returns cyclotomic fields,
namely

'CyclotomicField( <n> )':\\
     the field $Q_n$ (over the rationals),

'CyclotomicField( <gens> )':\\
     the smallest cyclotomic field containing the cyclotomics in the list
     <gens> (over the rationals),

'CyclotomicField( <subfield>, <n> )':\\
     the field $Q_n$ over the number field <subfield>,

'CyclotomicField( <subfield>, <base> )':\\
     the cyclotomic extension field of the number field <subfield> which
     is as vector space generated by the elements of the list <base> of
     cyclotomics; that means, <base> must be or at least contain a vector
     space base of this extension, if <base> is a base it will be
     assigned to the 'base' field of the cyclotomic field
     (see "Coefficients for Number Fields").
     '<subfield> = 0' is equivalent to '<subfield> = Rationals'.

|    gap> CF( 5 ); CF( [ EB(7), ER(3) ] ); CF( NF( [ ER(3) ] ), 24 );
    CF(5)
    CF(84)
    CF(24)/NF(12,[ 1, 11 ])
    gap> CF( CF(3), [ 1, E(4) ] );
    CF(12)/CF(3)|

A cyclotomic field record is a field record (see "Field Records"), in
particular a number field record (see "Number Field Records") that
represents a cyclotomic field.  Besides the obligatory record fields,
a cyclotomic field record <F> contains the fields

'isCyclotomicField':\\
     always 'true'; used by "IsCyclotomicField" 'IsCyclotomicField',

'zumbroichbase':\\
     a list containing 'ZumbroichBase( <n>, <m> )' (see "ZumbroichBase")
     if <F> represents the
     field extension $Q_n/Q_m$, and containing 'Zumbroichbase( <n>, 1 )'
     if <F> is an extension of a number field that is not cyclotomic;
     used by "Coefficients" 'Coefficients', see "Coefficients for Number
     Fields"

and possibly optional fields of number fields (see "Number Field
Records").

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{DefaultField and Field for Cyclotomics}\index{conductor}%
\index{default field!for cyclotomics}\index{field!for cyclotomics}

For a set <S> of cyclotomics,

'DefaultField( <S> ) = CF( <S> )' is the smallest cylotomic field
containing $S$ (see "DefaultField"), the so--called *conductor* of <S>;

'Field( <S> ) = NF( <S> )' is the smallest field containing $S$ (see
"Field").

|    gap> DefaultField( [ E(5) ] ); DefaultField( [ E(3), ER(6) ] );
    CF(5)
    CF(24)
    gap> Field( [ E(5) ] ); Field( [ E(3), ER(6) ] );
    CF(5)
    NF(24,[ 1, 19 ])|

'DefaultField' and 'Field' are used by functions that specify the field
for which some cyclotomics are regarded as elements (see "DefaultField",
"Field"), e.g., 'Trace' with only one argument will compute the trace of
this argument (which must be a cyclotomic) with respect to its default
field.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{DefaultRing and Ring for Cyclotomic Integers}%
\index{default ring!for cyclotomic integers}%
\index{ring!for cyclotomic integers}

For a set <S> of cyclotomic integers,

'DefaultRing( <S> )' is the ring of integers in 'CF( <S> )'
(see "DefaultRing"),

'Ring( <S> )' is the ring of integers in 'NF( <S> )' (see "Ring").

|    gap> Ring( [ E(5) ] );
    Ring( E(5) )
    gap> Ring( [ EB(7) ] );
    Ring( E(7)+E(7)^2+E(7)^4 )
    gap> DefaultRing( [ EB(7) ] );
    Ring( E(7) ) |

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{GeneratorsPrimeResidues}\index{generators!of Galois group}

'GeneratorsPrimeResidues( <n> )'

returns a record with fields

'primes':\\
     the set of prime divisors of the integer <n>,

'exponents':\\
     the corresponding exponents in the factorization of <n> and

'generators':\\
     generators of the group of prime residues\:\ For each odd prime $p$
     there is one generator, corresponding to a primitive root of the
     subgroup $(Z/p^{\nu_p})^{\ast}$ of $(Z/nZ)^{\ast}$, where $\nu_p$ is
     the exponent of $p$ in the factorization of <n>; for $p = 2$, we
     have one generator in the case that 8 does not divide $n$, and a
     list of two generators (corresponding to
     $\langle\ast 5, \ast(2^{\nu_2}-1)\rangle = (Z/2^{\nu_2})^{\ast}$)
     else.

|    gap> GeneratorsPrimeResidues( 9 );      # 2 is a primitive root
    rec(
      primes := [ 3 ],
      exponents := [ 2 ],
      generators := [ 2 ] )
    gap> GeneratorsPrimeResidues( 24 );     # 8 divides 24
    rec(
      primes := [ 2, 3 ],
      exponents := [ 3, 1 ],
      generators := [ [ 7, 13 ], 17 ] )
    gap> GeneratorsPrimeResidues( 1155 );
    rec(
      primes := [ 3, 5, 7, 11 ],
      exponents := [ 1, 1, 1, 1 ],
      generators := [ 386, 232, 661, 211 ] )|

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{GaloisGroup for Number Fields}%
\index{number fields!Galois group}%
\index{automorphism group!of number fields}

The *Galois automorphisms* of the cyclotomic field $Q_n$ are given by
linear extension of the maps $\ast k\:\ e_n \mapsto e_n^k$ with
$1 \leq k \< n$ and 'Gcd( <n>, <k> ) = 1' (see "GaloisCyc").
Note that this action is not equal to exponentiation of cyclotomics,
i.e., in general $z^{\ast k}$ is different from $z^k$\:

|    gap> ( E(5) + E(5)^4 )^2; GaloisCyc( E(5) + E(5)^4, 2 );
    -2*E(5)-E(5)^2-E(5)^3-2*E(5)^4
    E(5)^2+E(5)^3|

For 'Gcd( <n>, <k> ) $\not= 1$', the map $e_n \mapsto e_n^k$ is not a
field automorphism but only a linear map\:

|    gap> GaloisCyc( E(5)+E(5)^4, 5 ); GaloisCyc( ( E(5)+E(5)^4 )^2, 5 );
    2
    -6|

The *Galois group* $Gal( Q_n, Q )$ of the field extension $Q_n/Q$ is
isomorphic to the group $(Z/nZ)^{\ast}$ of prime residues modulo $n$,
via the isomorphism

\[  \begin{array}{ccc} (Z/nZ)^{\ast} & \rightarrow & Gal( Q_n, Q ) \\
                        k        & \mapsto     & ( z \mapsto z^{\ast k} )
    \end{array} \ , \]

thus the Galois group of the field extension $Q_n / L$ with
$L \subseteq Q_n$ which is simply the factor group of $Gal( Q_n, Q )$
modulo the stabilizer of $L$, and the Galois group of $L/L^{\prime}$
which is the subgroup in this group that stabilizes $L^{\prime}$, are
easily described in terms of $(Z/nZ)^{\ast}$ (Generators of
$(Z/nZ)^{\ast}$ can be computed using "GeneratorsPrimeResidues"
'GeneratorsPrimeResidues'.).

The Galois group of a field extension can be computed using "GaloisGroup"
'GaloisGroup'\:

|    gap> f:= NF( [ EY(48) ] );
    NF(48,[ 1, 47 ])
    gap> g:= GaloisGroup( f );
    Group( NFAutomorphism( NF(48,[ 1, 47 ]) , 17 ), NFAutomorphism( NF(48,
    [ 1, 47 ]) , 11 ), NFAutomorphism( NF(48,[ 1, 47 ]) , 17 ) )
    gap> Size( g ); IsCyclic( g ); IsAbelian( g );
    8
    false
    true
    gap> f.base[1]; g.1; f.base[1] ^ g.1;
    E(24)-E(24)^11
    NFAutomorphism( NF(48,[ 1, 47 ]) , 17 )
    E(24)^17-E(24)^19
    gap> Operation( g, NormalBaseNumberField( f ), OnPoints );
    Group( (1,6)(2,4)(3,8)(5,7), (1,4,8,5)(2,3,7,6), (1,6)(2,4)(3,8)
    (5,7) )|

The number field automorphism 'NFAutomorphism( <F>, <k> )' maps each
element <x> of <F> to 'GaloisCyc( <x>, <k> )', see "GaloisCyc".

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{ZumbroichBase}

'ZumbroichBase( <n>, <m> )'

returns the set of exponents $i$ where $e_n^i$ belongs to the base
${\cal{B}}_{n,m}$ of the field extension $Q_n/Q_m$; for that, <n> and <m>
must be positive integers where <m> divides <n>.

${\cal{B}}_{n,m}$ is defined as follows\:

Let $P$ denote the set of prime divisors of $n$,
$n = \prod_{p\in P} p^{\nu_p}$,
$m = \prod_{p\in P} p^{\mu_p}$ with $\mu_p \leq \nu_p$, and
$\{ e_{n_1}^j\}_{j\in J} \otimes \{ e_{n_2}^k\}_{k\in K} = 
\{ e_{n_1}^j \cdot e_{n_2}^k\}_{j\in J, k\in K}$.

Then

\[ {\cal{B}}_{n,m} = \bigotimes_{p\in P}
         \bigotimes_{k=\mu_p}^{\nu_p-1} \{ e_{p^{k+1}}^j\}_{j\in J_{k,p}}
\mbox{\rm\ \ where\ \ }
 J_{k,p} = \left\{ \begin{array}{lcl} \{ 0 \} & ; & k=0, p=2 \\
                        \{ 0, 1 \} & ; & k > 0, p=2 \\
                        \{ 1, \ldots, p-1 \} & ; & k = 0, p\not= 2 \\
                        \{ -\frac{p-1}{2}, \ldots, \frac{p-1}{2} \} & ; &
                                 k > 0, p\not= 2
                     \end{array}\right. . \]

${\cal{B}}_{n,1}$ is equal to the base ${\cal{B}}(Q_n)$ of $Q_n$ over the
rationals given in~\cite{Zum89}
(Note that the notation here is slightly different from that there.).

${\cal{B}}_{n,m}$ consists of roots of unity, it is an integral base
(that is, the integral elements in $Q_n$ have integral coefficients,
see "Cyclotomic Integers"), it is a normal base for squarefree $n$ and
closed under complex conjugation for odd $n$.

|    gap> ZumbroichBase( 15, 1 ); ZumbroichBase( 12, 3 );
    [ 1, 2, 4, 7, 8, 11, 13, 14 ]
    [ 0, 3 ]
    gap> ZumbroichBase( 10, 2 ); ZumbroichBase( 32, 4 );
    [ 2, 4, 6, 8 ]
    [ 0, 1, 2, 3, 4, 5, 6, 7 ]|

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Integral Bases for Number Fields}\index{LenstraBase}

'LenstraBase( <n>, <stabilizer>, <super> )'

returns a list $'[ ' b_1, b_2, \ldots, b_m ' ]'$ of lists, each $b_i$
consisting of integers such that the elements $\sum_{j\in b_i} 'E(n)'^j$
form an integral base of the number field 'NF( <n>, <stabilizer> )',
see "Number Field Records".

<super> is a list representing a supergroup of the group described by the
list <stabilizer>; the base is chosen such that the group of <super> acts
on it, as far as this is possible.

*Note*\:\ 
The $b_i$ are in general not sets, since for '<stabilizer> = <super>',
$b_i[1]$ is always an element of 'ZumbroichBase( <N>, 1 )'; this is used
by 'NF' (see "Number Field Records") and 'Coefficients' (see
"Coefficients for Number Fields").

<stabilizer> must not contain the stabilizer of a proper cyclotomic
subfield of $Q_n$.

|    gap> LenstraBase( 24, [ 1, 19 ], [ 1, 19 ] );          # a base of
    [ [ 1, 19 ], [ 8 ], [ 11, 17 ], [ 16 ] ]               # $Q_3(\sqrt{6})$,
    gap> LenstraBase( 24, [ 1, 19 ], [ 1, 5, 19, 23 ] );   # another one
    [ [ 1, 19 ], [ 5, 23 ], [ 8 ], [ 16 ] ]
    gap> LenstraBase( 15, [ 1, 4 ], PrimeResidues( 15 ) ); # normal base of
    [ [ 1, 4 ], [ 2, 8 ], [ 7, 13 ], [ 11, 14 ] ]          # $Q_3(\sqrt{5})$|

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{NormalBaseNumberField}\index{base!of a number field}

'NormalBaseNumberField( <F> )'\\
'NormalBaseNumberField( <F>, <x> )'

returns a list of cyclotomics which form a normal base of the number
field <F> (see "Number Field Records"), i.e. a vector space base of the
field <F> over its subfield '<F>.field' which is closed under the action
of the Galois group '<F>.galoisGroup' of the field extension.

The normal base is computed as described in~\cite{Art68}\:\ 
Let $\Phi$ denote the polynomial of a field extension $L/L^{\prime}$,
$\Phi^{\prime}$ its derivative and $\alpha$ one of its roots;
then for all except finitely many elements $z\in L^{\prime}$, the
conjugates of $\frac{\Phi(z)}{(z-\alpha)\cdot\Phi^{\prime}(\alpha)}$
form a normal base of $L/L^{\prime}$.

When 'NormalBaseNumberField( <F> )' is called, $z$ is chosen as integer,
starting with 1, 'NormalBaseNumberField( <F>, <x> )' starts with $z=<x>$,
increasing by one, until a normal base is found.

|    gap> NormalBaseNumberField( CF( 5 ) );
    [ -E(5), -E(5)^2, -E(5)^3, -E(5)^4 ]
    gap> NormalBaseNumberField( CF( 8 ) );
    [ 1/4-2*E(8)-E(8)^2-1/2*E(8)^3, 1/4-1/2*E(8)+E(8)^2-2*E(8)^3, 
      1/4+2*E(8)-E(8)^2+1/2*E(8)^3, 1/4+1/2*E(8)+E(8)^2+2*E(8)^3 ]|

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Coefficients for Number Fields}

'Coefficients( <z> )'\\
'Coefficients( <F>, <z> )'

return the coefficient vector <cfs> of <z> with respect to a particular
base <B>, i.e., we have '<z> = <cfs> \*\ <B>'.  If <z> is the only
argument, <B> is the default base of the default field of <z>
(see "DefaultField and Field for Cyclotomics"), otherwise <F> must be a
number field containing <z>, and we have '<B> = <F>.base'.

The *default base* of a number field is defined as follows\:

For the field extension $Q_n/Q_m$ (i.e.\ both <F> and '<F>.field' are
cyclotomic fields), <B> is the base ${\cal{B}}_{n,m}$ described in
"ZumbroichBase".  This is an integral base which is closely related to
the internal representation of cyclotomics, thus the coefficients are
easy to compute, using only the 'zumbroichbase' fields of <F> and
'<F>.field'.

For the field extension $L/Q$ where $L$ is not a cyclotomic field, <B> is
the integral base described in "Integral Bases for Number Fields" that
consists of orbitsums on roots of unity.  The computation of coefficients
requires the field '<F>.coeffslist'.

*in future*\:\ replace $Q$ by $Q_m$

In all other cases, '<B> = NormalBaseNumberField( <F> )'.  Here, the
coefficients of <z> with respect to <B> are computed using
'<F>.coeffslist' and '<F>.coeffsmat'.

If '<F>.base' is not the default base of <F>, the coefficients with
respect to the default base are multiplied with '<F>.basechangemat'.
The only possibility where it is allowed to prescribe a base is when the
field is constructed (see "Number Field Records", "Cyclotomic Field
Records").

|    gap> F:= NF( [ ER(3), EB(7) ] ) / NF( [ ER(3) ] );
    NF(84,[ 1, 11, 23, 25, 37, 71 ])/NF(12,[ 1, 11 ])
    gap> Coefficients( F, ER(3) ); Coefficients( F, EB(7) );
    [ -E(12)^7+E(12)^11, -E(12)^7+E(12)^11 ]
    [ 11*E(12)^4+7*E(12)^7+11*E(12)^8-7*E(12)^11, 
      -10*E(12)^4-7*E(12)^7-10*E(12)^8+7*E(12)^11 ]
    gap> G:= CF( 8 ); H:= CF( 0, NormalBaseNumberField( G ) );
    CF(8)
    CF( 0,[ 1/4-2*E(8)-E(8)^2-1/2*E(8)^3, 1/4-1/2*E(8)+E(8)^2-2*E(8)^3, 
      1/4+2*E(8)-E(8)^2+1/2*E(8)^3, 1/4+1/2*E(8)+E(8)^2+2*E(8)^3 ])
    gap> Coefficients( G, ER(2) ); Coefficients( H, ER(2) );
    [ 0, 1, 0, -1 ]
    [ -1/3, 1/3, 1/3, -1/3 ]|

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\Section{Domain Functions for Number Fields}

The  following  functions  of 'FieldOps'  (see chapter  "Fields")  are
overlaid in 'NumberFieldOps'\:

'/', 'Coefficients', 'Conjugates', 'GaloisGroup', 'in',
'Intersection', 'Norm', 'Order', 'Print', 'Random', 'Trace'.

The  following  functions   of   'NumberFieldOps'   are   overlaid  in
'CyclotomicFieldOps'\:

'Coefficients', 'Conjugates', 'in', 'Norm', 'Print', 'Trace'.

