# 15.12 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 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 ]```

GAP 3.4.4
April 1997