id summary reporter owner description type status priority milestone component resolution keywords cc merged author reviewer upstream work_issues branch commit dependencies stopgaps
16268 Better normalization for fraction field elements cremona "Normalize the leading coefficient of the denominator to one when reducing elements of fraction fields of univariate polynomial rings over fields. Doing so
- often leads to more readable results,
- helps limiting coefficient blow-up during computations with fractions over complicated base fields (e.g., elements of ℚ(x,y)(t)), typically leading to much better performance,
- makes hashing more (though not 100%) reliable, see the original description and the comments below.
The following further desirable improvements, out of the scope of this ticket, are dealt with at #26339:
- clearing denominators in the numerator and denominator instead of making the leading coefficient of the denominator monic when that makes sense (i.e., for printing, and perhaps for computations in nested rational function fields, but making it fast enough requires some work),
- also normalizing the leading coefficients over non-fields where that makes sense (see also discussion at #16993).
Original description:
If K is a field then K(u), the function field, has a reduce() method which cancels the gcd but does not put into a canonical form by (for example) dividing through by the leading coefficient of the denominator to make the denominator monic. This means that equal elements may have different hashes, and hence that putting function field elements into a set does not work as a mathematician would expect. For example:
{{{
sage: Ku.__ = FractionField(PolynomialRing(QQ,'u'))
sage: a = 27*u^2+81*u+243
sage: b = 27*u-81
sage: c = u^2 + 3*u + 9
sage: d = u-3
sage: s = a/b
sage: t = c/d
sage: s==t
True
sage: len(Set([s,t]))
2
}}}
" defect closed minor sage-8.4 algebra fixed tscrim cheuberg etn40ff jakobkroeker bhutz slelievre sage-8.4.beta2 Robert Bradshaw, Erik Massop, Marc Mezzarobba Julian Rüth N/A af91bf5f1dad1ab5bbb6fb376bb5c408bc85974e
__