[back] [prev] [next] [index] [root]

 


IdealIsPrincipal

Returns a principal generator of an ideal, if it is a principal ideal and false otherwise.

Syntax:

g := IdealIsPrincipal(I);
g := IdealIsPrincipal(I, classgroup);

ideal
  I  
false or algebraic number
  g  
principal generator

Description:

There are two different algorithms used by this function. The standard procedure is not an easy check and can include expensive enumerations. If a second argument "classgroup" is given, it uses precomputed data from class group calculations. In this case it is often quite fast. Once computed, the result is stored and the ideal arithmetic uses the principal generator. A warning: The standard procedure for number fields uses real arithmetic and the correctness of the results depends on the precision defined by OrderPrec() whereas the second method works unconditional.


Example:

We will test the prime ideal lying over 2 in the maximal order of x^3 + 6x^2 + 6x + 6.

kash> O := OrderMaximal(Order(Poly(Zx, [1, 6, 6, 6])));
Generating polynomial: x^3 + 6*x^2 + 6*x + 6
Discriminant: -1836 

kash> p := Factor(O, 2*O)[1][1];
<2, [0, 1, 0]>
kash> IdealIsPrincipal(p);
false
kash> IdealIsPrincipal(p^3);
> 2


<- back[back] [prev] [next] [index] [root]