Previous Up Next

15.2.15  Smith normal form

The smith command finds the Smith normal form of a matrix with elements in a field K.

Examples

M:=([[5,-2,3,6],[1,-3,1,3],[7,-6,-4,7],[-2,-4,-3,0]]) % 17:; A:=x*idn(4)-M
     







x+
−5
%17
2%17

−3
%17

−6
%17

−1
%17
x+3%17

−1
%17

−3
%17

−7
%17
6%17x+4%17

−7
%17
2%174%173%17x







          
U,D,V:=smith(A):;
     
 







0%17

−1
%17
0%170%17
0%170%176%174%17

−2 x+5
%17

−4 x−5
%17

−3 x−6
%17

x2−3 x+6
%17

x2+5 x+6
%17

x2+8 x+2
%17

x2+4 x+1
%17

x3−2 x2+2 x−6
%17







,
         
 







1%17

x+3
%17

−6 x2−3 x−7
%17

x5+2 x4−2 x3+x2−8 x+6
%17
0%171%17

−6 x−2
%17

x4+x3−6 x2+5 x−6
%17
0%170%171%17

x3+3 x2+7
%17
0%170%170%171%17







,
         
 





1%170%170%170%17
0%171%170%170%17
0%170%171%170%17
0%170%170%17

x4−2 x3+8 x2−3 x+2
%17





         

You can check this:

normal(U*A*V-D)
     




0000
0000
0000
0000




          
B:=[[x^2+x-1,1,0,1],[-1,x,0,-1],[0,x^2+1,x,0],[1,0,1,x^2+x+1]] % 3:; L:=smith(B)
     
 








0%3

−1
%3
0%30%3
1%30%30%3

x2x+1
%3
0%3

x2+1
%3

x
%3

x2+1
%3

−1
%3

x4x3+x+1
%3

x3+x2x+1
%3

x4x3+x2x
%3








,
         
 





1%30%30%30%3
0%31%30%30%3
0%30%31%30%3
0%30%30%3

x6+x5+x+1
%3





,
         
 







1%3x%3

x3+x2x
%3

x7+x6+x4+x3+x2+x−1
%3
0%31%3

x2+x−1
%3

x6+x5+x3+x2+x+1
%3
0%30%31%3

x4x3x2x
%3
0%30%30%31%3







         

Previous Up Next