#5183: issues with elementary_divisors for sparse integer matrices
----------------------------+-----------------------------------------------
Reporter: jhpalmieri | Owner: was
Type: defect | Status: new
Priority: minor | Milestone: sage-3.4.1
Component: linear algebra | Keywords: elementary_divisor, sparse, dense
----------------------------+-----------------------------------------------
Two things:
1. the conventions for elementary_divisors are different in Pari's
implementation (called in matrix_integer_dense.pyx) compared to the
generic PID implementation (in matrix2.pyx):
{{{
sage: mat = matrix(ZZ, 3, 2, [1, 0, 0, 1, 0, 0], sparse=True)
sage: mat.elementary_divisors()
[1, 1]
sage: mat.dense_matrix().elementary_divisors()
[1, 1, 0]
}}}
2. if the elementary divisors of a sparse matrix are not all 0 or 1 (at
least I think that's the issue), I get an error:
{{{
sage: mat = matrix(ZZ, 3, 2, range(6), sparse=True)
sage: sage: mat.elementary_divisors()
---------------------------------------------------------------------------
TypeError Traceback (most recent call
last)
...
TypeError: unable to coerce <class 'sage.rings.ideal.Ideal_pid'> to an
integer
}}}
I get the same error for {{{mat.smith_form()}}}. This is a problem with
the Smith normal form stuff in matrix2.pyx, I think.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5183>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
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-trac?hl=en
-~----------~----~----~----~------~----~------~--~---