## 2018年1月28日日曜日

### 数学 - Python - 線型代数 - 行列式 - 積の行列式(積の行列式と行列式の積、転置行列、係数)

1. $\begin{array}{}\left(\begin{array}{cccc}a& b& c& d\\ -b& a& -d& c\\ -c& d& a& -b\\ -d& -c& b& a\end{array}\right)\end{array}\left(\begin{array}{cccc}a& -b& -c& -d\\ b& a& d& -c\\ c& -d& a& b\\ d& c& -b& a\end{array}\right)=\left(\begin{array}{cccc}{a}^{2}+{b}^{2}+{c}^{2}+{d}^{2}& 0& 0& 0\\ 0& {a}^{2}+{b}^{2}+{c}^{2}+{d}^{2}& 0& 0\\ 0& 0& {a}^{2}+{b}^{2}+{c}^{2}+{d}^{2}& 0\\ 0& 0& 0& {a}^{2}+{b}^{2}+{c}^{2}+{d}^{2}\end{array}\right)$
$\begin{array}{}\mathrm{det}\left(A{A}^{T}\right)={\left({a}^{2}+{b}^{2}+{c}^{2}+{d}^{2}\right)}^{4}\\ \mathrm{det}\left(A{A}^{T}\right)=\mathrm{det}A\mathrm{det}{A}^{T}=\mathrm{det}A\mathrm{det}A={\left(\mathrm{det}A\right)}^{2}\end{array}$

よって、

$\begin{array}{}{\left(\mathrm{det}A\right)}^{2}={\left({a}^{2}+{b}^{2}+{c}^{2}+{d}^{2}\right)}^{4}\\ \mathrm{det}A={\left({a}^{2}+{b}^{2}+{c}^{2}+{d}^{2}\right)}^{2}\end{array}$

(aの4乘の係数は1。)

コード(Emacs)

Python 3

#!/usr/bin/env python3
from sympy import pprint, symbols, Matrix, I

a, b, c, d = symbols('a, b, c, d')
A = Matrix([[a, b, c, d],
[-b, a, -d, c],
[-c, d, a, -b],
[-d, -c, b, a]])

for t in [A, A.T, A * A.T, A.det(), A.det().factor()]:
pprint(t)
print()


$./sample1.py ⎡a b c d ⎤ ⎢ ⎥ ⎢-b a -d c ⎥ ⎢ ⎥ ⎢-c d a -b⎥ ⎢ ⎥ ⎣-d -c b a ⎦ ⎡a -b -c -d⎤ ⎢ ⎥ ⎢b a d -c⎥ ⎢ ⎥ ⎢c -d a b ⎥ ⎢ ⎥ ⎣d c -b a ⎦ ⎡ 2 2 2 2 ⎤ ⎢a + b + c + d 0 0 0 ⎥ ⎢ ⎥ ⎢ 2 2 2 2 ⎥ ⎢ 0 a + b + c + d 0 0 ⎥ ⎢ ⎥ ⎢ 2 2 2 2 ⎥ ⎢ 0 0 a + b + c + d 0 ⎥ ⎢ ⎥ ⎢ 2 2 2 2⎥ ⎣ 0 0 0 a + b + c + d ⎦ 4 2 2 2 2 2 2 4 2 2 2 2 4 2 2 4 a + 2⋅a ⋅b + 2⋅a ⋅c + 2⋅a ⋅d + b + 2⋅b ⋅c + 2⋅b ⋅d + c + 2⋅c ⋅d + d 2 ⎛ 2 2 2 2⎞ ⎝a + b + c + d ⎠$