Hello sage-devel, I think we should think about NumberFieldFractionalIdeal.__repr__(), i.e. how to print an ideal in a number field. Right now, we actually check whether the ideal is principal (and then use a generator to print the ideal). This is very slow, especially with proof=True. I see several sensible possibilities:
1) Ignore the problem and keep everything as it is. Hope that users will be clever enough never to ask for the string representation of their ideals (there are other functions to get some other useful representations (I.integral_basis() for example) of the ideal). 2) Output the ideal in 2-generator form using idealtwoelt(). 3) Output the ideal in HNF form using a Z-basis of the ring of integers. Native format of PARI, so fastest possible. This can get ugly though. 4) Use LLL and hope we find a generator of our ideal, see idealred() from PARI. If we do not find a generator, we use the 2-element representation. 5) Some kind of mixed case where we do one of the above depending on the "complexity" of the number field in terms of degree and/or discriminant. This will always lead to arbitrary boundaries though. I am personally in favor of 4), even if this goes against the "proof=True" philosophy (we might have a principal ideal where LLL does not find a generator). In any case, we can have an option on the NumberField constructor to decide how its ideals should be printed. But then we still have to discuss what the default should be. Any ideas/suggestions? Maybe something to discuss at Sage Days %d? Jeroen. -- To post to this group, send an email to [email protected] To unsubscribe from this group, send an email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org
