Dear all - 

Here is a much lighter way make my "problem" go away.  
Suppose that A is an m by n matrix (number of rows by number of columns).  

A = matrix(ZZ, [[-6, -26, -82], [0, 4, 3], [1, 0, 7], [0, 2, 5], [2, 10, 
30]])
sage: type(A)
<type 'sage.matrix.matrix_integer_dense.Matrix_integer_dense'>

Currently we get this: 

sage: D, U, V = A.smith_form()
sage: [type(x) for x in A.smith_form()]
[sage.matrix.matrix_integer_dense.Matrix_integer_dense,
 sage.matrix.matrix_integer_dense.Matrix_integer_dense,
 sage.matrix.matrix_integer_dense.Matrix_integer_dense]

So U (say) is a matrix.  Now, the whole point of U's existence is to be a 
product of 
elementary matrices, that do row operations to A, trying to turn it into 
D.  So if we 
change smith_form to return U as an element of GL(m,ZZ) (and return V as an 
element of GL(n.ZZ)) then I am good to go.  Just to be clear what I am 
talking about: 

sage: G = GL(5,ZZ)
sage: P = G.generators()[0]
sage: type(P)
<class 
'sage.groups.matrix_gps.group_element.LinearMatrixGroup_gap_with_category.element_class'>
sage: type(P.inverse())
<class 
'sage.groups.matrix_gps.group_element.LinearMatrixGroup_gap_with_category.element_class'>

This is good... 

sage: type(A)
<type 'sage.matrix.matrix_integer_dense.Matrix_integer_dense'>
sage: type(P*A)
<type 'sage.matrix.matrix_integer_dense.Matrix_integer_dense'>
sage: A.smith_form()[0] == (P*A).smith_form()[0]
True

and I am happy.  Of course, in general U and V lie in GL(m, R) and GL(n,R) 
where R is the parent of the entries of A. 

best,

saul

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to