On Jul 6, 9:45 am, John Cremona <john.crem...@gmail.com> wrote: > I think it is too much to expect general PIDs to have unique > (canonical) echelon forms, since that would, as a special case, mean a > canonical generator for each principal ideal. Of course there are > PIDs (such as Z) where there is a natural choice, but not in general.
I'm not so sure, John. Leslie Hogben's Handbook of Linear Algebra (Chapman and Hall/CRC 2006) says that Hermite Normal Forms (HNFs) exist for matrices over Bezout rings and are unique up to multiplication by units over PIDs. Though, as you say, there is not over many PID's a canonical HNF, it is not difficult to decide whether two HNF's are equivalent, i.e., the rows generate the same submodule, which is what we want to know here: check whether the leading entries are in the same positions and are associates, then check the above-diagonal entries. Unfortunately, over polynomial rings at least, echelon_form_PID doesn't, as of 4.7, always yield the (or rather an) HNF: sage: A = matrix(2,2,[QQ['t'].random_element() for i in range(4)]); A [ 0 -t^2 + 7/2*t] [ t^2 + 3/2 -11*t^2 - 7/2] sage: A._echelon_form_PID()[1] [ t^2 + 3/2 -11*t^2 - 7/2] [ 0 t^2 - 7/2*t] Clearly 11 times row 1 should be added to row 0 to obtain [ t^2 + 3/2 -77/2*t - 7/2] [ 0 t^2 - 7/2*t] Of course in the case of polynomial rings over fields there is a canonical HNF, as the leading entries can be chosen to be monic. All this should be simple to fix. Francis -- 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