[1]:
import sympy as sp
[2]:
Tp = sp.symbols('T^p_+, T^p_-', positive=True)
Ta = sp.symbols('T^a_+, T^a_-', positive=True)

Polarization matrices for He3 cells and supermirror#

From https://www.epj-conferences.org/articles/epjconf/abs/2023/12/epjconf_ecns2023_03004/epjconf_ecns2023_03004.html

[3]:
TP = sp.ImmutableDenseMatrix([
    [Tp[0], 0, Tp[1], 0],
    [0, Tp[0], 0, Tp[1]],
    [Tp[1], 0, Tp[0], 0],
    [0, Tp[1], 0, Tp[0]],
])
TP
[3]:
$\displaystyle \left[\begin{matrix}T^{p}_{+} & 0 & T^{p}_{-} & 0\\0 & T^{p}_{+} & 0 & T^{p}_{-}\\T^{p}_{-} & 0 & T^{p}_{+} & 0\\0 & T^{p}_{-} & 0 & T^{p}_{+}\end{matrix}\right]$
[4]:
TP.inv()
[4]:
$\displaystyle \left[\begin{matrix}\frac{T^{p}_{+}}{\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}} & 0 & - \frac{T^{p}_{-}}{\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}} & 0\\0 & \frac{T^{p}_{+}}{\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}} & 0 & - \frac{T^{p}_{-}}{\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}}\\- \frac{T^{p}_{-}}{\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}} & 0 & \frac{T^{p}_{+}}{\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}} & 0\\0 & - \frac{T^{p}_{-}}{\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}} & 0 & \frac{T^{p}_{+}}{\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}}\end{matrix}\right]$
[5]:
TA = sp.ImmutableDenseMatrix([
    [Ta[0], Ta[1], 0, 0],
    [Ta[1], Ta[0], 0, 0],
    [0, 0, Ta[0], Ta[1]],
    [0, 0, Ta[1], Ta[0]],
])
TA
[5]:
$\displaystyle \left[\begin{matrix}T^{a}_{+} & T^{a}_{-} & 0 & 0\\T^{a}_{-} & T^{a}_{+} & 0 & 0\\0 & 0 & T^{a}_{+} & T^{a}_{-}\\0 & 0 & T^{a}_{-} & T^{a}_{+}\end{matrix}\right]$
[6]:
TA.inv()
[6]:
$\displaystyle \left[\begin{matrix}\frac{T^{a}_{+}}{\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}} & - \frac{T^{a}_{-}}{\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}} & 0 & 0\\- \frac{T^{a}_{-}}{\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}} & \frac{T^{a}_{+}}{\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}} & 0 & 0\\0 & 0 & \frac{T^{a}_{+}}{\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}} & - \frac{T^{a}_{-}}{\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}}\\0 & 0 & - \frac{T^{a}_{-}}{\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}} & \frac{T^{a}_{+}}{\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}}\end{matrix}\right]$

Helium cell case#

[7]:
(TA @ TP).inv().factor()
[7]:
$\displaystyle \left[\begin{matrix}\frac{T^{a}_{+} T^{p}_{+}}{\left(T^{a}_{+}\right)^{2} \left(T^{p}_{+}\right)^{2} - \left(T^{a}_{+}\right)^{2} \left(T^{p}_{-}\right)^{2} - \left(T^{a}_{-}\right)^{2} \left(T^{p}_{+}\right)^{2} + \left(T^{a}_{-}\right)^{2} \left(T^{p}_{-}\right)^{2}} & - \frac{T^{a}_{-} T^{p}_{+}}{\left(T^{a}_{+}\right)^{2} \left(T^{p}_{+}\right)^{2} - \left(T^{a}_{+}\right)^{2} \left(T^{p}_{-}\right)^{2} - \left(T^{a}_{-}\right)^{2} \left(T^{p}_{+}\right)^{2} + \left(T^{a}_{-}\right)^{2} \left(T^{p}_{-}\right)^{2}} & - \frac{T^{a}_{+} T^{p}_{-}}{\left(T^{a}_{+}\right)^{2} \left(T^{p}_{+}\right)^{2} - \left(T^{a}_{+}\right)^{2} \left(T^{p}_{-}\right)^{2} - \left(T^{a}_{-}\right)^{2} \left(T^{p}_{+}\right)^{2} + \left(T^{a}_{-}\right)^{2} \left(T^{p}_{-}\right)^{2}} & \frac{T^{a}_{-} T^{p}_{-}}{\left(T^{a}_{+}\right)^{2} \left(T^{p}_{+}\right)^{2} - \left(T^{a}_{+}\right)^{2} \left(T^{p}_{-}\right)^{2} - \left(T^{a}_{-}\right)^{2} \left(T^{p}_{+}\right)^{2} + \left(T^{a}_{-}\right)^{2} \left(T^{p}_{-}\right)^{2}}\\- \frac{T^{a}_{-} T^{p}_{+}}{\left(T^{a}_{+}\right)^{2} \left(T^{p}_{+}\right)^{2} - \left(T^{a}_{+}\right)^{2} \left(T^{p}_{-}\right)^{2} - \left(T^{a}_{-}\right)^{2} \left(T^{p}_{+}\right)^{2} + \left(T^{a}_{-}\right)^{2} \left(T^{p}_{-}\right)^{2}} & \frac{T^{a}_{+} T^{p}_{+}}{\left(T^{a}_{+}\right)^{2} \left(T^{p}_{+}\right)^{2} - \left(T^{a}_{+}\right)^{2} \left(T^{p}_{-}\right)^{2} - \left(T^{a}_{-}\right)^{2} \left(T^{p}_{+}\right)^{2} + \left(T^{a}_{-}\right)^{2} \left(T^{p}_{-}\right)^{2}} & \frac{T^{a}_{-} T^{p}_{-}}{\left(T^{a}_{+}\right)^{2} \left(T^{p}_{+}\right)^{2} - \left(T^{a}_{+}\right)^{2} \left(T^{p}_{-}\right)^{2} - \left(T^{a}_{-}\right)^{2} \left(T^{p}_{+}\right)^{2} + \left(T^{a}_{-}\right)^{2} \left(T^{p}_{-}\right)^{2}} & - \frac{T^{a}_{+} T^{p}_{-}}{\left(T^{a}_{+}\right)^{2} \left(T^{p}_{+}\right)^{2} - \left(T^{a}_{+}\right)^{2} \left(T^{p}_{-}\right)^{2} - \left(T^{a}_{-}\right)^{2} \left(T^{p}_{+}\right)^{2} + \left(T^{a}_{-}\right)^{2} \left(T^{p}_{-}\right)^{2}}\\- \frac{T^{a}_{+} T^{p}_{-}}{\left(T^{a}_{+}\right)^{2} \left(T^{p}_{+}\right)^{2} - \left(T^{a}_{+}\right)^{2} \left(T^{p}_{-}\right)^{2} - \left(T^{a}_{-}\right)^{2} \left(T^{p}_{+}\right)^{2} + \left(T^{a}_{-}\right)^{2} \left(T^{p}_{-}\right)^{2}} & \frac{T^{a}_{-} T^{p}_{-}}{\left(T^{a}_{+}\right)^{2} \left(T^{p}_{+}\right)^{2} - \left(T^{a}_{+}\right)^{2} \left(T^{p}_{-}\right)^{2} - \left(T^{a}_{-}\right)^{2} \left(T^{p}_{+}\right)^{2} + \left(T^{a}_{-}\right)^{2} \left(T^{p}_{-}\right)^{2}} & \frac{T^{a}_{+} T^{p}_{+}}{\left(T^{a}_{+}\right)^{2} \left(T^{p}_{+}\right)^{2} - \left(T^{a}_{+}\right)^{2} \left(T^{p}_{-}\right)^{2} - \left(T^{a}_{-}\right)^{2} \left(T^{p}_{+}\right)^{2} + \left(T^{a}_{-}\right)^{2} \left(T^{p}_{-}\right)^{2}} & - \frac{T^{a}_{-} T^{p}_{+}}{\left(T^{a}_{+}\right)^{2} \left(T^{p}_{+}\right)^{2} - \left(T^{a}_{+}\right)^{2} \left(T^{p}_{-}\right)^{2} - \left(T^{a}_{-}\right)^{2} \left(T^{p}_{+}\right)^{2} + \left(T^{a}_{-}\right)^{2} \left(T^{p}_{-}\right)^{2}}\\\frac{T^{a}_{-} T^{p}_{-}}{\left(T^{a}_{+}\right)^{2} \left(T^{p}_{+}\right)^{2} - \left(T^{a}_{+}\right)^{2} \left(T^{p}_{-}\right)^{2} - \left(T^{a}_{-}\right)^{2} \left(T^{p}_{+}\right)^{2} + \left(T^{a}_{-}\right)^{2} \left(T^{p}_{-}\right)^{2}} & - \frac{T^{a}_{+} T^{p}_{-}}{\left(T^{a}_{+}\right)^{2} \left(T^{p}_{+}\right)^{2} - \left(T^{a}_{+}\right)^{2} \left(T^{p}_{-}\right)^{2} - \left(T^{a}_{-}\right)^{2} \left(T^{p}_{+}\right)^{2} + \left(T^{a}_{-}\right)^{2} \left(T^{p}_{-}\right)^{2}} & - \frac{T^{a}_{-} T^{p}_{+}}{\left(T^{a}_{+}\right)^{2} \left(T^{p}_{+}\right)^{2} - \left(T^{a}_{+}\right)^{2} \left(T^{p}_{-}\right)^{2} - \left(T^{a}_{-}\right)^{2} \left(T^{p}_{+}\right)^{2} + \left(T^{a}_{-}\right)^{2} \left(T^{p}_{-}\right)^{2}} & \frac{T^{a}_{+} T^{p}_{+}}{\left(T^{a}_{+}\right)^{2} \left(T^{p}_{+}\right)^{2} - \left(T^{a}_{+}\right)^{2} \left(T^{p}_{-}\right)^{2} - \left(T^{a}_{-}\right)^{2} \left(T^{p}_{+}\right)^{2} + \left(T^{a}_{-}\right)^{2} \left(T^{p}_{-}\right)^{2}}\end{matrix}\right]$

Same denominator in all entries, maybe easier to evaluate this way:

[8]:
d = (Ta[0]**2 - Ta[1]**2) * (Tp[0]**2 - Tp[1]**2)
d
[8]:
$\displaystyle \left(\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}\right) \left(\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}\right)$
[9]:
(d * (TA @ TP).inv()).simplify()
[9]:
$\displaystyle \left[\begin{matrix}T^{a}_{+} T^{p}_{+} & - T^{a}_{-} T^{p}_{+} & - T^{a}_{+} T^{p}_{-} & T^{a}_{-} T^{p}_{-}\\- T^{a}_{-} T^{p}_{+} & T^{a}_{+} T^{p}_{+} & T^{a}_{-} T^{p}_{-} & - T^{a}_{+} T^{p}_{-}\\- T^{a}_{+} T^{p}_{-} & T^{a}_{-} T^{p}_{-} & T^{a}_{+} T^{p}_{+} & - T^{a}_{-} T^{p}_{+}\\T^{a}_{-} T^{p}_{-} & - T^{a}_{+} T^{p}_{-} & - T^{a}_{-} T^{p}_{+} & T^{a}_{+} T^{p}_{+}\end{matrix}\right]$

Supermirror case#

[10]:
f1, f2 = sp.symbols('f_1:3')
F1 = sp.ImmutableDenseMatrix([
    [1, 0, 0, 0],
    [0, 1, 0, 0],
    [1-f1, 0, f1, 0],
    [0, 1-f1, 0, f1],
])
F1
[10]:
$\displaystyle \left[\begin{matrix}1 & 0 & 0 & 0\\0 & 1 & 0 & 0\\1 - f_{1} & 0 & f_{1} & 0\\0 & 1 - f_{1} & 0 & f_{1}\end{matrix}\right]$
[11]:
F1.inv()
[11]:
$\displaystyle \left[\begin{matrix}1 & 0 & 0 & 0\\0 & 1 & 0 & 0\\1 - \frac{1}{f_{1}} & 0 & \frac{1}{f_{1}} & 0\\0 & 1 - \frac{1}{f_{1}} & 0 & \frac{1}{f_{1}}\end{matrix}\right]$
[12]:
F2 = sp.ImmutableDenseMatrix([
    [1, 0, 0, 0],
    [1-f2, f2, 0, 0],
    [0, 0, 1, 0],
    [0, 0, 1-f2, f2],
])
F2
[12]:
$\displaystyle \left[\begin{matrix}1 & 0 & 0 & 0\\1 - f_{2} & f_{2} & 0 & 0\\0 & 0 & 1 & 0\\0 & 0 & 1 - f_{2} & f_{2}\end{matrix}\right]$
[13]:
F2.inv()
[13]:
$\displaystyle \left[\begin{matrix}1 & 0 & 0 & 0\\1 - \frac{1}{f_{2}} & \frac{1}{f_{2}} & 0 & 0\\0 & 0 & 1 & 0\\0 & 0 & 1 - \frac{1}{f_{2}} & \frac{1}{f_{2}}\end{matrix}\right]$
[14]:
(TP.inv() @ F1.inv() @ F2.inv() @ TA.inv()).simplify()
[14]:
$\displaystyle \left[\begin{matrix}\frac{T^{a}_{+} \left(T^{p}_{+} f_{1} - T^{p}_{-} \left(f_{1} - 1\right)\right)}{f_{1} \left(\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}\right) \left(\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}\right)} & - \frac{T^{a}_{-} \left(T^{p}_{+} f_{1} - T^{p}_{-} \left(f_{1} - 1\right)\right)}{f_{1} \left(\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}\right) \left(\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}\right)} & - \frac{T^{a}_{+} T^{p}_{-}}{f_{1} \left(\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}\right) \left(\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}\right)} & \frac{T^{a}_{-} T^{p}_{-}}{f_{1} \left(\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}\right) \left(\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}\right)}\\\frac{\left(T^{a}_{+} \left(f_{2} - 1\right) - T^{a}_{-}\right) \left(T^{p}_{+} f_{1} - T^{p}_{-} \left(f_{1} - 1\right)\right)}{f_{1} f_{2} \left(\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}\right) \left(\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}\right)} & \frac{\left(T^{a}_{+} - T^{a}_{-} \left(f_{2} - 1\right)\right) \left(T^{p}_{+} f_{1} - T^{p}_{-} \left(f_{1} - 1\right)\right)}{f_{1} f_{2} \left(\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}\right) \left(\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}\right)} & \frac{T^{p}_{-} \left(- T^{a}_{+} \left(f_{2} - 1\right) + T^{a}_{-}\right)}{f_{1} f_{2} \left(\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}\right) \left(\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}\right)} & \frac{T^{p}_{-} \left(- T^{a}_{+} + T^{a}_{-} \left(f_{2} - 1\right)\right)}{f_{1} f_{2} \left(\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}\right) \left(\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}\right)}\\\frac{T^{a}_{+} \left(T^{p}_{+} \left(f_{1} - 1\right) - T^{p}_{-} f_{1}\right)}{f_{1} \left(\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}\right) \left(\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}\right)} & - \frac{T^{a}_{-} \left(T^{p}_{+} \left(f_{1} - 1\right) - T^{p}_{-} f_{1}\right)}{f_{1} \left(\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}\right) \left(\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}\right)} & \frac{T^{a}_{+} T^{p}_{+}}{f_{1} \left(\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}\right) \left(\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}\right)} & - \frac{T^{a}_{-} T^{p}_{+}}{f_{1} \left(\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}\right) \left(\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}\right)}\\\frac{\left(T^{a}_{+} \left(f_{2} - 1\right) - T^{a}_{-}\right) \left(T^{p}_{+} \left(f_{1} - 1\right) - T^{p}_{-} f_{1}\right)}{f_{1} f_{2} \left(\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}\right) \left(\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}\right)} & \frac{\left(T^{a}_{+} - T^{a}_{-} \left(f_{2} - 1\right)\right) \left(T^{p}_{+} \left(f_{1} - 1\right) - T^{p}_{-} f_{1}\right)}{f_{1} f_{2} \left(\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}\right) \left(\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}\right)} & \frac{T^{p}_{+} \left(T^{a}_{+} \left(f_{2} - 1\right) - T^{a}_{-}\right)}{f_{1} f_{2} \left(\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}\right) \left(\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}\right)} & \frac{T^{p}_{+} \left(T^{a}_{+} - T^{a}_{-} \left(f_{2} - 1\right)\right)}{f_{1} f_{2} \left(\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}\right) \left(\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}\right)}\end{matrix}\right]$

Latex formatting#

(For convenience)

[15]:
# Latex formatted for copying to other docs
for s in (
    '\hat{T}_P^{-1} = ' + sp.latex(TP.inv().simplify()),
    '\hat{T}_A^{-1} = ' + sp.latex(TA.inv().simplify()),
    '\hat{F}_1^{-1} = ' + sp.latex(F1.inv().simplify()),
    '\hat{F}_2^{-1} = ' + sp.latex(F2.inv().simplify()),
):
    print(s, end='\n\n')
\hat{T}_P^{-1} = \left[\begin{matrix}\frac{T^{p}_{+}}{\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}} & 0 & - \frac{T^{p}_{-}}{\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}} & 0\\0 & \frac{T^{p}_{+}}{\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}} & 0 & - \frac{T^{p}_{-}}{\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}}\\- \frac{T^{p}_{-}}{\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}} & 0 & \frac{T^{p}_{+}}{\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}} & 0\\0 & - \frac{T^{p}_{-}}{\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}} & 0 & \frac{T^{p}_{+}}{\left(T^{p}_{+}\right)^{2} - \left(T^{p}_{-}\right)^{2}}\end{matrix}\right]

\hat{T}_A^{-1} = \left[\begin{matrix}\frac{T^{a}_{+}}{\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}} & - \frac{T^{a}_{-}}{\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}} & 0 & 0\\- \frac{T^{a}_{-}}{\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}} & \frac{T^{a}_{+}}{\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}} & 0 & 0\\0 & 0 & \frac{T^{a}_{+}}{\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}} & - \frac{T^{a}_{-}}{\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}}\\0 & 0 & - \frac{T^{a}_{-}}{\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}} & \frac{T^{a}_{+}}{\left(T^{a}_{+}\right)^{2} - \left(T^{a}_{-}\right)^{2}}\end{matrix}\right]

\hat{F}_1^{-1} = \left[\begin{matrix}1 & 0 & 0 & 0\\0 & 1 & 0 & 0\\\frac{f_{1} - 1}{f_{1}} & 0 & \frac{1}{f_{1}} & 0\\0 & \frac{f_{1} - 1}{f_{1}} & 0 & \frac{1}{f_{1}}\end{matrix}\right]

\hat{F}_2^{-1} = \left[\begin{matrix}1 & 0 & 0 & 0\\\frac{f_{2} - 1}{f_{2}} & \frac{1}{f_{2}} & 0 & 0\\0 & 0 & 1 & 0\\0 & 0 & \frac{f_{2} - 1}{f_{2}} & \frac{1}{f_{2}}\end{matrix}\right]