On 10 April 2013 17:33, Victor Miller <
victor...@gmail.com> wrote:
> John, I agree. In fact in my case I know a multiple of the order of the
> ideal. The ideal is one of norm 2, and I can produce an element of norm
> 2^k, which is not divisible by 2. But, I can't find the method to test
> principality, or to extract the generator. I would like something like
>
> I.principal_generator()
>
I.is_principal() returns True/False and then I.gens_reduced() returns
a list (actually a tuple) of length 1 iff the ideal is principal.
This is a little more complicated than Magma where IsPrincipal returns
either False or True,g with g a generator, but seems unavoidable given
that Sage'sconvention is that the type and number of returned values
should be the same for all inputs.
John