Coupled Spins¶
In [9]:
Copied!
import numpy as np
import matplotlib.pyplot as plt
np.set_printoptions(precision=2, suppress=True)
import numpy as np
import matplotlib.pyplot as plt
np.set_printoptions(precision=2, suppress=True)
In [10]:
Copied!
from tins import spinsys, mesolve
import numpy as np
from tins import spinsys, mesolve
import numpy as np
In [11]:
Copied!
I1, I2 = spinsys(0.5, 0.5)
I1, I2 = spinsys(0.5, 0.5)
In [12]:
Copied!
j_ham = -2 * np.pi * 200 * I1.z
j_ham += 2 * np.pi * 200 * I2.z
j_ham += 2 * np.pi * 40 * (I1.z @ I2.z + I1.x @ I2.x + I1.y @ I2.y)
j_ham = -2 * np.pi * 200 * I1.z
j_ham += 2 * np.pi * 200 * I2.z
j_ham += 2 * np.pi * 40 * (I1.z @ I2.z + I1.x @ I2.x + I1.y @ I2.y)
In [13]:
Copied!
j_ham
j_ham
Out[13]:
array([[ 62.83+0.j, 0. +0.j, 0. +0.j, 0. +0.j],
[ 0. +0.j, -1319.47+0.j, 125.66+0.j, 0. +0.j],
[ 0. +0.j, 125.66+0.j, 1193.81+0.j, 0. +0.j],
[ 0. +0.j, 0. +0.j, 0. +0.j, 62.83+0.j]])
In [14]:
Copied!
inital_state = I1.x + I2.x
detect = (I1.x + I2.x) + 1j * (I1.y + I2.y)
time = np.linspace(0, 1, 2000)
out = mesolve(start=inital_state, detect=detect, ham=j_ham, time=time)
ft = np.fft.fftshift(np.fft.fft(out * np.exp(-10 * time)))
inital_state = I1.x + I2.x
detect = (I1.x + I2.x) + 1j * (I1.y + I2.y)
time = np.linspace(0, 1, 2000)
out = mesolve(start=inital_state, detect=detect, ham=j_ham, time=time)
ft = np.fft.fftshift(np.fft.fft(out * np.exp(-10 * time)))
In [20]:
Copied!
fig, ax = plt.subplots(figsize=(6, 3))
ax.plot(ft.real)
plt.show()
fig, ax = plt.subplots(figsize=(6, 3))
ax.plot(ft.real)
plt.show()
Q1¶
- What does the spectrum look like if the two heteronuclear spins are coupled?
In [ ]:
Copied!
# your answer here
# your answer here
Q2¶
Simulate the spectrum in presence of (a) Dipole dipole coupling and (b) J-coupling + Dipole dipole coupling
In [16]:
Copied!
d_ham = -2 * np.pi * 200 * I1.z
d_ham += 2 * np.pi * 200 * I2.z
d_ham += 2 * np.pi * 100 * (2 * I1.z @ I2.z - I1.x @ I2.x - I1.y @ I2.y)
d_ham = -2 * np.pi * 200 * I1.z
d_ham += 2 * np.pi * 200 * I2.z
d_ham += 2 * np.pi * 100 * (2 * I1.z @ I2.z - I1.x @ I2.x - I1.y @ I2.y)
In [ ]:
Copied!
# continue you answer here
# continue you answer here
In [21]:
Copied!
fig, ax = plt.subplots(figsize=(6, 3))
# contine your answer here
fig, ax = plt.subplots(figsize=(6, 3))
# contine your answer here
In [ ]:
Copied!