## 2017年11月23日木曜日

### 数学 - Python - 線型代数 - 複素数、複素ベクトル空間 - 複素数(共役、加法、乗法と除法)

1. 和、差の共役について。

$\begin{array}{}\alpha =a+bi\\ \beta =c+di\\ a,b,c,d\in \text{ℝ}\end{array}$

とおく。

$\begin{array}{}\stackrel{-}{\alpha ±\beta }\\ =\stackrel{-}{\left(a±c\right)+\left(b±d\right)i}\\ =\left(a±c\right)-\left(b±d\right)i\\ =\left(a-bi\right)±\left(c-di\right)\\ =\stackrel{-}{\alpha }±\stackrel{-}{\beta }\end{array}$

積の共役について。

$\begin{array}{}\stackrel{-}{\alpha \beta }\\ =\stackrel{-}{\left(ac-bd\right)+\left(ad+bc\right)i}\\ =\left(ac-bd\right)-\left(ad+bc\right)i\\ \stackrel{-}{\alpha }\stackrel{-}{\beta }\\ =\left(a-bi\right)\left(c-di\right)\\ =\left(ac-bd\right)-\left(ad+bc\right)i\\ \stackrel{-}{\alpha \beta }=\stackrel{-}{\alpha }\stackrel{-}{\beta }\end{array}$

商の共役について。

$\begin{array}{}\frac{}{\left(\frac{\alpha }{\beta }\right)}\\ =\stackrel{-}{\left(\frac{\alpha \stackrel{-}{\beta }}{\beta \stackrel{-}{\beta }}\right)}\\ =\stackrel{-}{\left(\frac{\left(a+bi\right)\left(c-di\right)}{{c}^{2}+{d}^{2}}\right)}\\ =\stackrel{-}{\left(\frac{\left(ac+bd\right)+\left(-ad+bc\right)i}{{c}^{2}+{d}^{2}}\right)}\\ =\frac{\left(ac+bd\right)+{\left(ad-hc\right)}^{i}}{{c}^{2}+{d}^{2}}\end{array}$
$\begin{array}{}\frac{\stackrel{-}{\alpha }}{\stackrel{-}{\beta }}\\ =\frac{a-bi}{c-di}\\ =\frac{\left(a-bi\right)\left(c+di\right)}{{c}^{2}+{d}^{2}}\\ =\frac{\left(ac+bd\right)+\left(ad-bc\right)i}{{c}^{2}+{d}^{2}}\end{array}$

よって、

$\stackrel{-}{\left(\frac{\alpha }{\beta }\right)}=\frac{\stackrel{-}{\alpha }}{\stackrel{-}{\beta }}$

コード(Emacs)

Python 3

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

print('2.')
a, b = symbols('a, b')

nums = [((a + b).conjugate(), a.conjugate() + b.conjugate()),
((a - b).conjugate(), a.conjugate() - b.conjugate()),
((a * b).conjugate(), a.conjugate() * b.conjugate()),
((a / b).conjugate(), a.conjugate() / b.conjugate())]

for (x, y) in nums:
for t in [x, y, x == y]:
pprint(t)
print()
print()


$./sample2.py 2. _ _ a + b _ _ a + b True _ _ a - b _ _ a - b True _ _ a⋅b _ _ a⋅b True _ a ─ _ b _ a ─ _ b True$