Forgot password?
 Create new account
View 1481|Reply 5

将矩阵化为史密斯标准型

[Copy link]

462

Threads

969

Posts

9934

Credits

Credits
9934

Show all posts

青青子衿 Posted at 2019-11-14 15:11:18 |Read mode
Last edited by 青青子衿 at 2020-12-30 10:57:00\begin{align*}
&\qquad\qquad\qquad\qquad\qquad\begin{pmatrix}
\lambda+1&-1&\\
4&\lambda-3&\\
-1&&\lambda-2\\
\end{pmatrix}\\
\\
&
\xrightarrow[]{\quad\,c_2+c_1\quad}
\begin{pmatrix}
\lambda&-1&\\
\lambda+1&\lambda-3&\\
-1&&\lambda-2\\
\end{pmatrix}
\xrightarrow[]{\quad-r_2+r_1\quad}
\begin{pmatrix}
-1&2-\lambda&\\
\lambda+1&\lambda-3&\\
-1&&\lambda-2\\
\end{pmatrix}\\
\\
&
\xrightarrow[-r_1+r_3]{\quad\left(\lambda+1\right)r_1+r_2\quad}
\begin{pmatrix}
-1&2-\lambda&\\
&\lambda\left(2-\lambda\right)-1&\\
&\lambda-2&\lambda-2\\
\end{pmatrix}
\xrightarrow[]{\quad\left(2-\lambda\right)c_1+c_2\quad}
\begin{pmatrix}
-1&&\\
&\lambda\left(2-\lambda\right)-1&\\
&\lambda-2&\lambda-2\\
\end{pmatrix}\\
\\
&
\xrightarrow[]{\quad\lambda\cdot\!\,r_3+r_2\quad}
\begin{pmatrix}
-1&&\\
&-1&\lambda\left(\lambda-2\right)\\
&\lambda-2&\lambda-2\\
\end{pmatrix}
\xrightarrow[]{\quad\left(\lambda-2\right)r_2+r_3\quad}
\begin{pmatrix}
-1&&\\
&-1&\lambda\left(\lambda-2\right)\\
&&\left(\lambda-1\right)^2\left(\lambda-2\right)\\
\end{pmatrix}\\
\\
&
\xrightarrow[]{\quad\lambda\left(\lambda-2\right)c_2+c_3\quad}
\begin{pmatrix}
-1&&\\
&-1&\\
&&\left(\lambda-1\right)^2\left(\lambda-2\right)\\
\end{pmatrix}
\xrightarrow[\quad\,c_2\cdot\left(-1\right)\quad]{\quad\,c_1\cdot\left(-1\right)\quad}
\begin{pmatrix}
1&&\\
&1&\\
&&\left(\lambda-1\right)^2\left(\lambda-2\right)\\
\end{pmatrix}\\
\end{align*}

\begin{align*}
\color{black}{
\begin{pmatrix}
-2&-2&4\\
-6&0&6\\
-7&-3&9\\
\end{pmatrix}

\qquad\qquad
\begin{pmatrix}
2&0&0\\
6&4&-2\\
3&1&1\\
\end{pmatrix}

\qquad\qquad
\begin{pmatrix}
5&-2&1\\
8&-1&2\\
7&0&3\\
\end{pmatrix}}
\end{align*}

3151

Threads

8498

Posts

610K

Credits

Credits
66208
QQ

Show all posts

hbghlyj Posted at 2023-2-20 08:19:47
SmithDecomposition
  1. SmithDecomposition[{{-2, -2, 4}, {-6, 0, 6}, {-7, -3, 9}}]
Copy the Code

Decompose $m$ into unimodular matrices $u$ and $v$ and a diagonal matrix $r$:
\[m=\begin{pmatrix}
-2&-2&4\\
-6&0&6\\
-7&-3&9\\
\end{pmatrix}\implies u=\left(
\begin{array}{ccc}
4 & 2 & -3 \\
5 & 3 & -4 \\
9 & 4 & -6 \\
\end{array}
\right),r=\left(
\begin{array}{ccc}
1 & 0 & 0 \\
0 & 2 & 0 \\
0 & 0 & 6 \\
\end{array}
\right),v=\left(
\begin{array}{ccc}
1 & -1 & 0 \\
0 & 1 & -1 \\
0 & 0 & 1 \\
\end{array}
\right)\]We have
\[u . m . v =r\]

3151

Threads

8498

Posts

610K

Credits

Credits
66208
QQ

Show all posts

hbghlyj Posted at 2023-3-1 17:51:31
See page 76.
The main idea is this:  
For each $k$, the GCD of all the determinants of $k \times k$ submatrices of $A$ (with possibly different sets of indices for columns and rows) is preserved under multiplying by integer matrices with $\det =\pm 1$. These invariants equal $d_1 \cdot \ldots \cdot d_k$ in the smith form for each $k$, determining it uniquely.
math.stackexchange.com/questions/1641268/

3151

Threads

8498

Posts

610K

Credits

Credits
66208
QQ

Show all posts

hbghlyj Posted at 2023-3-1 17:53:57
$A=\begin{pmatrix}
-2&-2&4\\
-6&0&6\\
-7&-3&9\\
\end{pmatrix}$
GCD of determinants of all $1\times 1$ submatrices of $A$ is GCD of all entries of $A$
$$\gcd(-2,-2,4,-6,0,6,-7,-3,9)=1$$
GCD of determinants of all $2\times 2$ submatrices of $A$ is 2, eg. $\begin{vmatrix}
-2&-2\\
-6&0\\
\end{vmatrix}=-12$
GCD of determinants of all $3\times 3$ submatrices of $A$ is $\det A=6$
Therefore, the SNF of $A$ is\begin{pmatrix}
1&&\\
&2&\\
&&6\\
\end{pmatrix}

3151

Threads

8498

Posts

610K

Credits

Credits
66208
QQ

Show all posts

hbghlyj Posted at 2023-3-1 18:02:55

Sympy

Last edited by hbghlyj at 2023-3-2 01:35:00Matrix Normal Forms
  1. from sympy import Matrix, ZZ
  2. from sympy.matrices.normalforms import smith_normal_form
  3. m = Matrix([[12, 6, 4], [3, 9, 6], [2, 16, 14]])
  4. print(smith_normal_form(m, domain=ZZ))
Copy the Code

Source

3151

Threads

8498

Posts

610K

Credits

Credits
66208
QQ

Show all posts

hbghlyj Posted at 2023-3-1 18:27:02

用Sympy写函数求SNF

Matrices (linear algebra)
1-min.png
适用于3阶矩阵:
  1. from sympy import Matrix, igcd
  2. def snf3(A):
  3.     gcd = []
  4.     for k in range(1,4):
  5.         dets = []
  6.         for i in range(4-k):
  7.             for j in range(4-k):
  8.                 submatrix = A[i:i+k, j:j+k]
  9.                 dets.append(submatrix.det())
  10.         gcd.append(igcd(*dets) if k<3 else dets[0])
  11.     return Matrix.diag(*gcd)
Copy the Code

手机版Mobile version|Leisure Math Forum

2025-4-21 14:18 GMT+8

Powered by Discuz!

× Quick Reply To Top Return to the list