As already mentioned in the introduction to this chapter, the ring of Gaussian integers is a Euclidean ring. Therefore all ring functions are applicable to this ring and its elements (see chapter Rings). This section gives further comments on the definitions and implementations of those functions for the Gaussian integers. All functions not mentioned here are not treated specially, i.e., they are implemented by the default function mentioned in the respective section.
The units of
[ 1, E(4), -1, -E(4) ].
The standard associate of a Gaussian integer x is the associated
element y of x that lies in the first quadrant of the complex plane.
That is y is that element from
x * [1,-1,E(4),-E(4)] that has
positive real part and nonnegative imaginary part.
The Euclidean degree of a Gaussian integer x is the product of x and its complex conjugate.
Define the integer part i of the quotient of x and y as the point
of the lattice spanned by 1 and
E(4) that lies next to the rational
quotient of x and y, rounding towards the origin if there are several
such points. Then
EuclideanRemainder( x, y ) is defined as
i * y. With this definition the ordinary Euclidean algorithm for
the greatest common divisor works, whereas it does not work if you always
round towards the origin.
The Euclidean quotient of two Gaussian integers x and y is the quotient of w and y, where w is the difference between x and the Euclidean remainder of x and y.
Since the Gaussian integers are a Euclidean ring, primes and irreducibles
are equivalent. The primes are the elements
1 + E(4) and
1 - E(4) of
norm 2, the elements
a + b*E(4) and
a - b*E(4) of norm
p = a^2 + b^2 with p a rational prime congruent to 1 mod 4,
and the elements p of norm
p^2 with p a rational prime congruent
to 3 mod 4.
The list returned by
Factors is sorted according to the norms of the
primes, and among those of equal norm with respect to
<. All elements
in the list are standard associates, except the first, which is
multiplied by a unit as necessary.
The above characterization already shows how one can factor a Gaussian
integer. First compute the norm of the element, factor this norm over
the rational integers and then split 2 and the primes congruent to 1 mod
TwoSquares (see TwoSquares).
gap> Factors( GaussianIntegers, 30 ); [ -1-E(4), 1+E(4), 3, 1+2*E(4), 2+E(4) ]
Previous Up Top Next