 linalg(deprecated)/ismith - Help

linalg(deprecated)

 ismith
 integer-only Smith normal form

 Calling Sequence ismith(A) ismith(A, U, V)

Parameters

 A - rectangular matrix of integers U - name V - name

Description

 • Important: The linalg package has been deprecated. Use the superseding packages, LinearAlgebra and VectorCalculus, instead.
 - For information on migrating linalg code to the new packages, see examples/LinearAlgebraMigration.
 • The function ismith computes the Smith normal form S of an n by m rectangular matrix of integers.
 • If two n by n matrices have the same Smith normal form, they are equivalent.
 • The Smith normal form is a diagonal matrix where

 rank(A) = number of nonzero rows (columns) of S sign(S[i,i]) = 1  for 0 < i <= rank(A) S[i,i] divides S[i+1,i+1] for 0 < i < rank(A) product(S[i,i],i=1..r) divides det(M) for all minors M of rank 0 < r <= rank(A)

 Hence if n = m and rank(A) = n then $\left|\mathrm{det}\left(A\right)\right|=\prod _{i=1}^{n}{S}_{i,i}$.
 • The Smith normal form is obtained by doing elementary row and column operations.  This includes interchanging rows (columns), multiplying through a row (column) by -1, and adding integral multiples of one row (column) to another.
 • Although the rank and determinant can be easily obtained from S this is not an efficient method for computing these quantities except that this may yield a partial factorization of $\mathrm{det}\left(A\right)$ without doing any explicit factorizations.
 • In the case of three arguments, the second argument U and the third argument V will be assigned the transformation matrices on output, such that smith(A) = U &* A &* V.
 • The command with(linalg,ismith) allows the use of the abbreviated form of this command.

Examples

Important: The linalg package has been deprecated. Use the superseding packages, LinearAlgebra and VectorCalculus, instead.

 > $\mathrm{with}\left(\mathrm{linalg}\right):$
 > $H≔\mathrm{array}\left(\left[\left[9,-36,30\right],\left[-36,192,-180\right],\left[30,-180,180\right]\right]\right)$
 ${H}{≔}\left[\begin{array}{ccc}{9}& {-36}& {30}\\ {-36}& {192}& {-180}\\ {30}& {-180}& {180}\end{array}\right]$ (1)
 > $\mathrm{ismith}\left(H\right)$
 $\left[\begin{array}{ccc}{3}& {0}& {0}\\ {0}& {12}& {0}\\ {0}& {0}& {60}\end{array}\right]$ (2)
 > $A≔\mathrm{array}\left(\left[\left[13,5,7\right],\left[17,31,39\right]\right]\right)$
 ${A}{≔}\left[\begin{array}{ccc}{13}& {5}& {7}\\ {17}& {31}& {39}\end{array}\right]$ (3)
 > $B≔\mathrm{ismith}\left(A,U,V\right)$
 ${B}{≔}\left[\begin{array}{ccc}{1}& {0}& {0}\\ {0}& {2}& {0}\end{array}\right]$ (4)
 > $\mathrm{eval}\left(U\right)$
 $\left[\begin{array}{cc}{0}& {1}\\ {-1}& {1}\end{array}\right]$ (5)
 > $\mathrm{eval}\left(V\right)$
 $\left[\begin{array}{ccc}{-4}& {7}& {-11}\\ {-72}& {127}& {-194}\\ {59}& {-104}& {159}\end{array}\right]$ (6)
 > $\mathrm{evalm}\left(\left(U\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&*\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}A\right)\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}&*\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}V-B\right)$
 $\left[\begin{array}{ccc}{0}& {0}& {0}\\ {0}& {0}& {0}\end{array}\right]$ (7)