Jakob Hirbawi asked:
> Is there a way to tell GAP to do calculations in a field smaller than
> Q(E(n)) ?
GAP will do computations in the smallest cyclotomic field.
For example, if I have matrices over Q( sqrt(-7), sqrt(5) ), GAP translates
all the entries to E(35) and that results in expressions that are much more
complicated than they have to be.
However even if you specify subfields (by 'NumberField'), internal
representation will be made using the smallest root of unity possible. In
your example, this is E(35).
I looked at "NumberField" which seems to set up such subfields, but I couldn't
find anything that goes beyond this. Is what I am trying to do possible in
3.3? how about 3.4? Thanks.
Not in 3.3. Version 3.4 (I won't comment about release dates ...) will
contain code for arbitrary algebraic extensions (Though up to now, only
simple extensions, so you will still have to do some work by hand). In 3.4,
your example would become (This example will not yet work in 3.3):
# We set up both polynomials gap> x:=X(Rationals);;x.name:="x";; gap> f:=x^2-5;; gap> g:=x^2+7;; gap> R:=PolynomialRing(RationalsPolynomials);; gap> y:=X(RationalsPolynomials);;y.name:="y";; gap> Value(g,y); y^2 + (7*x^0)
Now construct an extension containing roots of both polynomials:
The polynomial Res_y(f(x-y),g(y)) has ER(5)+ER(-7) as a root. It is a good
candidate for the extension spanned by both roots.
gap> r:=-Resultant(Value(f,x-y),Value(g,y)); x^4 + 4*x^2 + 144
We check, whether it is indeed irreducible (then it must span the correct
extension by degree arguments)
gap> Factors(r); [ x^4 + 4*x^2 + 144 ]
Now construct the extension.
AlgebraicExtension(Rationals,x^4 + 4*x^2 + 144)
And take a root of r (No selection which root to be taken will be made)
Now identify the roots of both original polynomials
gap> R:=PolynomialRing(e);; gap> f:=EmbeddedPolynomial(R,f); X(e)^2 - 5 gap> ff:=Factors(f); [ X(e) + (1/24*alpha^3-1/3*alpha), X(e) + (-1/24*alpha^3+1/3*alpha) ] gap> sqrfive:=-ff.coefficients; 1/24*alpha^3-1/3*alpha
It is indeed a root of 5.
gap> sqrfive^2; 5 The same for ER(-7): gap> g:=EmbeddedPolynomial(R,g); X(e)^2 + 7 gap> gg:=Factors(g); [ X(e) + (-1/24*alpha^3-2/3*alpha), X(e) + (1/24*alpha^3+2/3*alpha) ] gap> isqrseven:=-gg.coefficients; 1/24*alpha^3+2/3*alpha gap> isqrseven^2; -7
Now summation produces much nicer results, all computations will be done in
this deg4 extension:
gap> isqrseven+sqrfive; 1/12*alpha^3+1/3*alpha
However, now representation is done using GAP-language level routines which
are slower than the kernel routines for cyclotomics. I have made no
experiments to check, where the 'break even' point would be.
Up to now, there is also no facility, to allow using a different base for
the specified algebraic extension. These drawbacks will hopefully be removed
in the future.