找回密码
 快速注册
搜索
查看: 1362|回复: 5

将矩阵化为史密斯标准型

[复制链接]

471

主题

945

回帖

9837

积分

积分
9837

显示全部楼层

青青子衿 发表于 2019-11-14 15:11 |阅读模式
本帖最后由 青青子衿 于 2020-12-30 10:57 编辑 \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*}

3149

主题

8388

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65401
QQ

显示全部楼层

hbghlyj 发表于 2023-2-20 08:19
SmithDecomposition
  1. SmithDecomposition[{{-2, -2, 4}, {-6, 0, 6}, {-7, -3, 9}}]
复制代码

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\]

3149

主题

8388

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65401
QQ

显示全部楼层

hbghlyj 发表于 2023-3-1 17:51
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/

3149

主题

8388

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65401
QQ

显示全部楼层

hbghlyj 发表于 2023-3-1 17:53
$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}

3149

主题

8388

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65401
QQ

显示全部楼层

hbghlyj 发表于 2023-3-1 18:02

Sympy

本帖最后由 hbghlyj 于 2023-3-2 01:35 编辑 Matrix 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))
复制代码

Source

3149

主题

8388

回帖

6万

积分

$\style{scale:11;fill:#eff}꩜$

积分
65401
QQ

显示全部楼层

hbghlyj 发表于 2023-3-1 18:27

用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)
复制代码

手机版|悠闲数学娱乐论坛(第3版)

GMT+8, 2025-3-4 16:34

Powered by Discuz!

× 快速回复 返回顶部 返回列表