【お知らせ】プログラミング記事の投稿はQiitaに移行しました。

クリフォード代数による回転

クリフォード代数でユークリッド空間とミンコフスキー空間の回転を計算します。

目次

今回は形式的に計算方法のみを示します。前提となるクリフォード代数については以下の記事を参照してください。

概要

四元数は回転への応用が有名です。クリフォード代数は四元数を一般化したもので、任意次元の回転が計算できます。

回転面を表す単位 2-ベクトル $p$ によってオイラーの公式を計算します。

\exp(p\,θ) =\begin{cases} \cosθ+p\sinθ & (p^2=-1) \\ \coshθ+p\sinhθ & (p^2=1) \end{cases}

※ ここでの回転面は「回転で保たれる平面」という意味です。「空間内の曲線を回転させて得られる曲面」ではありません。(参考

回転を計算するには、角度を半分にして両側から $\exp$ でベクトルを挟みます。左側の角度は逆向き(負)にします。

R_p(θ)(v):=\exp\left(-p\,\fracθ2\right)v\exp\left(p\,\fracθ2\right)

回転面 $p$ は2本のベクトル $a,b$ によって張られます。正規化のためノルムで割ります。

p:=\frac{a∧b}{|a∧b|}

$a$ から $b$ への角度を $φ$ とすれば、以下の関係が成り立ちます。

|a∧b| :=\begin{cases} |a||b|\sinφ&(p^2=-1) \\ |a||b|\sinhφ&(p^2=1) \end{cases}
a∧b =p\,|a∧b| =\begin{cases} p\,|a||b|\sinφ&(p^2=-1) \\ p\,|a||b|\sinhφ&(p^2=1) \end{cases}
\begin{aligned} ab &=\underbrace{a \cdot b}_{\text{内積}}+\underbrace{a∧b}_{\text{外積}} \\ &=\begin{cases} |a||b|(\cosφ+p\sinφ)&(p^2=-1) \\ |a||b|(\coshφ+p\sinhφ)&(p^2=1) \end{cases} \\ &=|a||b|\exp(p\,φ) \end{aligned}
\begin{aligned} R_p(2φ)(v) &=\exp(-p\,φ)v\exp(p\,φ) \\ &=\frac{ba}{|a||b|}v\frac{ab}{|a||b|} \\ &=\frac{bavab}{a²b²} \end{aligned}

※ これは2回の鏡映だと解釈できます。詳細は機会を改める予定です。

以後、$p\sinθ$ は $\sinθ\,p$ と表記します。また、マルチベクトルの基底を略記します。

\text{【例】}\ e_1e_2\ →\ e_{12}

2次元

回転面は向きの違いを除けば $e_{12}$ の1つだけです。

ユークリッド空間

$Cℓ_{2,0}(\mathbb{R})$ です。

e_1^2=e_2^2=1,\ (e_{12})^2=-1

$e _ {12}$ は $e _ 1,e _ 2$ とは非可換です。

\begin{aligned} e_{12}(e_1+e_2) &=e_{121}+e_{122} \\ &=-e_{112}-e_{212} \\ &=(e_1+e_2)(-e_{12}) \end{aligned}

非可換性に注意して exp を後ろに移動すれば、指数法則でまとめられます。

\begin{aligned} &R_{12}(θ)(xe_1+ye_2) \\ &=\exp\left(-\fracθ2e_{12}\right) (xe_1+ye_2) \exp\left(\fracθ2e_{12}\right) \\ &=(xe_1+ye_2)\exp\left(\fracθ2e_{12}\right)\exp\left(\fracθ2e_{12}\right) \\ &=(xe_1+ye_2)\exp(θe_{12}) \\ &=(xe_1+ye_2)(\cosθ+\sinθ\,e_{12}) \\ &=x\cosθ\,e_1+x\sinθ\,e_{112}+y\cosθ\,e_2+y\sinθ\,e_{212} \\ &=(x\cosθ-y\sinθ)e_1+(x\sinθ+y\cosθ)e_2 \end{aligned}

わざわざ両側から挟まないで最初から exp をまとめた方が簡単に見えますが、クリフォード代数の計算方法は任意次元に適用できる形になっています。後で見るように3次元以上では両側から挟む必要があります。

複素数

$Cℓ_{2,0}(\mathbb{R})$ の偶部分代数(スカラーと 2-ベクトル)は複素数と代数同型です。

a+be_{12}≅a+bi\quad(i^2=-1)

同じことは複素数でも計算できます。

\begin{aligned} (x+yi)\exp(θi) &=(x+yi)(\cosθ+\sinθ\,i) \\ &=(x\cosθ-y\sinθ)+(x\sinθ+y\cosθ)i \end{aligned}

可換性

複素数は可換なため、掛け算を逆にしても結果は同じです。

(x+yi)\exp(θi)=\exp(θi)(x+yi)

クリフォード代数は非可換なため、掛ける順序が重要です。

(xe_1+ye_2)\exp(θe_{12})≠\exp(θe_{12})(xe_1+ye_2)

ミンコフスキー空間

$Cℓ_{1,1}(\mathbb{R})$ です。

e_1^2=1,\ e_2^2=-1,\ (e_{12})^2=1
\begin{aligned} &R_{12}(θ)(xe_1+te_2) \\ &=\exp\left(-\fracθ2e_{12}\right) (xe_1+te_2) \exp\left(\fracθ2e_{12}\right) \\ &=(xe_1+te_2)\exp\left(\fracθ2e_{12}\right)\exp\left(\fracθ2e_{12}\right) \\ &=(xe_1+te_2)\exp(θe_{12}) \\ &=(xe_1+te_2)(\coshθ+\sinhθ\,e_{12}) \\ &=x\coshθ\,e_1+x\sinhθ\,e_{112}+t\coshθ\,e_2+t\sinhθ\,e_{212} \\ &=(x\coshθ+t\sinhθ)e_1+(x\sinhθ+t\coshθ)e_2 \end{aligned}

この種の回転を双曲回転と呼びます。

特殊相対性理論におけるローレンツブーストでの基底の変換に対応します(共変)。なお、成分は逆向き($-θ$)に変換されます(反変)。

分解型複素数

$Cℓ_{1,1}(\mathbb{R})$ の偶部分代数は分解型複素数と代数同型です。

a+be_{12}≅a+bj\quad(j^2=1)

同じことは分解型複素数でも計算できます。

\begin{aligned} (x+tj)\exp(θj) &=(x+tj)(\coshθ+\sinhθ\,j) \\ &=(x\coshθ+t\sinhθ)+(x\sinhθ+t\coshθ)j \end{aligned}

分解型複素数は可換です。

(x+tj)\exp(θj)=\exp(θj)(x+tj)

回転

ユークリッド空間とミンコフスキー空間の回転の様子を引用します。

f:id:n7shi:20200407143926p:plain

これらをクリフォード代数では $R _ p(-θ) v R _ p(θ)$ の形式で統一的に扱えます。

3次元

回転面は $e _ {12},e _ {23},e _ {31}$ の一次結合による単位 2-ベクトルで表されます。

\text{回転面}:\ p=ae_{12}+be_{23}+ce_{31}\quad(p^2=-1\text{ または }1)

$p$ は虚数単位と同一視できるため、オイラーの公式が使えます。

\exp(θp) =\begin{cases} \cosθ+\sinθ\,p & (p^2=-1)\\ \coshθ+\sinhθ\,p & (p^2=1)\\ \end{cases}

簡単のため $e _ {12}$ と $e _ {23}$ での回転を示します。

ユークリッド空間

$Cℓ_{3,0}(\mathbb{R})$ です。

e_1^2=e_2^2=e_3^2=1,\ (e_{12})^2=(e_{23})^2=(e_{31})^2=-1

$e _ {12}$ での回転を計算します。$e _ {12}$ が $e _ 1,e _ 2$ とは非可換で、$e _ 3$ とは可換なことを利用して項を分離します。

\begin{aligned} &R_{12}(θ)(xe_1+ye_2+ze_3) \\ &=\exp\left(-\fracθ2e_{12}\right) (xe_1+ye_2+ze_3) \exp\left(\fracθ2e_{12}\right) \\ &=(xe_1+ye_2)\exp\left(\fracθ2e_{12}\right)\exp\left(\fracθ2e_{12}\right) +ze_3\,\underbrace{\exp\left(-\fracθ2e_{12}\right)\exp\left(\fracθ2e_{12}\right)}_1 \\ &=(xe_1+ye_2)\exp(θe_{12})+ze_3 \\ &=(x\cosθ-y\sinθ)e_1+(x\sinθ+y\cosθ)e_2+ze_3 \end{aligned}

両側から挟むことで、注目している平面上でだけ回転が作用します。

同様に $e _ {23}$ での回転を計算します。$e _ {23}$ が $e _ 2,e _ 3$ とは非可換で、$e _ 1$ とは可換なことを利用して項を分離します。

\begin{aligned} &R_{23}(φ)(xe_1+ye_2+ze_3) \\ &=\exp\left(-\fracφ2e_{23}\right) (xe_1+ye_2+ze_3) \exp\left(\fracφ2e_{23}\right) \\ &=xe_1+(ye_2+ze_3)\exp(φe_{23}) \\ &=xe_1+(y\cosφ-z\sinφ)e_2+(y\sinφ+z\cosφ)e_3 \end{aligned}

このように非可換性が回転と関係していることが読み取れます。

なお、添え字を見れば可換かどうか判断できます。$e _ {ij}\ (i≠j)$ に対して $e _ i,e _ j$ が非可換で、それ以外の $e _ k$ が可換です。

四元数

$Cℓ_{3,0}(\mathbb{R})$ の偶部分代数は四元数と代数同型です。

a+be_{23}+ce_{31}+de_{12}≅a+bi+cj+dk

四元数でも回転が計算できます。挟み方が逆になる以外は同じです。

R'_p(θ)(v):=\exp\left(p\,\fracθ2\right)v\exp\left(-p\,\fracθ2\right)
i^2=j^2=k^2=-1,\ ij=-ji=k,\ jk=-kj=i,\ ki=-ik=j
\begin{aligned} &R'_k(θ)(xi+yj+zk) \\ &=\exp\left(\fracθ2k\right) (xi+yj+zk) \exp\left(-\fracθ2k\right) \\ &=\exp(θk)(xi+yj)+zk \\ &=(x\cosθ-y\sinθ)i+(x\sinθ+y\cosθ)j+zk \\[2ex] &R'_i(φ)(xi+yj+zk) \\ &=\exp\left(\fracφ2i\right) (xi+yj+zk) \exp\left(-\fracφ2i\right) \\ &=xi+\exp(φi)(yj+zk) \\ &=xi+(y\cosφ-z\sinφ)j+(y\sinφ+z\cosφ)k \end{aligned}

四元数ではベクトルのグレードの区別がないため、回転が面ではなく軸によって表現されます。これは3次元でのみ可能な表現です。

任意の回転軸を指定した場合については、以下の記事を参照してください。

ミンコフスキー空間

$Cℓ _ {2,1}(\mathbb{R})$ を示します。($Cℓ _ {1,2}(\mathbb{R})$ は省略します)

e_1^2=e_2^2=1,\ e_3^2=-1,\ (e_{12})^2=-1,\ (e_{23})^2=(e_{31})^2=1
\begin{aligned} &R_{12}(θ)(xe_1+ye_2+te_3) \\ &=\exp\left(-\fracθ2e_{12}\right) (xe_1+ye_2+te_3) \exp\left(\fracθ2e_{12}\right) \\ &=(xe_1+ye_2)\exp(θe_{12})+te_3 \\ &=(x\cosθ-y\sinθ)e_1+(x\sinθ+y\cosθ)e_2+te_3 \\[2ex] &R_{23}(φ)(xe_1+ye_2+te_3) \\ &=\exp\left(-\fracφ2e_{23}\right) (xe_1+ye_2+te_3) \exp\left(\fracφ2e_{23}\right) \\ &=xe_1+(ye_2+te_3)\exp(φe_{23}) \\ &=xe_1+(y\coshφ+t\sinhφ)e_2+(y\sinhφ+t\coshφ)e_3 \end{aligned}

$R_{23}$ は双曲回転になりました。

$Cℓ_{2,1}(\mathbb{R})$ の偶部分代数は分解型四元数と代数同型です。計算の比較は省略します。

4次元

回転面は $e _ {12},e _ {23},e _ {31},e _ {14},e _ {24},e _ {34}$ の一次結合による単位 2-ベクトルで表されます。

※ 一見同じ形をしていても、単位 2-ベクトルとはならないことがあるのに注意が必要です。

\begin{aligned} \text{OK}&:&\left(\frac{e_{12}+e_{23}}{\sqrt2}\right)^2&=-1 \\ \text{NG}&:&\left(\frac{e_{12}+e_{34}}{\sqrt2}\right)^2&=-1+e_{1234} \end{aligned}

$e _ {12}$ と $e _ {34}$ とその合成を考えます。

ユークリッド空間

$Cℓ_{4,0}(\mathbb{R})$ です。

e_1^2=e_2^2=e_3^2=e_4^2=1 \\ (e_{12})^2=(e_{23})^2=(e_{31})^2=(e_{14})^2=(e_{24})^2=(e_{34})^2=-1
\begin{aligned} &R_{12}(θ)(xe_1+ye_2+ze_3+we_4) \\ &=\exp\left(-\fracθ2e_{12}\right) (xe_1+ye_2+ze_3+we_4) \exp\left(\fracθ2e_{12}\right) \\ &=(xe_1+ye_2)\exp(θe_{12})+ze_3+we_4 \\ &=(x\cosθ-y\sinθ)e_1+(x\sinθ+y\cosθ)e_2+ze_3+we_4 \\[2ex] &R_{34}(φ)(xe_1+ye_2+ze_3+we_4) \\ &=\exp\left(-\fracφ2e_{34}\right) (xe_1+ye_2+ze_3+we_4) \exp\left(\fracφ2e_{34}\right) \\ &=xe_1+ye_2+(ze_3+we_4)\exp(φe_{34}) \\ &=xe_1+ye_2+(z\cosφ-w\sinφ)e_3+(z\sinφ+w\cosφ)e_4 \end{aligned}

合成

ここまで計算した2つの回転を合成します。$R _ {12}$ と $R _ {34}$ は可換なため、指数法則でまとめられます。

\begin{aligned} &R_{34}(φ)∘R_{12}(θ)(xe_1+ye_2+ze_3+we_4) \\ &=\exp\left(-\fracθ2e_{12}-\fracφ2e_{34}\right) (xe_1+ye_2+ze_3+we_4) \exp\left(\fracθ2e_{12}+\fracφ2e_{34}\right) \\ &=(xe_1+ye_2)\exp(θe_{12})+(ze_3+we_4)\exp(φe_{34}) \\ &=(x\cosθ-y\sinθ)e_1+(x\sinθ+y\cosθ)e_2 \\ &\quad+(z\cosφ-w\sinφ)e_3+(z\sinφ+w\cosφ)e_4 \end{aligned}

2平面上の独立した回転をまとめていると解釈できます。$e _ {12}$ と $e _ {34}$ が可換であることは、それらの上での回転が独立していることと対応します。

1面での回転を simple rotation、その合成による2面での同時回転を double rotation と呼びます。特に $θ=±φ$ の場合を isoclinic rotation と呼びます。

【参考】Rotations in 4-dimensional Euclidean space - Wikipedia

四元数

$Cℓ_{4,0}(\mathbb{R})$ の偶部分代数は分解型双四元数と代数同型です。

しかし分解型双四元数を持ち出さなくても、4次元でも四元数によって計算できます。

\begin{aligned} &R'_k(θ)(xi+yj+zk+w) \\ &=\exp\left(\fracθ2k\right) (xi+yj+zk+w) \exp\left(-\fracθ2k\right) \\ &=\exp(θk)(xi+yj)+zk+w \\ &=(x\cosθ-y\sinθ)i+(x\sinθ+y\cosθ)j+zk+w \end{aligned}

$k$ と実部をペアにして回転させるには、基底をずらして回転後に戻します(赤字部分)。独立した平面の別の方に切り替えるようなイメージです。

\begin{aligned} &\textcolor{red}{-j}R'_k(φ)\{\textcolor{red}{j}(xi+yj+zk+w)\} \\ &=\textcolor{red}{-j}\exp\left(\fracφ2k\right) \textcolor{red}{j}(xi+yj+zk+w) \exp\left(-\fracφ2k\right) \\ &=\textcolor{red}{-j}\exp\left(\fracφ2k\right) (-xk-y+zi+wj) \exp\left(-\fracφ2k\right) \\ &=\textcolor{red}{-j}\{-xk-y+\exp(φk)(zi+wj)\} \\ &=\textcolor{red}{-j}\{-xk-y+(z\cosφ-w\sinφ)i+(z\sinφ+w\cosφ)j\} \\ &=xi+yj+(z\cosφ-w\sinφ)k+(z\sinφ+w\cosφ) \end{aligned}

四元数は結合的なため、$-j\exp\left(\fracφ2k\right)j$ を先に計算できます。

\begin{aligned} -j\exp\left(\fracφ2k\right)j &=-j\left(\cos\fracφ2+\sin\fracφ2\,k\right)j \\ &=\left(\cos\fracφ2-\sin\fracφ2\,k\right) \\ &=\exp\left(-\fracφ2\,k\right) \end{aligned}

回転を合成します。(double rotation)

\begin{aligned} &-jR'_k(φ)\{jR'_k(θ)(xi+yj+zk+w)\} \\ &=-j\exp\left(\fracφ2\,k\right)j \exp\left(\fracθ2\,k\right) (xi+yj+zk+w) \exp\left(-\fracθ2\,k\right) \exp\left(-\fracφ2\,k\right) \\ &=\exp\left(-\fracφ2\,k\right) \exp\left(\fracθ2\,k\right) (xi+yj+zk+w) \exp\left(-\fracθ2\,k\right) \exp\left(-\fracφ2\,k\right) \\ &=\exp\left(\frac{θ-φ}2k\right) (xi+yj+zk+w) \exp\left(-\frac{θ+φ}2k\right) \\ &=\exp(θk)(xi+yj)+\exp(-φk)(zk+w) \\ &=(x\cosθ-y\sinθ)i+(x\sinθ+y\cosθ)j \\ &\quad+(z\cosφ-w\sinφ)k+(z\sinφ+w\cosφ) \end{aligned}

$φ=±θ$ の場合に片側の作用が消えます。(isoclinic rotation)

\begin{aligned} φ=θ&:& \underbrace{\exp\left(\frac{θ-θ}2k\right)}_1 (xi+yj+zk+w) \exp\left(-\frac{θ+θ}2k\right) \\ φ=-θ&:& \exp\left(\frac{θ+θ}2k\right) (xi+yj+zk+w) \underbrace{\exp\left(-\frac{θ-θ}2k\right)}_1 \end{aligned}

1つの回転 (simple rotation) を左右から挟んで表現する形式は、2つの isoclinic rotation への分解だと捉えて isoclinic decomposition と呼びます。1つの回転が分解されて表現されることから、$θ$ が2分割されて各々 $\fracθ2$ として現れると解釈できます。

このように4次元での四元数の振る舞いは3次元に比べて複雑です。クリフォード代数は3次元での四元数の流儀を任意次元に拡張したものだと言えます。

ミンコフスキー空間

$Cℓ _ {3,1}(\mathbb{R})$ を示します。($Cℓ _ {2,2}(\mathbb{R}),Cℓ _ {1,3}(\mathbb{R})$ は省略します)

e_1^2=e_2^2=e_3^2=1,\ e_4^2=-1 \\ (e_{12})^2=(e_{23})^2=(e_{31})^2=-1,\ (e_{14})^2=(e_{24})^2=(e_{34})^2=1
\begin{aligned} &R_{12}(θ)(xe_1+ye_2+ze_3+te_4) \\ &=\exp\left(-\fracθ2e_{12}\right) (xe_1+ye_2+ze_3+te_4) \exp\left(\fracθ2e_{12}\right) \\ &=(xe_1+ye_2)\exp(θe_{12})+ze_3+te_4 \\ &=(x\cosθ-y\sinθ)e_1+(x\sinθ+y\cosθ)e_2+ze_3+te_4 \\[2ex] &R_{34}(φ)(xe_1+ye_2+ze_3+te_4) \\ &=\exp\left(-\fracφ2e_{34}\right) (xe_1+ye_2+ze_3+te_4) \exp\left(\fracφ2e_{34}\right) \\ &=xe_1+ye_2+(ze_3+te_4)\exp(φe_{34}) \\ &=xe_1+ye_2+(z\coshφ+t\sinhφ)e_3+(z\sinhφ+t\coshφ)e_4 \end{aligned}

合成

\begin{aligned} &R_{34}(φ)∘R_{12}(θ)(xe_1+ye_2+ze_3+te_4) \\ &=\exp\left(-\fracθ2e_{12}-\fracφ2e_{34}\right) (xe_1+ye_2+ze_3+te_4) \exp\left(\fracθ2e_{12}+\fracφ2e_{34}\right) \\ &=(xe_1+ye_2)\exp(θe_{12})+(ze_3+te_4)\exp(φe_{34}) \\ &=(x\cosθ-y\sinθ)e_1+(x\sinθ+y\cosθ)e_2 \\ &\quad+(z\coshφ+t\sinhφ)e_3+(z\sinhφ+t\coshφ)e_4 \end{aligned}

$Cℓ_{3,1}(\mathbb{R})$ の偶部分代数は双四元数と代数同型です。計算の比較は省略します。

5次元

これまでと同じ要領で計算できます。ユークリッド空間の double rotation を示します。

ベクトルの成分が増えたため $x,y,z,\cdots$ ではなく上付き添え字 $x ^ i$ で示します。上付き添え字と区別するため、冪乗は括弧で囲みます。

Cℓ_{5,0}(\mathbb{R}):\ (e_1)^2=\cdots=(e_5)^2=1,\ (e_{12})^2=(e_{34})^2=-1
\begin{aligned} &R_{34}(θ_2)∘R_{12}(θ_1)(x^1e_1+x^2e_2+x^3e_3+x^4e_4+x^5e_5) \\ &=(x^1e_1+x^2e_2)\exp(θ_1e_{12})+(x^3e_3+x^4e_4)\exp(θ_2e_{34})+x^5e_5 \\ &=(x^1\cosθ_1-x^2\sinθ_1)e_1+(x^1\sinθ_1+x^2\cosθ_1)e_2 \\ &\quad+(x^3\cosθ_2-x^4\sinθ_2)e_3+(x^3\sinθ_2+x^4\cosθ_2)e_4 \\ &\quad+x^5e_5 \end{aligned}

6次元

独立な回転面が3つに増えます。ユークリッド空間の triple rotation を示します。

Cℓ_{6,0}(\mathbb{R}):\ (e_1)^2=\cdots=(e_6)^2=1,\ (e_{12})^2=(e_{34})^2=(e_{56})^2=-1
\begin{aligned} &R_{56}(θ_3)∘R_{34}(θ_2)∘R_{12}(θ_1)(x^1e_1+\cdots+x^6e_6) \\ &=(x^1e_1+x^2e_2)\exp(θ_1e_{12}) \\ &\quad+(x^3e_3+x^4e_4)\exp(θ_2e_{34}) \\ &\quad+(x^5e_5+x^6e_6)\exp(θ_3e_{56}) \\ &=(x^1\cosθ_1-x^2\sinθ_1)e_1+(x^1\sinθ_1+x^2\cosθ_1)e_2 \\ &\quad+(x^3\cosθ_2-x^4\sinθ_2)e_3+(x^3\sinθ_2+x^4\cosθ_2)e_4 \\ &\quad+(x^5\cosθ_3-x^6\sinθ_3)e_5+(x^5\sinθ_3+x^6\cosθ_3)e_6 \end{aligned}

7次元以上

次元が上がっても同様に計算できます。

3次元や4次元で四元数と比較したのと同様に、7次元や8次元で八元数と比較してみると面白いかもしれません。

参考

Wikipedia を参照しました。

次の記事では2次元の場合が扱われています。途中までの説明は分かりやすいのですが、最後の "Not so fast" で計算を間違えています。

次の資料では、四元数八元数の回転について説明されています。

次の資料には、回転の原理について説明されています。

  • 風間洋一『3 相対論的な古典場』

    逆に、この代数から出発して、$ψ$ に対するスピナー表現 $\mathcal{D}^{\frac120}⊕\mathcal{D}^{0\frac12}$ を作ることもできるが、その方法では Clifford 代数の出所が明確にならない。しかし、他の次元での Dirac 方程式を得るには、Clifford 代数から出発する方法の方がはるかに便利である。