> < ^ Date: Sat, 27 Aug 1994 14:17:00 +0200
> < ^ From: Alexander Hulpke <hulpke@math.colostate.edu >
> < ^ Subject: Re: Factoring over GaussianRationals

Dear GAP Forum,

Lewis McCarthy asked:

I've been trying to factor in the polynomial ring over the Gaussian rationals
without success. Could someone explain what I'm doing wrong in the following
example ? Also, what syntax do I need to use to factor over other finite
field extensions ?

Concerning general finite field extensions (and Your question in a previous
mail) I will post a more general answer on Monday.

gap> x := Indeterminate(GaussianRationals);
X(GaussianRationals)
gap> x.name := "x";
"x"
gap> f := Polynomial(GaussianRationals,[7 - 2 * E(4),5,4 + E(4)]);
(4+E(4))*x^2 + 5*x + (7-2*E(4))
gap> Factors(PolynomialRing(f.baseRing),f);
Error, sorry, can not factor <r> in the ring <R> in
R.operations.Factors( R, r ) called from
Factors( PolynomialRing( f.baseRing ), f ) called from
main loop
brk> f in PolynomialRing(f.baseRing);
true

This would be indeed the correct syntax. Unfortunately polynomial
factorization over algebraic extensions is at the moment only available for
generic algebraic extensions (created with 'AlgebraicExtension') and not
for the special cyclotomic fields (like 'GaussianRationals').
>From an algorithmic point of view, it would be quite easy to adapt those
algorithms for use also over cyclotomic fields, the problem is mainly
fitting different data structures together. This has not been done yet
(mainly because I was too lazy to add routines that no one needed at the
point of writing the code).

However, it is quite easy to circumvent this problem, the following code in
GAP 3.4 does exactly what you want:

```gap> x:=X(Rationals);;x.name:="x";;
gap> m:=x^2+1; # the minimal polynomial for Q(E(4))
x^2 + 1
```

Now construct a general algebraic extension isomorphic to GaussianRationals
gap> GR:=AlgebraicExtension(m);
AlgebraicExtension(Rationals,x^2 + 1)

```gap> e4:=RootOf(m); # the replacement to E(4)
RootOf(x^2 + 1)
gap> e4.name:="I";;
```

Now construct the polynomial

```gap> y:=X(GR);y.name:="y";;
X(AlgebraicExtension(Rationals,x^2 + 1))
gap> f:=Polynomial(GR,[7-2*e4,5,4+e4]);
(I+4)*y^2 + 5*y + (-2*I+7)
```

Factorize ...

```gap> Factors(f);
[ I+4, y^2 + (-5/17*I+20/17)*y + (-15/17*I+26/17) ]
```

(Note: The 'factor' I+4 is doe to the factoring process that requires monic
polynomials and splits off leading coefficients initially.)

Just another example to show factorization:

```gap> f:=y^2+9;
y^2 + 9
gap> Factors(f);
[ y + (-3*I), y + (3*I) ]
```

> Many thanks for everyone's time...
You're welcome.

> specific RTFM pointers gratefully accepted
Unfortunately the manual part about algebraic extensions has been forgotten
to include. It will be added in the first patch (due in the next few days).
If you are in urgent need of the documentation or have further questions
feel free to contact me directly.

Alexander Hulpke

> < [top]