I agree with Nick here. If we want to change the default behavior of some functions so that they work the same as over the fraction field, that's fine. But don't add a call to fraction field to the constructor. ZZ is the initial object in the category of rings. That's a good reason for it to be the default base ring. David
On Thu, May 15, 2008 at 2:48 PM, Nils Bruin <[EMAIL PROTECTED]> wrote: > > -1. While I agree that defaulting to matrices over QQ rather than over > ZZ would lead to more expected behaviour for most users, I don't see > how the rule for changing the base ring can be made both consistent > and cheap. > > Imagine R1 = QQ[x,y]/(x^2+y^2-1). Then FieldOfFractions(R1) is well- > defined, so one would expect that > matrix([x]) would be over the field of fractions. > > If R2=Q[x,y]/( x^2-y^2), FieldOfFractions(R2) does not exist. Deciding > whether FieldOfFractions(Ri) exists is a fairly expensive operation in > these cases. > > I think special-casing matrix([ZZ(1)]) etc. is a bad idea. You would > need a method R.has_an_obvious_field_of_fractions() on rings to both > deal with ZZ and avoid expensive operations for R1 and R2 above. > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---