# R(2,2) playground
Ted Corcovilos, 2021-01-08

Playing around with the 2d "mother algebra" $R(2,2)$, as described in C. Doran, et al., "Lie Groups as Spin Groups," *Journal of Mathematical Physics 34*, 3642 (1993). doi:[10.1063/1.530050](http://doi.org/10.1063/1.530050)

I'll name the basis vectors $p_1, p_2, m_1, m_2$ with the diagonal metric $[1,1,-1,-1]$.

Position vectors in this basis are represented by null vectors of the form $x (p_1+m_1) + y (p_2+m_2)$.


```python
from sympy import *
from galgebra.ga import Ga
from galgebra.printer import latex
from IPython.display import Math

init_printing(latex_printer=latex, use_latex='mathjax')
```


```python
xy = (x,y) = symbols("x y", real=True)
```


```python
xyxy = (xp, yp, xm, ym) = symbols("xp yp xm ym", real=True)
```


```python
R22 = Ga('p1 p2 m1 m2', g=[1,1,-1,-1], coords=xyxy)
```


```python
p1, p2, m1, m2 = R22.mv() # break out basis vectors
```


```python
# a real position vector has the form...
r = x*(p1+m1)+y*(p2+m2)
```


```python
r
```




\begin{equation*} x \boldsymbol{p}_{1} + y \boldsymbol{p}_{2} + x \boldsymbol{m}_{1} + y \boldsymbol{m}_{2} \end{equation*}




```python
a, b, c, d = symbols("a b c d", real=True)
f, g, h, j = symbols("f g h j", real=True)
```


```python
# big pseudoscalar
I=p1^p2^m1^m2
# special bivectors (ref. Doran)
K = (p1^m1)+(p2^m2)
E = (p1^p2)+(m1^m2)
F = (p1^m2)+(p2^m1)
```

From the paper, only bivectors that commute with $K$ will preserve null vectors. $E$ corresponds to the pseudo-scalar in the 2d position space. $F$ is the leftover bit needed to complete the bivector space.  Geometrically, $K$ describes scaling, $E$ rotations, and $F$ shears.


```python
B1 = a*(p1^m1)+b*(p2^m2)+c*(p1^m2)+d*(p2^m1)+f*(p1^p2)+g*(m1^m2)
```


```python
# check if commutator is zero
B1 >> K
```




\begin{equation*} \left ( c - d\right ) \boldsymbol{p}_{1}\wedge \boldsymbol{p}_{2} + \left ( f + g\right ) \boldsymbol{p}_{1}\wedge \boldsymbol{m}_{2} + \left ( - f - g\right ) \boldsymbol{p}_{2}\wedge \boldsymbol{m}_{1} + \left ( c - d\right ) \boldsymbol{m}_{1}\wedge \boldsymbol{m}_{2} \end{equation*}




```python
# So, this will be zero iff c=d and f=-g
# Redefine, change up the names a bit:
B1 = (a+b)/2*(p1^m1)+(a-b)/2*(p2^m2)+c/2*(p1^m2)+c/2*(p2^m1)+d/2*(p1^p2)-d/2*(m1^m2)
```


```python
# check commutator again
B1 >> K
```




\begin{equation*}  0  \end{equation*}




```python
# also need to normalize B1
# the norm squared is
Bnorm2=(B1*(B1.rev())).scalar()
```


```python
A, B, C, D = symbols("A B C D", real=True)
```

Let's break `B1` down term by term to see how it transforms position.


```python
# Define a small number as a placeholder to go from members of the Lie algebra to the Lie group
ϵ = symbols("ϵ", real=True)
```

Look at each bivector in the Lie algebra and see how the corresponding Lie group member transforms a position vector.


```python
# for the "a" term
((-ϵ*p1^m1/2).exp())*r*((ϵ*p1^m1/2).exp())
```




\begin{equation*} x e^{ϵ} \boldsymbol{p}_{1} + y \boldsymbol{p}_{2} + x e^{ϵ} \boldsymbol{m}_{1} + y \boldsymbol{m}_{2} \end{equation*}



So, the $p_1 \wedge m_1$ term looks like a scaling of $x$.


```python
# for the "b" term
((-ϵ*p2^m2/2).exp())*r*((ϵ*p2^m2/2).exp())
```




\begin{equation*} x \boldsymbol{p}_{1} + y e^{ϵ} \boldsymbol{p}_{2} + x \boldsymbol{m}_{1} + y e^{ϵ} \boldsymbol{m}_{2} \end{equation*}



Scaling of $y$, as expected.


```python
# confirm that the a and b pieces commute:
(p1^m1) >> (p2^m2)
```




\begin{equation*}  0  \end{equation*}




```python
# commuting Lie algebra elements => we can apply the exponentials individually
# overall scaling
(-ϵ*p1^m1/2).exp()*((-ϵ*p2^m2/2).exp())*r*((ϵ*p2^m2/2).exp())*(ϵ*p1^m1/2).exp()
```




\begin{equation*} x e^{ϵ} \boldsymbol{p}_{1} + y e^{ϵ} \boldsymbol{p}_{2} + x e^{ϵ} \boldsymbol{m}_{1} + y e^{ϵ} \boldsymbol{m}_{2} \end{equation*}




```python
# inverse scaling (is there a better name?)
(-ϵ*p1^m1/2).exp()*((ϵ*p2^m2/2).exp())*r*((-ϵ*p2^m2/2).exp())*(ϵ*p1^m1/2).exp()
```




\begin{equation*} x e^{ϵ} \boldsymbol{p}_{1} + y e^{- ϵ} \boldsymbol{p}_{2} + x e^{ϵ} \boldsymbol{m}_{1} + y e^{- ϵ} \boldsymbol{m}_{2} \end{equation*}




```python
# check the pieces of the c term for commuting
(p1^m2) >> (p2^m1)
```




\begin{equation*}  0  \end{equation*}




```python
# the c term 
(-ϵ*p1^m2/2).exp()*((-ϵ*p2^m1/2).exp())*r*((ϵ*p2^m1/2).exp())*(ϵ*p1^m2/2).exp()
```




\begin{equation*} \left ( x \cosh{\left (ϵ \right )} + y \sinh{\left (ϵ \right )}\right ) \boldsymbol{p}_{1} + \left ( x \sinh{\left (ϵ \right )} + y \cosh{\left (ϵ \right )}\right ) \boldsymbol{p}_{2} + \left ( x \cosh{\left (ϵ \right )} + y \sinh{\left (ϵ \right )}\right ) \boldsymbol{m}_{1} + \left ( x \sinh{\left (ϵ \right )} + y \cosh{\left (ϵ \right )}\right ) \boldsymbol{m}_{2} \end{equation*}



Scissor shear? (Not really a boost because this isn't Minkowski space...)


```python
#check the d term for commuting:
(p1^p2) >> (m1^m2)
```




\begin{equation*}  0  \end{equation*}




```python
# the d term
(-ϵ*p1^p2/2).exp()*(ϵ*m1^m2/2).exp()*r*(-ϵ*m1^m2/2).exp()*(ϵ*p1^p2/2).exp()
```




\begin{equation*} \left ( x \cos{\left (ϵ \right )} - y \sin{\left (ϵ \right )}\right ) \boldsymbol{p}_{1} + \left ( x \sin{\left (ϵ \right )} + y \cos{\left (ϵ \right )}\right ) \boldsymbol{p}_{2} + \left ( x \cos{\left (ϵ \right )} - y \sin{\left (ϵ \right )}\right ) \boldsymbol{m}_{1} + \left ( x \sin{\left (ϵ \right )} + y \cos{\left (ϵ \right )}\right ) \boldsymbol{m}_{2} \end{equation*}



Rotation.

So, the matrix version of these terms looks something like
$$
\begin{array}{cc}
a \rightarrow \begin{pmatrix} e^A & 0 \\ 0 & e^A \end{pmatrix}
&
b \rightarrow \begin{pmatrix} e^B & 0 \\ 0 & e^{-B} \end{pmatrix}
\\
c \rightarrow \begin{pmatrix} \cosh C & \sinh C \\ \sinh C & \cosh C \end{pmatrix}
&
d \rightarrow \begin{pmatrix} \cos D & -\sin D \\ \sin D & \cos D \end{pmatrix}
\end{array}
$$

Note that these do not mutually commute, so it's hard to decouple a generic matrix into these pieces.

Also, these are all positive-definite matrices, so we're not covering the full GL group.  Need one more piece:
$$
m \rightarrow \begin{pmatrix} 1 & 0 \\ 0 & \pm 1 \end{pmatrix}
$$
to cover reflections.

Stepping back, we can identify the 4 Lie algebra generators as the identity and the (real) Pauli matrices, demonstrating the isomorphism between the bivectors and spinors.


```python
# for example σ_x:
simplify(exp(C*Matrix([[0,1],[1,0]])))
```




$\displaystyle \left[\begin{array}{cc}\cosh{\left (C \right )} & \sinh{\left (C \right )}\\\sinh{\left (C \right )} & \cosh{\left (C \right )}\end{array}\right]$




```python
# σ_y
simplify(exp(D*Matrix([[0,-1],[1,0]])))
```




$\displaystyle \left[\begin{array}{cc}\cos{\left (D \right )} & - \sin{\left (D \right )}\\\sin{\left (D \right )} & \cos{\left (D \right )}\end{array}\right]$




```python
# σ_z
simplify(exp(B*Matrix([[1,0],[0,-1]])))
```




$\displaystyle \left[\begin{array}{cc}e^{B} & 0\\0 & e^{- B}\end{array}\right]$




```python
# I
simplify(exp(A*Matrix([[1,0],[0,1]])))
```




$\displaystyle \left[\begin{array}{cc}e^{A} & 0\\0 & e^{A}\end{array}\right]$



We can combine the last three terms and simplify using the axis-angle formula for SU(2).  (Need to use complex values?)

This still leaves the open problem of decomposing a generic 2x2 matrix into a product of the operators above.   The linear algebra solution is straight-forward but tedious.  Does GA give us any shortcuts?


```python

```

db9f4202f01771b3c4b8ecf99512a5878be1504f
ipynb
Jupyter Notebook
R22.ipynb
corcoted/GA-scratch
a7ba5da5fa758f52330c4e1218d56c2e193a3091
MIT
R22.ipynb
corcoted/GA-scratch
a7ba5da5fa758f52330c4e1218d56c2e193a3091
MIT
R22.ipynb
corcoted/GA-scratch
a7ba5da5fa758f52330c4e1218d56c2e193a3091
MIT
Qwen/Qwen-72B
1. YES
2. YES