学習環境
- Surface 3 (4G LTE)、Surface 3 タイプ カバー、Surface ペン(端末)
- Windows 10 Pro (OS)
- Nebo(Windows アプリ)
- iPad Pro + Apple Pencil
- MyScript Nebo(iPad アプリ)
- 参考書籍
ラング線形代数学(上)(S.ラング (著)、芹沢 正三 (翻訳)、ちくま学芸文庫)の7章(スカラー積と直交性)、2(正値スカラー積)、練習問題6-(a)、(b).を取り組んでみる。
直交基底。
正規直交基底。
正規直交基底。
コード(Emacs)
Python 3
#!/usr/bin/env python3 from sympy import pprint, symbols, Matrix, sqrt, I print('6.') def hermitian_product(a, b): return a.dot(b.H).simplify() m = [(1 / sqrt(3) * Matrix([[1, 1, 1]]), 1 / (2 * sqrt(3)) * Matrix([[2 - I, - 1 + 2 * I, -1 - I]])), (1 / sqrt(3) * Matrix([[1, -1, -I]]), 1 / (2 * sqrt(6)) * Matrix([[1, 2 + 3 * I, 3 - I]]))] for i, (v, w) in enumerate(m): print(f'({chr(ord("a") + i)})') for t in [v, w, hermitian_product(v, w)]: pprint(t) print() print()
入出力結果(Terminal, Jupyter(IPython))
$ ./sample6.py 6. (a) ⎡√3 √3 √3⎤ ⎢── ── ──⎥ ⎣3 3 3 ⎦ ⎡√3⋅(2 - ⅈ) √3⋅(-1 + 2⋅ⅈ) √3⋅(-1 - ⅈ)⎤ ⎢────────── ───────────── ───────────⎥ ⎣ 6 6 6 ⎦ 0 (b) ⎡√3 -√3 -√3⋅ⅈ ⎤ ⎢── ──── ──────⎥ ⎣3 3 3 ⎦ ⎡√6 √6⋅(2 + 3⋅ⅈ) √6⋅(3 - ⅈ)⎤ ⎢── ──────────── ──────────⎥ ⎣12 12 12 ⎦ 0 $
0 コメント:
コメントを投稿