|   | 1 |  initial version  | 
It seems you are interested in Smith normal form of matrices over a univariate polynomial ring. Indeed, Smith Normal Form works well there, and is implemented.
sage: R.<x>=QQ[]
sage: M=matrix(2,2,[x^2,x+1,x^3+x+1,x^4-1])
sage: M.smith_form()
(
[                                1                                 0]
[                                0 x^6 - x^4 - x^3 - 2*x^2 - 2*x - 1],
[ x^2 - x + 1       -x + 1]  [                  1 x^5 - x^4 - x^3 - x]
[-x^3 - x - 1          x^2], [                  0                   1]
)
(I recommend that you track down a little more mainstream sources for your mathematics, that use more universally understood terminology)
 Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.
 
                
                Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.