This is dredging up from the past an issue that will hopefully soon be
resolved. Ticket #3211 recounts the issue. In summary, if M is an
integer matrix, M.echelon_form() (and M.echelonize()) returns the
echelon form over ZZ (i.e., the Hermite form). This is modeled after
Magma, I believe. A problem arises since many students and linear
algebra people assume that the matrix([[1,2],[3,4]]) is over a field,
not a ring, and so expect the echelon form to be the identity matrix.
Insisting that the echelon form be calculated over ZZ also is
inconsistent with, for example, calculating the inverse matrix (which
returns a matrix over QQ in this case).
Several ideas were brought up over the last year or two to deal with
this issue. The winning idea was that we should change Sage so that
echelon_form and echelonize work over the fraction field. I think I've
spent well over 12 hours trying to change the things that make sense and
leave other things alone. This would impact a *lot* of Sage code and
terminology, and doubtless would impact a *lot* of outside code. Which,
of course, means that there would have to be a deprecation warning for a
very long time before the change was ever made. So I'm going to
implement a much simpler idea from the original list of ideas that
solves most of the issues above.
M.rref() returns the echelon form over the fraction field.
Reasons:
1. rref is the command from matlab and pretty much any calculator out
there, and is what a student generally will be looking for. I think
this will completely take care of pedagogical issues. For linear
algebra people, we just have to clearly distinguish between the Sage
usage of rref and echelon_form, which I think is easily done.
2. No backward-compatibility issues. I think we should take a page from
Python's book here. Python has a few warts that are there just because
of history and preserving backwards compatibility.
3. Is anyone else willing to take a crack at the Sage surgery required?
It involves not only code, but also terminology that is used
throughout Sage. One would probably have to go through each mention of
the term "echelon*" and make sure the usage conforms to the new
definition we are giving it.
sage: len((search_src('echelon',interact=False)).splitlines())
821
Anyone up to it?
I'll post up a patch implementing a .rref() method shortly.
Thanks,
Jason
--
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org