PyOR Quantum

Author: Vineeth Thalakottoor

Introduction to Coupled States

[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" : "H1","C" : "H1","D" : "H1"}
QS = QunS(Spin_list,PrintDefault=False)

# initialize the system
QS.Initialize()
[3]:
# Four uncouple spins
X1 = QS.States_Coupled([{"A": 1/2},{"B": 1/2},{"C": 1/2},{"D": 1/2}])
X1.matrix
[3]:
$\displaystyle \left[\begin{matrix}1.0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\end{matrix}\right]$
[4]:
# Four uncouple spins
X2 = QS.States_Coupled([{"A": -1/2},{"B": -1/2},{"C": -1/2},{"D": -1/2}])
X2.matrix
[4]:
$\displaystyle \left[\begin{matrix}0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\1.0\end{matrix}\right]$
[5]:
# State of sub system A
X3 = QS.States_Coupled([{"A": 1/2}])
X3.matrix
[5]:
$\displaystyle \left[\begin{matrix}1.0\\0\end{matrix}\right]$
[6]:
# State of sub system A
X4 = QS.States_Coupled([{"A": -1/2}])
X4.matrix
[6]:
$\displaystyle \left[\begin{matrix}0\\1.0\end{matrix}\right]$
[7]:
# State of uncoupled sub system A and B
X5 = QS.States_Coupled([{"A": 1/2},{"B": 1/2}])
X5.matrix
[7]:
$\displaystyle \left[\begin{matrix}1.0\\0\\0\\0\end{matrix}\right]$
[8]:
# State of coupled sub system A and B
X6 = QS.States_Coupled([{"New" : {"l" : 0, "m" : 0, "Select_l" : 0},"Old" : {"A": 1/2,"B": 1/2}}])
X6.matrix
[8]:
$\displaystyle \left[\begin{matrix}0\\-0.707106781186547\\0.707106781186548\\0\end{matrix}\right]$
[9]:
# State of coupled sub system A and B
X7 = QS.States_Coupled([{"New" : {"l" : 1, "m" : 1, "Select_l" : 0},"Old" : {"A": 1/2,"B": 1/2}}])
X7.matrix
[9]:
$\displaystyle \left[\begin{matrix}1.0\\0\\0\\0\end{matrix}\right]$
[10]:
# State of coupled sub system A and B
X8 = QS.States_Coupled([{"New" : {"l" : 1, "m" : 0, "Select_l" : 0},"Old" : {"A": 1/2,"B": 1/2}}])
X8.matrix
[10]:
$\displaystyle \left[\begin{matrix}0\\0.707106781186548\\0.707106781186547\\0\end{matrix}\right]$
[11]:
# State of coupled sub system A and B
X9 = QS.States_Coupled([{"New" : {"l" : 1, "m" : -1, "Select_l" : 0},"Old" : {"A": 1/2,"B": 1/2}}])
X9.matrix
[11]:
$\displaystyle \left[\begin{matrix}0\\0\\0\\1.0\end{matrix}\right]$
[12]:
# One uncoupled (A) spin and Two coupled spins (B and C)
# State of coupled sub system A and B
X10 = QS.States_Coupled([{"A": 1/2},{"New" : {"l" : 1, "m" : 1, "Select_l" : 0},"Old" : {"B": 1/2,"C": 1/2}}])
X10.matrix
[12]:
$\displaystyle \left[\begin{matrix}1.0\\0\\0\\0\\0\\0\\0\\0\end{matrix}\right]$
[13]:
# One uncoupled (A) spin and Two coupled spins (B and C)
# State of coupled sub system A and B
X11 = QS.States_Coupled([{"A": 1/2},{"New" : {"l" : 1, "m" : 0, "Select_l" : 0},"Old" : {"B": 1/2,"C": 1/2}}])
X11.matrix
[13]:
$\displaystyle \left[\begin{matrix}0\\0.707106781186548\\0.707106781186547\\0\\0\\0\\0\\0\end{matrix}\right]$
[14]:
# One uncoupled (A) spin and Two coupled spins (B and C)
# State of coupled sub system A and B
X12 = QS.States_Coupled([{"A": 1/2},{"New" : {"l" : 1, "m" : -1, "Select_l" : 0},"Old" : {"B": 1/2,"C": 1/2}}])
X12.matrix
[14]:
$\displaystyle \left[\begin{matrix}0\\0\\0\\1.0\\0\\0\\0\\0\end{matrix}\right]$
[15]:
# One uncoupled (A) spin and Two coupled spins (B and C)
# State of coupled sub system A and B
X13 = QS.States_Coupled([{"A": 1/2},{"New" : {"l" : 0, "m" : 0, "Select_l" : 0},"Old" : {"B": 1/2,"C": 1/2}}])
X13.matrix
[15]:
$\displaystyle \left[\begin{matrix}0\\-0.707106781186547\\0.707106781186548\\0\\0\\0\\0\\0\end{matrix}\right]$
[16]:
# Two pair of coupled system A and B coupled, and C and D coupled
X14 = QS.States_Coupled([{"New" : {"l" : 0, "m" : 0, "Select_l" : 0},"Old" : {"A": 1/2,"B": 1/2}},{"New" : {"l" : 0, "m" : 0, "Select_l" : 0},"Old" : {"C": 1/2,"D": 1/2}}])
X14.matrix
[16]:
$\displaystyle \left[\begin{matrix}0\\0\\0\\0\\0\\0.5\\-0.5\\0\\0\\-0.5\\0.5\\0\\0\\0\\0\\0\end{matrix}\right]$
[17]:
# Two pair of coupled system A and B coupled, and C and D coupled
X14 = QS.States_Coupled([{"New" : {"l" : 0, "m" : 0, "Select_l" : 0},"Old" : {"A": 1/2,"B": 1/2}},{"New" : {"l" : 1, "m" : 1, "Select_l" : 0},"Old" : {"C": 1/2,"D": 1/2}}])
X14.matrix
[17]:
$\displaystyle \left[\begin{matrix}0\\0\\0\\0\\-0.707106781186547\\0\\0\\0\\0.707106781186548\\0\\0\\0\\0\\0\\0\\0\end{matrix}\right]$
[18]:
# Two pair of coupled system A and B coupled, and C and D coupled
X15 = QS.States_Coupled([{"New" : {"l" : 1, "m" : 0, "Select_l" : 0},"Old" : {"A": 1/2,"B": 1/2}},{"New" : {"l" : 0, "m" : 0, "Select_l" : 0},"Old" : {"C": 1/2,"D": 1/2}}])
X15.matrix
[18]:
$\displaystyle \left[\begin{matrix}0\\0\\0\\0\\0\\-0.5\\0.5\\0\\0\\-0.5\\0.5\\0\\0\\0\\0\\0\end{matrix}\right]$
[19]:
# All spins are coupled
X16 = QS.States_Coupled([{"New" : {"l" : 2, "m" : 2, "Select_l" : 0},"Old" : {"A": 1/2,"B": 1/2, "C": 1/2,"D": 1/2}}])
X16.matrix
[19]:
$\displaystyle \left[\begin{matrix}1.0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\end{matrix}\right]$
[20]:
# All spins are coupled
X17 = QS.States_Coupled([{"New" : {"l" : 2, "m" : 1, "Select_l" : 0},"Old" : {"A": 1/2,"B": 1/2, "C": 1/2,"D": 1/2}}])
X17.matrix
[20]:
$\displaystyle \left[\begin{matrix}0\\0.5\\0.5\\3.23864880886297 \cdot 10^{-16}\\0.5\\0\\0\\2.02888199778559 \cdot 10^{-16}\\0.5\\0\\0\\2.02888199778559 \cdot 10^{-16}\\0\\2.02888199778559 \cdot 10^{-16}\\1.46071672408528 \cdot 10^{-16}\\0\end{matrix}\right]$
[21]:
# All spins are coupled
X18 = QS.States_Coupled([{"New" : {"l" : 2, "m" : 0, "Select_l" : 0},"Old" : {"A": 1/2,"B": 1/2, "C": 1/2,"D": 1/2}}])
X18.matrix
[21]:
$\displaystyle \left[\begin{matrix}0\\-4.44437010144091 \cdot 10^{-16}\\-3.51129910970437 \cdot 10^{-16}\\0.408248290463863\\-2.31737691712037 \cdot 10^{-16}\\0.408248290463863\\0.408248290463863\\-4.86980591674165 \cdot 10^{-17}\\-2.21369385562875 \cdot 10^{-16}\\0.408248290463863\\0.408248290463863\\-5.11444620266011 \cdot 10^{-18}\\0.408248290463863\\5.38125053700757 \cdot 10^{-17}\\-2.65506637475496 \cdot 10^{-31}\\0\end{matrix}\right]$
[22]:
# All spins are coupled
X19 = QS.States_Coupled([{"New" : {"l" : 1, "m" : 1, "Select_l" : 0},"Old" : {"A": 1/2,"B": 1/2, "C": 1/2,"D": 1/2}}])
X19.matrix
[22]:
$\displaystyle \left[\begin{matrix}0\\0.866025403784439\\-0.288675134594813\\-1.8698347616077 \cdot 10^{-16}\\-0.288675134594813\\0\\0\\-1.56855423838949 \cdot 10^{-16}\\-0.288675134594813\\0\\0\\-1.56855423838949 \cdot 10^{-16}\\0\\-1.56855423838949 \cdot 10^{-16}\\-2.59786491544157 \cdot 10^{-16}\\0\end{matrix}\right]$
[23]:
# All spins are coupled
X20 = QS.States_Coupled([{"New" : {"l" : 1, "m" : 1, "Select_l" : 1},"Old" : {"A": 1/2,"B": 1/2, "C": 1/2,"D": 1/2}}])
X20.matrix
[23]:
$\displaystyle \left[\begin{matrix}0\\0.0351327291507096\\0.790017233330623\\-5.82022219644816 \cdot 10^{-16}\\-0.543346216784993\\-3.0661718775136 \cdot 10^{-16}\\2.08604874259664 \cdot 10^{-16}\\-1.99881058322943 \cdot 10^{-16}\\-0.281803745696339\\-2.19085773391869 \cdot 10^{-16}\\1.43172975832302 \cdot 10^{-16}\\1.37003078565815 \cdot 10^{-18}\\6.95202190332097 \cdot 10^{-16}\\1.79421197963676 \cdot 10^{-16}\\-1.05389615645798 \cdot 10^{-17}\\0\end{matrix}\right]$
[24]:
# All spins are coupled
X21 = QS.States_Coupled([{"New" : {"l" : 1, "m" : 1, "Select_l" : 2},"Old" : {"A": 1/2,"B": 1/2, "C": 1/2,"D": 1/2}}])
X21.matrix
[24]:
$\displaystyle \left[\begin{matrix}0\\-0.00564176435583433\\-0.168178055755344\\1.79018853220595 \cdot 10^{-15}\\-0.604674375164066\\-1.35315959328948 \cdot 10^{-16}\\1.38539816933986 \cdot 10^{-16}\\6.22715665337022 \cdot 10^{-16}\\0.778494195275245\\-2.32860407194975 \cdot 10^{-16}\\8.98882211462371 \cdot 10^{-17}\\-3.88900867887732 \cdot 10^{-16}\\-1.70257142184444 \cdot 10^{-15}\\-3.96593278267651 \cdot 10^{-16}\\1.69239165700711 \cdot 10^{-18}\\0\end{matrix}\right]$