Oh, no, not this one again! I overhauled the elementary divisors code
a while ago and I thought I had sorted out this one. Personally I feel
that M.elementary_divisors() should always return a list of size min
(M.nrows(), M.ncols()), which should also be the size of the square
matrix output by M.smith_form().

I don't think it's a left/right issue; it's just that there are loads
of different implementations of elementary_divisors depending on the
base ring (as with just about everything in the matrix code), and
elementary divisors over a field is a pretty vacuous concept anyway,
so I must have missed it when I was checking for consistency.

David

On Dec 8, 12:16 pm, Harald Schilly <harald.schi...@gmail.com> wrote:
> Hello, from the "report a problem" link I got the complaint that
> elementary_divisors() is wrong. It turned out that it behaves
> differently with respect to the matrix's ring. I guess it's one of
> those left/right issues.
>
> Examples:
>
> sage: M = random_matrix(ZZ, 5,3)
> sage: M.elementary_divisors()
> [1, 1, 1, 0, 0]
>
> sage: M = random_matrix(QQ, 5,3)
> sage: M.elementary_divisors()
> [1, 1, 1]
>
> Can we make this more consistent? Ideas? The original request was to
> change elementary_divisors() for ZZ matrices in the way so that it
> returns 3 elements, not 5.
>
> H

-- 
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

Reply via email to