PyOR Quantum
Author: Vineeth Thalakottoor
Introduction to Spin Operators (Two Spins)
[1]:
# Define the source path
SourcePath = '/media/HD2/Vineeth/PostDoc_Simulations/Github/PyOR_V1/PyOR_Combined/PyOR/Source_Doc'
# Add source path
import sys
sys.path.append(SourcePath)
# Import PyOR package
from PyOR_QuantumSystem import QuantumSystem as QunS
[2]:
# Define the spin system
Spin_list = {"A" : "H1", "B" : "H2"}
QS = QunS(Spin_list,PrintDefault=False)
# initialize the system
QS.Initialize()
[3]:
# "X" spin operator, Particle A
QS.Ax.matrix
[3]:
$\displaystyle \left[\begin{matrix}0 & 0 & 0 & 0.5 & 0 & 0\\0 & 0 & 0 & 0 & 0.5 & 0\\0 & 0 & 0 & 0 & 0 & 0.5\\0.5 & 0 & 0 & 0 & 0 & 0\\0 & 0.5 & 0 & 0 & 0 & 0\\0 & 0 & 0.5 & 0 & 0 & 0\end{matrix}\right]$
[4]:
# "X" spin operator, Particle B
QS.Bx.matrix
[4]:
$\displaystyle \left[\begin{matrix}0 & 0.70710676908493 & 0 & 0 & 0 & 0\\0.70710676908493 & 0 & 0.70710676908493 & 0 & 0 & 0\\0 & 0.70710676908493 & 0 & 0 & 0 & 0\\0 & 0 & 0 & 0 & 0.70710676908493 & 0\\0 & 0 & 0 & 0.70710676908493 & 0 & 0.70710676908493\\0 & 0 & 0 & 0 & 0.70710676908493 & 0\end{matrix}\right]$
[5]:
# "Y" spin operator, Particle A
QS.Ay.matrix
[5]:
$\displaystyle \left[\begin{matrix}0 & 0 & 0 & - 0.5 i & 0 & 0\\0 & 0 & 0 & 0 & - 0.5 i & 0\\0 & 0 & 0 & 0 & 0 & - 0.5 i\\0.5 i & 0 & 0 & 0 & 0 & 0\\0 & 0.5 i & 0 & 0 & 0 & 0\\0 & 0 & 0.5 i & 0 & 0 & 0\end{matrix}\right]$
[6]:
# "Y" spin operator, Particle B
QS.By.matrix
[6]:
$\displaystyle \left[\begin{matrix}0 & - 0.70710676908493 i & 0 & 0 & 0 & 0\\0.70710676908493 i & 0 & - 0.70710676908493 i & 0 & 0 & 0\\0 & 0.70710676908493 i & 0 & 0 & 0 & 0\\0 & 0 & 0 & 0 & - 0.70710676908493 i & 0\\0 & 0 & 0 & 0.70710676908493 i & 0 & - 0.70710676908493 i\\0 & 0 & 0 & 0 & 0.70710676908493 i & 0\end{matrix}\right]$
[7]:
# "Z" spin operator, Particle A
QS.Az.matrix
[7]:
$\displaystyle \left[\begin{matrix}0.5 & 0 & 0 & 0 & 0 & 0\\0 & 0.5 & 0 & 0 & 0 & 0\\0 & 0 & 0.5 & 0 & 0 & 0\\0 & 0 & 0 & -0.5 & 0 & 0\\0 & 0 & 0 & 0 & -0.5 & 0\\0 & 0 & 0 & 0 & 0 & -0.5\end{matrix}\right]$
[8]:
# "Z" spin operator, Particle B
QS.Bz.matrix
[8]:
$\displaystyle \left[\begin{matrix}1.0 & 0 & 0 & 0 & 0 & 0\\0 & 0 & 0 & 0 & 0 & 0\\0 & 0 & -1.0 & 0 & 0 & 0\\0 & 0 & 0 & 1.0 & 0 & 0\\0 & 0 & 0 & 0 & 0 & 0\\0 & 0 & 0 & 0 & 0 & -1.0\end{matrix}\right]$
[9]:
# "+"" spin operator, Particle A
QS.Ap.matrix
[9]:
$\displaystyle \left[\begin{matrix}0 & 0 & 0 & 1.0 & 0 & 0\\0 & 0 & 0 & 0 & 1.0 & 0\\0 & 0 & 0 & 0 & 0 & 1.0\\0 & 0 & 0 & 0 & 0 & 0\\0 & 0 & 0 & 0 & 0 & 0\\0 & 0 & 0 & 0 & 0 & 0\end{matrix}\right]$
[10]:
# "+"" spin operator, Particle B
QS.Bp.matrix
[10]:
$\displaystyle \left[\begin{matrix}0 & 1.41421353816986 & 0 & 0 & 0 & 0\\0 & 0 & 1.41421353816986 & 0 & 0 & 0\\0 & 0 & 0 & 0 & 0 & 0\\0 & 0 & 0 & 0 & 1.41421353816986 & 0\\0 & 0 & 0 & 0 & 0 & 1.41421353816986\\0 & 0 & 0 & 0 & 0 & 0\end{matrix}\right]$
[11]:
# "-"" spin operator, Particle A
QS.Am.matrix
[11]:
$\displaystyle \left[\begin{matrix}0 & 0 & 0 & 0 & 0 & 0\\0 & 0 & 0 & 0 & 0 & 0\\0 & 0 & 0 & 0 & 0 & 0\\1.0 & 0 & 0 & 0 & 0 & 0\\0 & 1.0 & 0 & 0 & 0 & 0\\0 & 0 & 1.0 & 0 & 0 & 0\end{matrix}\right]$
[12]:
# "-"" spin operator, Particle B
QS.Bm.matrix
[12]:
$\displaystyle \left[\begin{matrix}0 & 0 & 0 & 0 & 0 & 0\\1.41421353816986 & 0 & 0 & 0 & 0 & 0\\0 & 1.41421353816986 & 0 & 0 & 0 & 0\\0 & 0 & 0 & 0 & 0 & 0\\0 & 0 & 0 & 1.41421353816986 & 0 & 0\\0 & 0 & 0 & 0 & 1.41421353816986 & 0\end{matrix}\right]$
[13]:
# "X" spin operator sub-system, Particle A
QS.Ax_sub.matrix
[13]:
$\displaystyle \left[\begin{matrix}0 & 0.5\\0.5 & 0\end{matrix}\right]$
[14]:
# "X" spin operator sub-system, Particle B
QS.Bx_sub.matrix
[14]:
$\displaystyle \left[\begin{matrix}0 & 0.70710676908493 & 0\\0.70710676908493 & 0 & 0.70710676908493\\0 & 0.70710676908493 & 0\end{matrix}\right]$
[15]:
# "Y" spin operator sub-system, Particle A
QS.Ay_sub.matrix
[15]:
$\displaystyle \left[\begin{matrix}0 & - 0.5 i\\0.5 i & 0\end{matrix}\right]$
[16]:
# "Y" spin operator sub-system, Particle B
QS.By_sub.matrix
[16]:
$\displaystyle \left[\begin{matrix}0 & - 0.70710676908493 i & 0\\0.70710676908493 i & 0 & - 0.70710676908493 i\\0 & 0.70710676908493 i & 0\end{matrix}\right]$
[17]:
# "Z" spin operator sub-system, Particle A
QS.Az_sub.matrix
[17]:
$\displaystyle \left[\begin{matrix}0.5 & 0\\0 & -0.5\end{matrix}\right]$
[18]:
# "Z" spin operator sub-system, Particle B
QS.Bz_sub.matrix
[18]:
$\displaystyle \left[\begin{matrix}1.0 & 0 & 0\\0 & 0 & 0\\0 & 0 & -1.0\end{matrix}\right]$
[19]:
# "+" spin operator sub-system, Particle A
QS.Ap_sub.matrix
[19]:
$\displaystyle \left[\begin{matrix}0 & 1.0\\0 & 0\end{matrix}\right]$
[20]:
# "+" spin operator sub-system, Particle B
QS.Bp_sub.matrix
[20]:
$\displaystyle \left[\begin{matrix}0 & 1.41421353816986 & 0\\0 & 0 & 1.41421353816986\\0 & 0 & 0\end{matrix}\right]$
[21]:
# "-" spin operator sub-system, Particle A
QS.Am_sub.matrix
[21]:
$\displaystyle \left[\begin{matrix}0 & 0\\1.0 & 0\end{matrix}\right]$
[22]:
# "-" spin operator sub-system, Particle B
QS.Bm_sub.matrix
[22]:
$\displaystyle \left[\begin{matrix}0 & 0 & 0\\1.41421353816986 & 0 & 0\\0 & 1.41421353816986 & 0\end{matrix}\right]$
[23]:
# Particle Parameter: Nuclies name, Particle A
QS.A.name
[23]:
'H1'
[24]:
# Particle Parameter: Spin quantum number, Particle A
QS.A.spin
[24]:
0.5
[25]:
# Particle Parameter: gyromagnetic ratio, Particle A
QS.A.gamma
[25]:
267522000.0
[26]:
# Particle Parameter: Quadrupole vale, Particle A
QS.A.quadrupole
[26]:
0
[27]:
# Particle Parameter: Nuclies name, Particle B
QS.B.name
[27]:
'H2'
[28]:
# Particle Parameter: Spin quantum number, Particle B
QS.B.spin
[28]:
1
[29]:
# Particle Parameter: gyromagnetic ratio, Particle B
QS.B.gamma
[29]:
41065000.0
[30]:
# Particle Parameter: Quadrupole vale, Particle B
QS.B.quadrupole
[30]:
0.285783