PyOR Quantum
Author: Vineeth Thalakottoor
Introduction to Dipolar Hamiltonians
[1]:
# Define the source path
SourcePath = '/media/HD2/Vineeth/PostDoc_Simulations/Github/PyOR_V1/PyOR_Combined/Source_Doc'
# Add source path
import sys
sys.path.append(SourcePath)
# Import PyOR package
from PyOR_QuantumSystem import QuantumSystem as QunS
from PyOR_Hamiltonian import Hamiltonian
from PyOR_QuantumLibrary import QuantumLibrary
import PyOR_SphericalTensors as ST
import PyOR_Rotation as Rot
QLib = QuantumLibrary()
[2]:
# Define the spin system
Spin_list = {"A" : "H1", "B" : "H1"}
QS = QunS(Spin_list,PrintDefault=False)
# initialize the system
QS.Initialize()
Set parameters
[3]:
# Master Equation
QS.PropagationSpace = "Hilbert"
QS.MasterEquation = "Redfield"
# B0 Field in Tesla, Static Magnetic field (B0) along Z
QS.B0 = 9.4
# Offset Frequency in rotating frame (Hz)
QS.OFFSET["A"] = 10.0
QS.OFFSET["B"] = 50.0
# Define paris of spins coupled by dipolar interaction
QS.DipoleAngle = [(45,45)]
QS.Dipole_Pairs = [("A","B")]
QS.Dipole_DipolarAlpabet = ["All"]
QS.DipolebIS = [25.0e3]
# Define initial and final Spin Temperature
QS.I_spintemp["A"] = 300.0
QS.I_spintemp["B"] = 300.0
QS.F_spintemp["A"] = 300.0
QS.F_spintemp["B"] = 300.0
# Relaxation Process
QS.Rprocess = "Phenomenological"
QS.R1 = 1
QS.R2 = 2
QS.Update()
Rotating frame frequencies: {'A': -2514706800.0, 'B': -2514706800.0}
Offset frequencies: {'A': 10.0, 'B': 50.0}
Initial spin temperatures: {'A': 300.0, 'B': 300.0}
Final spin temperatures: {'A': 300.0, 'B': 300.0}
Radiation damping gain: {'A': 0, 'B': 0}
Radiation damping phase: {'A': 0, 'B': 0}
Rprocess = Phenomenological
RelaxParDipole_tau = 0.0
DipolePairs = [('A', 'B')]
RelaxParDipole_bIS = []
Zeeman Hamiltonians
[4]:
# generate Larmor Frequencies
QS.print_Larmor = True
Ham = Hamiltonian(QS)
Larmor Frequency in MHz: [-400.22802765 -400.22806765]
[5]:
# Lab Frame Hamiltonian
Hz_lab = Ham.Zeeman()
Hz_lab.Inverse2PI().matrix
[5]:
$\displaystyle \left[\begin{matrix}-400228040.565114 & 0 & 0 & 0\\0 & 20.3718327157626 & 0 & 0\\0 & 0 & -20.3718327157626 & 0\\0 & 0 & 0 & 400228040.565114\end{matrix}\right]$
[6]:
# Rotating Frame Hamiltonian
Hz = Ham.Zeeman_RotFrame()
Hz.Inverse2PI().matrix
[6]:
$\displaystyle \left[\begin{matrix}-30.0000000759161 & 0 & 0 & 0\\0 & 20.0000008601147 & 0 & 0\\0 & 0 & -20.0000008601147 & 0\\0 & 0 & 0 & 30.0000000759161\end{matrix}\right]$
Dipolar Hamiltonian with Dipolar alphabets
[7]:
QS.Dipole_DipolarAlpabet = ["secular Homonuclear"]
Hd = Ham.DDcoupling()
Hd.Inverse2PI().Round(0).matrix
[7]:
$\displaystyle \left[\begin{matrix}3125.0 & 0 & 0 & 0\\0 & -3125.0 & 3125.0 & 0\\0 & 3125.0 & -3125.0 & 0\\0 & 0 & 0 & 3125.0\end{matrix}\right]$
[8]:
QS.Dipole_DipolarAlpabet = ["secular Hetronuclear"]
Hd = Ham.DDcoupling()
Hd.Inverse2PI().Round(0).matrix
[8]:
$\displaystyle \left[\begin{matrix}-3125.0 & 0 & 0 & 0\\0 & 3125.0 & 0 & 0\\0 & 0 & 3125.0 & 0\\0 & 0 & 0 & -3125.0\end{matrix}\right]$
[9]:
QS.Dipole_DipolarAlpabet = ["A"]
Hd = Ham.DDcoupling()
Hd.Inverse2PI().Round(0).matrix
[9]:
$\displaystyle \left[\begin{matrix}-3125.0 & 0 & 0 & 0\\0 & 3125.0 & 0 & 0\\0 & 0 & 3125.0 & 0\\0 & 0 & 0 & -3125.0\end{matrix}\right]$
[10]:
QS.Dipole_DipolarAlpabet = ["B"]
Hd = Ham.DDcoupling()
Hd.Inverse2PI().Round(0).matrix
[10]:
$\displaystyle \left[\begin{matrix}0 & 0 & 0 & 0\\0 & 0 & 3125.0 & 0\\0 & 3125.0 & 0 & 0\\0 & 0 & 0 & 0\end{matrix}\right]$
[11]:
QS.Dipole_DipolarAlpabet = ["C"]
Hd = Ham.DDcoupling()
Hd.Inverse2PI().Round(0).matrix
[11]:
$\displaystyle \left[\begin{matrix}0 & -6629.0 + 6629.0 i & -6629.0 + 6629.0 i & 0\\0 & 0 & 0 & 6629.0 - 6629.0 i\\0 & 0 & 0 & 6629.0 - 6629.0 i\\0 & 0 & 0 & 0\end{matrix}\right]$
[12]:
QS.Dipole_DipolarAlpabet = ["D"]
Hd = Ham.DDcoupling()
Hd.Inverse2PI().Round(0).matrix
[12]:
$\displaystyle \left[\begin{matrix}0 & 0 & 0 & 0\\-6629.0 - 6629.0 i & 0 & 0 & 0\\-6629.0 - 6629.0 i & 0 & 0 & 0\\0 & 6629.0 + 6629.0 i & 6629.0 + 6629.0 i & 0\end{matrix}\right]$
[13]:
QS.Dipole_DipolarAlpabet = ["E"]
Hd = Ham.DDcoupling()
Hd.Inverse2PI().Round(0).matrix
[13]:
$\displaystyle \left[\begin{matrix}0 & 0 & 0 & 9375.0 i\\0 & 0 & 0 & 0\\0 & 0 & 0 & 0\\0 & 0 & 0 & 0\end{matrix}\right]$
[14]:
QS.Dipole_DipolarAlpabet = ["F"]
Hd = Ham.DDcoupling()
Hd.Inverse2PI().Round(0).matrix
[14]:
$\displaystyle \left[\begin{matrix}0 & 0 & 0 & 0\\0 & 0 & 0 & 0\\0 & 0 & 0 & 0\\- 9375.0 i & 0 & 0 & 0\end{matrix}\right]$
[15]:
QS.Dipole_DipolarAlpabet = ["All"]
theta = 45
phi = 45
QS.DipoleAngle = [(theta,phi)]
Hd = Ham.DDcoupling()
Hd.Inverse2PI().Round(0).matrix
[15]:
$\displaystyle \left[\begin{matrix}-3125.0 & -6629.0 + 6629.0 i & -6629.0 + 6629.0 i & 9375.0 i\\-6629.0 - 6629.0 i & 3125.0 & 3125.0 & 6629.0 - 6629.0 i\\-6629.0 - 6629.0 i & 3125.0 & 3125.0 & 6629.0 - 6629.0 i\\- 9375.0 i & 6629.0 + 6629.0 i & 6629.0 + 6629.0 i & -3125.0\end{matrix}\right]$
[16]:
Hd.Hermitian()
[16]:
True
Dipole tensor PAF
[17]:
IT_PAF = Ham.InteractionTensor_PAF_Dipole(25.0e3)
IT_PAF.Inverse2PI().matrix
[17]:
$\displaystyle \left[\begin{matrix}25000.0 & 0 & 0\\0 & 25000.0 & 0\\0 & 0 & -50000.0\end{matrix}\right]$
[18]:
PAF_Decom = Ham.InteractionTensor_PAF_Decomposition(IT_PAF)
PAF_Decom
[18]:
{'Isotropic': 0.0, 'Anisotropy': -50000.0, 'Asymmetry': -0.0}
Dipole tensor LAB
[19]:
IT_LAB = Ham.InteractionTensor_LAB(IT_PAF,phi,theta,0)
IT_LAB.Inverse2PI().Round(0).matrix
[19]:
$\displaystyle \left[\begin{matrix}6250.0 & -18750.0 & -26517.0\\-18750.0 & 6250.0 & -26517.0\\-26517.0 & -26517.0 & -12500.0\end{matrix}\right]$
[20]:
LAB_Decom = Ham.InteractionTensor_LAB_Decomposition(IT_LAB)
LAB_Decom['Isotropic'].matrix
[20]:
$\displaystyle \left[\begin{matrix}0 & 0 & 0\\0 & 0 & 0\\0 & 0 & 0\end{matrix}\right]$
[21]:
LAB_Decom["Symmetric"].Inverse2PI().Round(0).matrix
[21]:
$\displaystyle \left[\begin{matrix}6250.0 & -18750.0 & -26517.0\\-18750.0 & 6250.0 & -26517.0\\-26517.0 & -26517.0 & -12500.0\end{matrix}\right]$
[22]:
LAB_Decom["Antisymmetric"].Inverse2PI().Round(0).matrix
[22]:
$\displaystyle \left[\begin{matrix}0 & 0 & 0\\0 & 0 & 0\\0 & 0 & 0\end{matrix}\right]$
Dipolar Hamiltonian in Lab frame (Cartesian, Euler rotation)
[23]:
A = "A"
B = "B"
Hdd_LAB_Euler = Ham.Interaction_Hamiltonian_Catesian_Wigner(A,IT_PAF,B,phi,theta,0)
Hdd_LAB_Euler.Inverse2PI().Round(0).matrix
[23]:
$\displaystyle \left[\begin{matrix}-3125.0 & -6629.0 + 6629.0 i & -6629.0 + 6629.0 i & 9375.0 i\\-6629.0 - 6629.0 i & 3125.0 & 3125.0 & 6629.0 - 6629.0 i\\-6629.0 - 6629.0 i & 3125.0 & 3125.0 & 6629.0 - 6629.0 i\\- 9375.0 i & 6629.0 + 6629.0 i & 6629.0 + 6629.0 i & -3125.0\end{matrix}\right]$
Dipolar Hamiltonian in Lab frame (Cartesian, Wigner rotation)
[24]:
Hdd_LAB_Wig = Ham.Interaction_Hamiltonian_Catesian_Wigner(A,IT_PAF,B,phi,theta,0)
Hdd_LAB_Wig.Inverse2PI().Round(0).matrix
[24]:
$\displaystyle \left[\begin{matrix}-3125.0 & -6629.0 + 6629.0 i & -6629.0 + 6629.0 i & 9375.0 i\\-6629.0 - 6629.0 i & 3125.0 & 3125.0 & 6629.0 - 6629.0 i\\-6629.0 - 6629.0 i & 3125.0 & 3125.0 & 6629.0 - 6629.0 i\\- 9375.0 i & 6629.0 + 6629.0 i & 6629.0 + 6629.0 i & -3125.0\end{matrix}\right]$
Dipolar Hamiltonian in Lab frame (Spherical Tensors, Wigner Rotation)
[25]:
Hdd_LAB_ST = Ham.Interaction_Hamiltonian_SphericalTensor(A,IT_PAF,B,"spin-spin","all", phi,theta,0)
Hdd_LAB_ST.Inverse2PI().Round(0).matrix
[25]:
$\displaystyle \left[\begin{matrix}-3125.0 & -6629.0 + 6629.0 i & -6629.0 + 6629.0 i & 9375.0 i\\-6629.0 - 6629.0 i & 3125.0 & 3125.0 & 6629.0 - 6629.0 i\\-6629.0 - 6629.0 i & 3125.0 & 3125.0 & 6629.0 - 6629.0 i\\- 9375.0 i & 6629.0 + 6629.0 i & 6629.0 + 6629.0 i & -3125.0\end{matrix}\right]$
[26]:
Hdd_LAB_ST = Ham.Interaction_Hamiltonian_SphericalTensor(A,IT_PAF,B,"spin-spin","secular", phi,theta,0)
Hdd_LAB_ST.Inverse2PI().Round(0).matrix
[26]:
$\displaystyle \left[\begin{matrix}-3125.0 & 0 & 0 & 0\\0 & 3125.0 & 0 & 0\\0 & 0 & 3125.0 & 0\\0 & 0 & 0 & -3125.0\end{matrix}\right]$
[27]:
Hdd_LAB_ST = Ham.Interaction_Hamiltonian_SphericalTensor(A,IT_PAF,B,"spin-spin","secular + pseudosecular", phi,theta,0)
Hdd_LAB_ST.Inverse2PI().Round(0).matrix
[27]:
$\displaystyle \left[\begin{matrix}-3125.0 & 0 & 0 & 0\\0 & 3125.0 & 3125.0 & 0\\0 & 3125.0 & 3125.0 & 0\\0 & 0 & 0 & -3125.0\end{matrix}\right]$
Cartesian tensor to Spherical tensors and back
[28]:
carTOst = ST.MatrixToSphericalTensors(IT_PAF )
carTOst
[28]:
{'rank0': (-0+0j),
'rank1': [(-0+0j), -0j, (-0+0j)],
'rank2': [0j, (-0+0j), (-384764.94904855924+0j), 0j, 0j]}
[29]:
T0 = carTOst["rank0"]
T11, T10, T1m1 = carTOst["rank1"]
T22, T21, T20, T2m1, T2m2 = carTOst["rank2"]
[30]:
spTOcar = ST.SphericalTensorsToMatrix(carTOst)
spTOcar.Inverse2PI().matrix
[30]:
$\displaystyle \left[\begin{matrix}25000.0 & 0 & 0\\0 & 25000.0 & 0\\0 & 0 & -50000.0\end{matrix}\right]$
Wigner d matrix
[31]:
Rot.Wigner_d_Matrix(rank=1,beta=45).Round(3).matrix
[31]:
$\displaystyle \left[\begin{matrix}0.854 & -0.5 & 0.146\\0.5 & 0.707 & -0.5\\0.146 & 0.5 & 0.854\end{matrix}\right]$
[32]:
Rot.Wigner_d_Matrix(rank=2,beta=45).Round(3).matrix
[32]:
$\displaystyle \left[\begin{matrix}0.729 & -0.604 & 0.306 & -0.104 & 0.021\\0.604 & 0.354 & -0.612 & 0.354 & -0.104\\0.306 & 0.612 & 0.25 & -0.612 & 0.306\\0.104 & 0.354 & 0.612 & 0.354 & -0.604\\0.021 & 0.104 & 0.306 & 0.604 & 0.729\end{matrix}\right]$
Wigner D matrix
[33]:
Rot.Wigner_D_Matrix(rank=1,alpha=45,beta=45,gamma=45).Round(3).matrix
[33]:
$\displaystyle \left[\begin{matrix}- 0.854 i & -0.354 + 0.354 i & 0.146\\0.354 - 0.354 i & 0.707 & -0.354 - 0.354 i\\0.146 & 0.354 + 0.354 i & 0.854 i\end{matrix}\right]$
[34]:
Rot.Wigner_D_Matrix(rank=2,alpha=45,beta=45,gamma=45).Round(3).matrix
[34]:
$\displaystyle \left[\begin{matrix}-0.729 & 0.427 + 0.427 i & - 0.306 i & -0.073 + 0.073 i & 0.021\\-0.427 - 0.427 i & - 0.354 i & -0.433 + 0.433 i & 0.354 & -0.073 - 0.073 i\\- 0.306 i & 0.433 - 0.433 i & 0.25 & -0.433 - 0.433 i & 0.306 i\\0.073 - 0.073 i & 0.354 & 0.433 + 0.433 i & 0.354 i & 0.427 - 0.427 i\\0.021 & 0.073 + 0.073 i & 0.306 i & -0.427 + 0.427 i & -0.729\end{matrix}\right]$