Message Boards Message Boards

0
|
2050 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Calculate the elementary divisors of a matrix

Posted 1 year ago

I'm not sure whether there is a command in Wolfram to calculate the elementary divisors of a matrix. Say, for the matrix [ [ 0, -1, 0 ], [ 0, 0, -1 ], [ -1, 0, 0 ] ], the result given in GAP is as follows:

gap> x:=Indeterminate(Rationals,"x");;
gap> mat2:=PGGenSet229me3[1];
[ [ 0, -1, 0 ], [ 0, 0, -1 ], [ -1, 0, 0 ] ]
gap> mat2:=mat2*One(x)-x*mat2^0;
[ [ -x, -1, 0 ], [ 0, -x, -1 ], [ -1, 0, -x ] ]
gap> d2:=ElementaryDivisorsMat(PolynomialRing(Rationals,1),mat2);
[ 1, 1, x^3+1 ]

The product of the above result is equivalent to one given by CharacteristicPolynomial of Wolfram. But I want to have a list form which is the same as the output in GAP.

Regards,
Zhao

POSTED BY: Hongyi Zhao
2 Replies
Posted 1 year ago

Thank you for pointing this out.

N.B.:

(1). I noticed the related comment here as shown below:

enter image description here

So, although the result is the same, the more appropriate formal definition of this problem should be written as follows:

In[108]:= A="[ [ 0, -1, 0 ], [ 0, 0, -1 ], [ -1, 0, 0 ] ]"//GAP2Wolfram
mat=t IdentityMatrix[3] - A 
{uu, ss, vv} = ResourceFunction["PolynomialSmithDecomposition"][mat]
Diagonal[ss]

Out[108]= {{0, -1, 0}, {0, 0, -1}, {-1, 0, 0}}

Out[109]= {{t, 1, 0}, {0, t, 1}, {1, 0, t}}

Out[110]= {{{0, 0, 1}, {1, 0, -t}, {-t, 1, t^2}}, {{1, 0, 0}, {0, 1, 
   0}, {0, 0, 1 + t^3}}, {{1, 0, -t}, {0, 1, t^2}, {0, 0, 1}}}

Out[111]= {1, 1, 1 + t^3}

(2). I also noticed the following different results given by GAP and the method here.

In GAP:

gap> mat2:=PGGenSet229me3[2];
[ [ -15/4, 29/4, -15/4 ], [ -33/8, 55/8, -25/8 ], [ -25/8, 55/8, -33/8 ] ]
gap> mat2:=mat2*One(x)-x*mat2^0;
[ [ -x-15/4, 29/4, -15/4 ], [ -33/8, -x+55/8, -25/8 ], [ -25/8, 55/8,
-x-33/8 ] ]
gap> d2:=ElementaryDivisorsMat(PolynomialRing(Rationals,1),mat2);
[ 1, 1, x^3+x^2+x+1 ]

The method here:

In[152]:= A="
{{ -15/4, 29/4, -15/4 }, { -33/8, 55/8, -25/8 }, { -25/8, 55/8, -33/8 }}
"//GAP2Wolfram
mat=t IdentityMatrix[3] - A;
{uu, ss, vv} = ResourceFunction["PolynomialSmithDecomposition"][mat];
Diagonal[ss]

Out[152]= {{-(15/4), 29/4, -(15/4)}, {-(33/8), 55/
  8, -(25/8)}, {-(25/8), 55/8, -(33/8)}}

Out[155]= {480, 480, 480 + 480 t + 480 t^2 + 480 t^3}
POSTED BY: Hongyi Zhao

If I am not mistaken, this can be handled pretty much same as was done in your prior question on rational canonical forms.

mat = {{-x, -1, 0}, {0, -x, -1}, {-1, 0, -x}};
{uu, ss, vv} = ResourceFunction["PolynomialSmithDecomposition"][mat]
Diagonal[ss]

(* Out[1062]= {{{0, 0, -1}, {-1, 0, x}, {x, -1, -x^2}}, {{1, 0, 0}, {0, 
   1, 0}, {0, 0, 1 + x^3}}, {{1, 0, -x}, {0, 1, x^2}, {0, 0, 1}}}

Out[1063]= {1, 1, 1 + x^3} *)
POSTED BY: Daniel Lichtblau
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract