> 2. The Linbox implementation and the Pari implementation differ by a > transpose; that is, if you really want the two to agree on some matrix > m, you need to compare
Ah, I think you've just uncovered an inconsistency. By definition, the elementary divisors of m.transpose() are equal by definition to the elementary divisors of m, if m is square. But if m isn't square, the different routines in Sage use different conventions. The Pari implementation seems to pad with zeroes to return a list as long as the number of columns of M. From what you say it sounds like the Linbox one pads to the number of rows of M. Meanwhile, the slow generic implementation that I wrote for matrices over general PID's returns a list of length min(nrows, ncols). I don't have a strong opinion on which answer is the right one, but it certainly shouldn't be inconsistent like this. Personally I'd prefer it if M.elementary_divisors() was always equal to M.transpose ().elementary_divisors(), which is the convention I used. David --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] 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 -~----------~----~----~----~------~----~------~--~---
