This is a Jupyter notebook that was composed to run most of the examples distributed with SpinEvolution. It gives a visual overview of the examples and shows how to use SpinEvolution from Jupyter notebooks.

If you are viewing this content in a web browser, then this is just an HTML export (a Web version) of the original notebook. While the notebook format allows making all figures fully interactive, only some of the 2D spectra were made interactive in the Web version.

The whole gallery (~40 simulations) can be fully computed in about 10 minutes on a 4-core CPU. About 95% of this time is spent on five relatively large calculations.

Only about one third of these problems can be simulated with SIMPSON. Except for the most basic ones, however, they will be quite difficult to program for that software and will typically take at least an order of magnitude longer to compute.

In [1]:
#%matplotlib widget
%matplotlib inline

from plot import spinev, plot, setup_ipynb
setup_ipynb()

%cd '~/spinev/examples/'

opts = '-v0 -vf0 -vsf0 --verb'
/Users/mvesh/spinev/examples

In [2]:
spinev('csa/csa', opts)
****** The System *******
spectrometer(MHz)  500
spinning_freq(kHz) *
channels           C13
nuclei             C13
atomic_coords      *
cs_isotropic       *
csa_parameters     1 1 0.5 0 0 0
j_coupling         *
quadrupole         *
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      *
******* Pulse Sequence ******************************
CHN 1
timing(usec)      (200)512
power(kHz)         0           
phase(deg)         0       
freq_offs(kHz)     0
******* Variables ***********************************
fig_title="CSA Powder Pattern"
******* Options *************************************
rho0               I1x
observables        I1p
EulerAngles        asgind100o
n_gamma            *
line_broaden(Hz)   *
zerofill           *
FFT_dimensions     1
options            -re -py
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
******************************************************
-- Note the orientation of the CSA tensor. So that powder averaging
over one octant could be used, it has to be alligned with the crystallite frame.
-- See also the analytic mode version of this simulation, csa-am
2022-03-14T21:44:37.577497 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

In [3]:
spinev('redor/redor-full', opts)
****** The System ***********************************
spectrometer(MHz)  500
spinning_freq(kHz) 10.0
channels           C13 N15
nuclei             C13 N15
atomic_coords      1.367
cs_isotropic       2 0
csa_parameters     *
j_coupling         *
quadrupole         *
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      *
******* Pulse Sequence ******************************
CHN 1
timing(usec)     (100)60D1B  (95     5    100)1D1A (100)60D1B
power(kHz)         0           0    100    0         0
phase(deg)         0           0     0     0         0
freq_offs(kHz)     0           0     0     0         0
CHN 2         
timing(usec)    (redor.pp)   45  5   50  redor.pp (redor.pp)
power(kHz)         *          0  100 0     *         *  
phase(deg)         *          0  0   0     *         *        
freq_offs(kHz)     *          0  0   0     *         *         
******* Variables ************************************
fig_title="REDOR"
******* Options **************************************
rho0               I1x
observables        I1p
EulerAngles        ^asgind30h
n_gamma            *
line_broaden(Hz)   *
zerofill           *
FFT_dimensions     *
options            -re -py
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
2022-03-14T21:44:37.798795 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

It is sometimes desireable to simulate a pulse sequence, in which some of the RF field parameters are varied continuously rather than in steps, as is usually the case. The simulation below illustrates, on the simplest possible example, how this can be done is SpinEvolution. In the input file, the RF frequency offset is specified as an analytic function of time: xfreq_1_1=0.025*(t_-tp)/tp.

This example also demonstrates that one can use alternative design styles for the output figures.

In [4]:
spinev('cw-nmr/cw-xfreq --style seaborn-dark', opts)
****** The System ***********************************
spectrometer(MHz)  *
spinning_freq(kHz) *
channels           H1
nuclei             H1
atomic_coords      *
cs_isotropic       *
csa_parameters     *
j_coupling         *
quadrupole         *
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      *
******* Pulse Sequence ******************************
CHN 1
timing(usec)       [100000]5001
power(kHz)         [0.0001]5001
phase(deg)         [90]5001
freq_offs(kHz)     [0]5001
******* Variables ***********************************
T1SQ_1_1=2000
T2SQ_1_1=2000
tp=500100000/2
xfreq_1_1=0.025*(t_-tp)/tp
dim_1_units="s"
fig_title="CW NMR: Continuous Linear Frequency Sweep"
******* Options *************************************
rho0               I1z
observables        I1p
EulerAngles        *
n_gamma            *
line_broaden(Hz)   *
zerofill           *
FFT_dimensions     *
options            -re -oes -py
options_cmd_line   --style seaborn-dark -px -py0 -vm -v0 -vf0 -vsf0 --verb
2022-03-14T21:44:38.276432 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

In [5]:
spinev('adiabatic-inversion/adiab', opts)
****** The System ***********************************
spectrometer(MHz)  *
spinning_freq(kHz) *
channels           C13
nuclei             C13
atomic_coords      *
cs_isotropic       *
csa_parameters     *
j_coupling         *
quadrupole         *
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      *
******* Pulse Sequence ******************************
CHN 1
timing(usec)       [200]5001   
power(kHz)         [0.1]5001       
phase(deg)         [90]5001       
freq_offs(kHz)     [0]5001    
******* Variables ***********************************

T1SQ_1_1=2000
T2SQ_1_1=2000
freq_1_1=-1:0.0004:1

fig_title="Adiabatic Inversion by Linear Frequency Sweep at Constant Power"
dim_2_labels = "$I_x$, $I_y$, $I_z$"

******* Options *************************************
rho0               0.25I1z
observables        I1p iI1m I1z
EulerAngles        *
n_gamma            *
line_broaden(Hz)   *
zerofill           *
FFT_dimensions     *
options            -oes -re -py
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
2022-03-14T21:44:38.776158 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

In [6]:
spinev('cpmg-echo/echo', opts)
****** The System *******
spectrometer(MHz)  *
spinning_freq(kHz) *
channels           C13
nuclei             C13
atomic_coords      *
cs_isotropic       *
csa_parameters     *
j_coupling         *
quadrupole         *
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      *
******* Pulse Sequence ******************************
CHN 1
timing(usec)       0.5 [1000]2900
power(kHz)         500 [0]2900       
phase(deg)          90 [0]2900       
freq_offs(kHz)       0 [0]2900
******* Variables ***********************************

T2SQ_1_1=1000
sigma=0.006

pulse_1_1_[100:200:2900]=1.0
power_1_1_[100:200:2900]=500

** Chemical shifts inhomogeneity
ave_par x/-0.02:0.0025:0.02/
cs_iso_1=0.1+x

W=sum(exp(-0.5*(x.mx/sigma).^2))
ave_wht=exp(-0.5*(x/sigma)^2)/W

fig_title="Carr-Purcell-Meiboom-Gill Echo Train"
** use thinner lines for the plot
fig_options="--widths 0.6"

******* Options **************************************
rho0               I1z
observables        I1p
EulerAngles        *
n_gamma            *
line_broaden(Hz)   *
zerofill           *
FFT_dimensions     *
options            -oes -re -py
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
2022-03-14T21:44:39.026372 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

In [7]:
spinev('tppm/tppm', opts)
****** The System *******
spectrometer(MHz)  500
spinning_freq(kHz) 15.625
channels           C13  H1
nuclei             C13  H1  H1  H1  H1
atomic_coords      ch4.cor
cs_isotropic       0.0 -0.3 0.5 0.5 0.2
csa_parameters     ch4.csa
j_coupling         *
quadrupole         *
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      *
******* Pulse Sequence ******************************
CHN 1
timing(usec)      (8)256x200
power(kHz)         0
phase(deg)         0
freq_offs(kHz)     0
CHN 2         
timing(usec)      (4   4)
power(kHz)        125 125
phase(deg)         0   15
freq_offs(kHz)     0   0
****** Variables ************************************
spinning_freq=15.625
DW=40*(1000/spinning_freq)
scan_par R/4.5:0.25:5.25/
tc=(1000/spinning_freq)/R
pulse_1_1_1=tc
pulse_2_1_[1:2]=0.5*tc
power_2_1_[1:2]=1000/tc
gsize_1=round(DW/tc)
******************************************************
fig_title="TPPM Lineshape Dependence on RF Field Strength"
dim_2_name="$\omega_1/2\pi$"
dim_2_labels=R.mx*spinning_freq
dim_2_units="kHz"
******* Options **************************************
rho0               I1x
observables        F1p
EulerAngles        rep168
n_gamma            16
line_broaden(Hz)   6
zerofill           *
FFT_dimensions     1 Hz
options            -re -py
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
2022-03-14T21:44:40.116514 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

The following shows the Linear Ramp Cross-Polarization pulse sequence, which consists of 30 elementary pulse sequences. The diagram shows each sequence repeated just once, but the $D_1$ symbols over the sequences says that the number of repeats grows in dimension 1.

In [8]:
spinev('ramped-cp/rampcp1 -pseq')
2022-03-14T21:44:40.695596 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/
In [9]:
spinev('ramped-cp/rampcp1', opts)
****** The System ***********************************
spectrometer(MHz)  400                                                  
spinning_freq(kHz) 10
channels           C13 H1
nuclei             C13 H1 H1 H1
atomic_coords      *
cs_isotropic       *
csa_parameters     *
j_coupling         *
quadrupole         *
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      *
******* Pulse Sequence ******************************
CHN 1
timing(usec)       [(0)64]30
power(kHz)         [0]30
phase(deg)         [0]30
freq_offs(kHz)     [0]30
CHN 2
timing(usec)       [(0)]30
power(kHz)         [0]30
phase(deg)         [0]30
freq_offs(kHz)     [0]30
******* Variables ***********************************
power_1_[1:30]_1=50+[0:29]*6/29
power_2_[1:30]_1=63
pulse_1_[1:30]_1=1
pulse_2_[1:30]_1=1
sys2ext_map=["1 3 4 5"]
fig_title="Linear-Ramp Cross-Polarization in C$_1$H$_3$ Spin System"
******* Options *************************************
rho0               F2x
observables        I1x
EulerAngles        rep376
n_gamma            5
line_broaden(Hz)   *
zerofill           *
FFT_dimensions     *
options            -zxmatrampcp.zxmat -re -py
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
2022-03-14T21:44:57.161783 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

The following simulation computes a histogram demonstrating that even ramped CP may result in the $^{13}$C polarization, which is extremely non-uniform over the crystallite orientations.

In [10]:
spinev('ramped-cp/rampcp-hist', opts)
****** The System ***********************************
spectrometer(MHz)  400                                                  
spinning_freq(kHz) 10
channels           C13 H1
nuclei             C13 H1 H1 H1
atomic_coords      *
cs_isotropic       *
csa_parameters     *
j_coupling         *
quadrupole         *
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      *
******* Pulse Sequence ******************************
CHN 1
timing(usec)       [0]30
power(kHz)         [0]30
phase(deg)         [0]30
freq_offs(kHz)     [0]30
CHN 2
timing(usec)       [0]30
power(kHz)         [0]30
phase(deg)         [0]30
freq_offs(kHz)     [0]30
******* Variables ***********************************

*save(euler_CR',"rep376.dat")

sys2ext_map=["1 3 4 5"]

power_1_1=50+(0:29)*6/29
power_2_1=63
time=2
pulse_[1:2]_1=1000*time/30

rep2000=(load("rep2000.dat"))'
scan_par i/1:2000/
euler_CR(1:2,1)=rep2000(1:2,i)

fig_options ="--hist 25 --colorsx navy"
x_label = "$^{13}$C polarization after CP"
fig_title="Histogram of ramped CP efficiency for a set of 2000 crystallite orientations"

******* Options *************************************
rho0               F2x
observables        I1x
EulerAngles        *
n_gamma            *
line_broaden(Hz)   *
zerofill           *
FFT_dimensions     *
options            -zxmatrampcp.zxmat -re -py
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
2022-03-14T21:44:59.388679 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

The following two simulations compute the R$^2$ magnetization exchange curves between CO and C$_\beta$ in alanine using two model spin systems: C2 (without protons) and C2H7. The normal plotting of the results of the first simulation is suppressed with the -px0 option. Instead, these results are plotted as a reference curve by the second simulation. The -macroX=3 option selects C$_\beta$ as the second $^{13}$C nucleus. Using -macroX=2 instead would select C$_\alpha$.

This illustrates that even at 80 kHz CW decoupling and with both CH3 and NH3 groups in the fast exchange regime, the presence of protons leads to ZQ relaxation and to apparent attenuation of the C-C coupling.

In [11]:
spinev('rotational-resonance/r2-C2 -px0  -macroX=3', opts)
spinev('rotational-resonance/r2-C2H7-hot -macroX=3', opts)
****** The System *******************************************************
spectrometer(MHz)  500
spinning_freq(kHz) 10
channels           C13 H1
nuclei             *
atomic_coords      *
cs_isotropic       176.8 50.9 19.8 0 0 0 0 0 0 0 ppm
csa_parameters     1 -71  0.84   0   0  0 ppm 1
csa_parameters     2 -20  0.44 -20   0  0 ppm 2
csa_parameters     3 -12  0.76   0 -90  0 ppm 3
j_coupling         *
quadrupole         *
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    (8 9 10) (11 12 13)
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      (2 1 4) (7 2 3) (2 3 8)
******* Pulse Sequence ***************************************************
CHN 1
timing(usec)     (100)512
power(kHz)         0
phase(deg)         0
freq_offs(kHz)     0
CHN 2
timing(usec)      100
power(kHz)         80
phase(deg)         0
freq_offs(kHz)     0
******* Variables *********************************************************

sys2ext_map=["1 X 7 8 9 10 11 12 13"]
spinning_freq=cs_iso_X-cs_iso_1
freq_1_1_1=(cs_iso_X+cs_iso_1)/2
pulse_[1:2]_1_1=1000/spinning_freq

** Figure setup ***********************************************************
q = (X==2)? "alpha" : "beta"
fig_title=f"C$'$-C$_\[q]$ Rotational Resonance in Ala: C$_2$H$_7$ vs. C$_2$ spin systems"
y_label="${\langle}I_{1z}-I_{2z}{\rangle}$"
legend_labels="C$_2$H$_7$, C$_2$"
fig_options = f"--text 0.3,0.9,'80 kHz $^1$H CW Decoupling[nl]CH3 and NH3 groups in fast exchange',8.5"
x_lim=["0 10"]

******* Options ************************************************************
rho0               0.5*I1z-0.5*I2z
observables        I1z-I2z
EulerAngles        rep700
n_gamma            12
line_broaden(Hz)   *
zerofill           *
FFT_dimensions     *
options         -zxmatala.zxmat -re -sysc2h7 -nr2-C1CX-H7-hot -refr2-C1CX -py
options_cmd_line   -macroX=3 -px -py0 -vm -v0 -vf0 -vsf0 --verb
**************************************************************************
-- Either -macroX=2 or -macroX=3 must be specified at the command line
-- The spinning frequencies used for X=2 and X=3 cases are different. So the total observation times (512 points) will also different. To plot the output results on the same scale, we simply set the same x-axis limits for both cases.
-- CO-CA  oscillations after ~10ms are due to incomplete powder averaging. They can be seen if one uses a higher upper limit in x_lim, e.g., x_lim=["0 21"]
2022-03-14T21:46:50.961615 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

These effects become much more pronounced when the fast hopping of both CH3 and NH3 groups is frozen.
The --ref option requests to show the difference in the input files.

In [12]:
spinev('rotational-resonance/r2-C2H7-frozen -macroX=3 --ref rotational-resonance/r2-C2H7-hot', opts)
****** The System *******************************************************
spectrometer(MHz)  500
spinning_freq(kHz) 10
channels           C13 H1
nuclei             *
atomic_coords      *
cs_isotropic       176.8 50.9 19.8 0 0 0 0 0 0 0 ppm
csa_parameters     1 -71  0.84   0   0  0 ppm 1
csa_parameters     2 -20  0.44 -20   0  0 ppm 2
csa_parameters     3 -12  0.76   0 -90  0 ppm 3
j_coupling         *
quadrupole         *
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      (2 1 4) (7 2 3) (2 3 8)
******* Pulse Sequence ***************************************************
CHN 1
timing(usec)     (100)512
power(kHz)         0
phase(deg)         0
freq_offs(kHz)     0
CHN 2
timing(usec)      100
power(kHz)         80
phase(deg)         0
freq_offs(kHz)     0
******* Variables *********************************************************

sys2ext_map=["1 X 7 8 9 10 11 12 13"]
spinning_freq=cs_iso_X-cs_iso_1
freq_1_1_1=(cs_iso_X+cs_iso_1)/2
pulse_[1:2]_1_1=1000/spinning_freq

** Figure setup ***********************************************************
q = (X==2)? "alpha" : "beta"
fig_title=f"C$'$-C$_\[q]$ Rotational Resonance in Ala: C$_2$H$_7$ vs. C$_2$ spin systems"
y_label="${\langle}I_{1z}-I_{2z}{\rangle}$"
legend_labels="C$_2$H$_7$, C$_2$"
fig_options = f"--text 0.3,0.9,'80 kHz $^1$H CW Decoupling[nl]Both CH3 and NH3 groups are frozen',8.5"
x_lim=["0 10"]

******* Options ************************************************************
rho0               0.5*I1z-0.5*I2z
observables        I1z-I2z
EulerAngles        rep700
n_gamma            12
line_broaden(Hz)   *
zerofill           *
FFT_dimensions     *
options         -zxmatala.zxmat -re -sysc2h7 -nr2-C1CX-H7-frozen -refr2-C1CX -py
options_cmd_line   -macroX=3 --ref rotational-resonance/r2-C2H7-hot -px -py0 -vm -v0 -vf0 -vsf0 --verb
**************************************************************************
-- Either -macroX=2 or -macroX=3 must be specified at the command line
-- The spinning frequencies used for X=2 and X=3 cases are different. So the total observation times (512 points) will also different. To plot the output results on the same scale, we simply set the same x-axis limits for both cases.
-- CO-CA  oscillations after ~10ms are due to incomplete powder averaging. They can be seen if one uses a higher upper limit in x_lim, e.g., x_lim=["0 21"]
- exchange_nuclei    (8 9 10) (11 12 13)
+ exchange_nuclei    *
- fig_options = f"--text 0.3,0.9,'80 kHz $^1$H CW Decoupling[nl]CH3 and NH3 groups in fast exchange',8.5"
+ fig_options = f"--text 0.3,0.9,'80 kHz $^1$H CW Decoupling[nl]Both CH3 and NH3 groups are frozen',8.5"
- options         -zxmatala.zxmat -re -sysc2h7 -nr2-C1CX-H7-hot -refr2-C1CX -py
+ options         -zxmatala.zxmat -re -sysc2h7 -nr2-C1CX-H7-frozen -refr2-C1CX -py

2022-03-14T21:48:44.079454 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

We can model these effects by supplementing the two-spin model with a ZQ relaxation time constant and with a dipolar coupling scaling factor. These two parameters can then be fit using SpinEvolution data fitting feature to "explain" the behavior observed in the C2H7 systems:

In [13]:
spinev('rotational-resonance/r2-C2-T2ZQ -macroX=3 -macroTEMP=hot', opts)
****** The System *******************************************************
spectrometer(MHz)  500
spinning_freq(kHz) 10
channels           C13
nuclei             C13 C13
atomic_coords      *
cs_isotropic       176.8 50.9 19.8 0 0 0 0 0 0 0 ppm
csa_parameters     1 -71  0.84   0   0  0 ppm 1
csa_parameters     2 -20  0.44 -20   0  0 ppm 2
csa_parameters     3 -12  0.76   0 -90  0 ppm 3
j_coupling         *
quadrupole         *
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      (2 1 4) (7 2 3) (2 3 8)
******* Pulse Sequence ***************************************************
CHN 1
timing(usec)     (100)512
power(kHz)         0
phase(deg)         0
freq_offs(kHz)     0
******* Variables *********************************************************

sys2ext_map=["1 X"]
spinning_freq=cs_iso_X-cs_iso_1
freq_1_1_1=(cs_iso_X+cs_iso_1)/2
pulse_1_1_1=1000/spinning_freq

T2ZQ_1_2=10
fit_re=(load("r2-C1CX-H7-TEMP_re.dat"))(:,2)
wht_re(range(["10 100"],"ms"))=0
fit_par T2ZQ_1_2_1 dip_swb_1_2_1

** Figure setup ***********************************************************

q = (X==2)? "alpha" : "beta"
fig_title=f"C$'$-C$_\[q]$ Rotational Resonance in Ala: T2ZQ vs H7"
y_label="${\langle}I_{1z}-I_{2z}{\rangle}$"
x_lim=["0 10"]

T2 = str(T2ZQ_1_2_1,3), x_
SF = str(dip_swb_1_2_1,3), x_
fig_options = f"--text 0.2,0.8,'$\mathrm{T2ZQ}=[T2]$ ms [nl]$\mathrm{SF}=[SF]$'"

******* Options ************************************************************
rho0               0.5*I1z-0.5*I2z
observables        I1z-I2z
EulerAngles        rep700
n_gamma            12
line_broaden(Hz)   *
zerofill           *
FFT_dimensions     *
options            -zxmatala.zxmat -re -nr2-C1CX-T2ZQ-TEMP -py
options_cmd_line   -macroX=3 -macroTEMP=hot -px -py0 -vm -v0 -vf0 -vsf0 --verb
*****************************************************************************
-- Either -macroX=2 or -macroX=3 must be specified at the command line
-- Also, -macroTEMP=hot, -macroTEMP=cold, or -macroTEMP=frozen must be specified
-- The spinning frequencies used for X=2 and X=3 cases are different. So the total observation times (512 points) will also different. To plot the output results on the same scale, we simply set the same x-axis limits for both cases.
-- CO-CA  oscillations after ~10ms are due to incomplete powder averaging. They can be seen if one uses a higher upper limit in x_lim, e.g., x_lim=["0 21"]
2022-03-14T21:48:52.663643 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

The following shows the SPC-5 dipolar recoupling pulse sequence

In [14]:
spinev('spc5/spc5 -pseq')
2022-03-14T21:48:53.198503 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/
In [15]:
spinev('spc5/spc5', opts)
****** The System *******
spectrometer(MHz)  400
spinning_freq(kHz) 10.0
channels           C13
nuclei             C13 C13
atomic_coords      4
cs_isotropic       *
csa_parameters     1 70 0.8  0 60 0 ppm
csa_parameters     2 70 0.8 30 90 0 ppm
j_coupling         *
quadrupole         *
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      *
******* Pulse Sequence ******************************
CHN 1
timing(usec)      (spc5.pp)41    (spc5.pp)41    0.5
power(kHz)          *              *            500
phase(deg)          *              *            90
freq_offs(kHz)      *              *            0
phase_cycling       *             1234          *   3131(RCV)
******* Variables **********************************

spinning_freq=9
psf_1_[1 2]=0.1*spinning_freq
tsf_[1 2]=1/psf_1_1

** Turn on/off the CSA
scan_par csa/0 1/
csa_swb_[1 2]_1 = csa
csa_swb_[1 2]_2 = csa

** Set up the Figure
legend_labels = "'SPC-5 no CSA', 'SPC-5 70 ppm CSA'"
y_label = "DQ filtering efficiency"
fig_title = "SPC-5"
fig_options = f"--text 0.6,0.4,'$^1$H 400 MHz    $\omega_R/2\pi=9$ kHz[nl]$^{13}$C$-^{13}$C pair    $r=4$ Å',8"

******* Options *************************************
rho0               F1z
observables        I1p
EulerAngles        rep168
n_gamma            20
line_broaden(Hz)   *
zerofill           *
FFT_dimensions     *
options            -re -dw1 -py
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
2022-03-14T21:48:54.100054 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

In [16]:
spinev('hccn/hccn', opts)
****** The System ***********************************
spectrometer(MHz)  500                                                  
spinning_freq(kHz) 10
channels           C13 H1 N15
nuclei             H1 C13 C13 N15
atomic_coords      hccn.cor
cs_isotropic       * 
csa_parameters     *
j_coupling         *
quadrupole         *
dip_switchboard    *    
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    (1 2 3 4)
groups_nuclei      *
******* Pulse Sequence *****************************************
CHN 1
timing(usec)  (100)21  100   1   100  (100)21  (100)x7  (12.5)21
power(kHz)      0       0   500   0     0       5.0       70.0
phase(deg)      0       0    0    0     0        0          0
freq_offs(kHz)  0       0    0    0     0        0          0
CHN 2                                                                    
timing(usec)  (100)         200       (100)      100     (12.5)
power(kHz)     100          100        100       100     65.574
phase(deg)      0            0          0         0         0
freq_offs(kHz)  0            0          0         0      45.826
CHN 3         
timing(usec) (redor1.pp)    200    (redor2.pp)   100     (12.5)
power(kHz)      *            0          *         0         0
phase(deg)      *            0          *         0         0
freq_offs(kHz)  *            0          *         0         0
******* Variables **********************************************
scan_par phi_1/-130:-10:-180/
spinning_freq=12.9
tsf_[1:5]=10/spinning_freq
psf_1_[1:4]=spinning_freq/10
psf_3_[1:4]=spinning_freq/10
power_1_5_1=80-spinning_freq
****************************************************************
fig_title="HCCN Correlation Experiment"
y_label="C$'\to\mathrm{C}_\alpha$"
******* Options ************************************************
rho0              -I3x
observables        I2p
EulerAngles        rep168
n_gamma            16
line_broaden(Hz)   *
zerofill           *
FFT_dimensions     *
options            -dw13 -re -py
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
2022-03-14T21:48:55.342169 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

2D Spectra

In [17]:
spinev('noesy/noesy', opts)
*******************************************************************
**   NOESY with axial peak suppression, hypercomplex-detected    **
****** The System *************************************************
spectrometer(MHz)   500
spinning_freq(kHz)  *
channels            H1
nuclei              H1 H1
atomic_coords       *
cs_isotropic        -2 2 ppm
csa_parameters      *
j_coupling          *
quadrupole          *
dip_switchboard     *
csa_switchboard     *
exchange_nuclei     *
bond_len_nuclei     *
bond_ang_nuclei     *
tors_ang_nuclei     *
groups_nuclei       *
******* Pulse Sequence ******************************
CHN 1
timing(usec)         0.5 (250)256D1 0.5 (200000) 0.5  (250)256D2
power(kHz)           500   0        500    0     500    0
phase(deg)           90    0        -90    0      90    0
freq_offs(kHz)        0    0          0    0       0    0
phase_cycling_cos 11113333 *          *    *   12341234 *  12343412(RCV)
phase_cycling_sin 44442222 *          *    *   12341234 *  12343412(RCV)
******* Variables ************************************************

W0= 5e-4
W1a=5e-4
W1b=5e-4
W2= 2.5e-4

T1ZQ_1_2_4=0.5/W0
T1DQ_1_2_4=0.5/W2
T1SQ_1_4=0.5/W1a
T1SQ_2_4=0.5/W1b

** Alternatively, one can use RZ/RR variables to define spin-lattice relaxation:

*R1=-(W0+2*W1a+W2)
*R2=-(W0+2*W1b+W2)
*Rc=W0-W2
*RZ_1_4="I1z"
*RZ_2_4="I2z"
*RR_4=["R1 Rc; Rc R2"]

fig_title="NOESY with axial peak suppression"

******* Options **************************************************
rho0                F1z
observables         F1p
EulerAngles         *
n_gamma             *
line_broaden(Hz)    0 0 100 100
zerofill            *
FFT_dimensions      1 2 ppm
options             -re -py
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
2022-03-14T21:48:56.097844 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

Note that Gaussian line broadening is used in the NOESY spectrum above, while Lorentzian line broadening is used in the HMQC spectrum below. The peak shapes reflect which type of line broadening was applied to them.

In [18]:
spinev('hmqc/hmqc', opts)
****** The System ******************************************************************
spectrometer(MHz)  400
spinning_freq(kHz) *
channels           H1 C13
nuclei             H1 C13
atomic_coords      *
cs_isotropic       2 1
csa_parameters     *
j_coupling         1 2 10
quadrupole         *
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      *
******* Pulse Sequence *************************************************************
CHN 1
timing(usec)        2  (50e3)  2  (100)1024D1  4  (100)1024D1  2  (50e3) (100)1024D2
power(kHz)        125    0     0    0         125   0          0    0      0
phase(deg)         90    0     0    0         180   0          0    0      0
freq_offs(kHz)      0    0     0    0          0    0          0    0      0
CHN 2
timing(usec)        2  (50e3)  2  (100)        4  (100)        2  (50e3) (100)
power(kHz)          0    0    125   0          0    0         125   0      0
phase(deg)          0    0     0    0          0    0          0    0      0
freq_offs(kHz)      0    0     0    0          0    0          0    0      0
phase_cycling_cos   *    *    24    *          *    *         44    *      *  13(RCV)
phase_cycling_sin   *    *    24    *          *    *         11    *      *  13(RCV)
******* Variables ******************************************************************
fig_title="HMQC"
fig_options="--size 6.4,3.6"
******* Options ********************************************************************
rho0               I1z
observables        I1p
EulerAngles        *
n_gamma            *
line_broaden(Hz)   100 100
zerofill           *
FFT_dimensions     1 2
options           -re -py
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
************************************************************************************
- Coherence transfer pathway foe the first step of the phase cycle:
'cos': I1z->I1x->I1yI2z->I1yI2x->-I1yI2x*cos(w*t1)->-I1yI2z*cos(w*t1)->I1x
'sin': I1z->I1x->I1yI2z->I1yI2x->-I1yI2y*sin(w*t1)->-I1yI2z*sin(w*t1)->I1x
- The two-step phase cycle selects I1yI2z->±I1yI2x during the first 90-degree pulse on the second channel, while killing the I1x and I1y coherences
2022-03-14T21:48:58.271078 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

In [19]:
spinev('cosy/cosy-2QF-ABX', opts, HTML=True)
****************************************************************
**   2Q-filtered COSY in ABX system, hypercomplex detection   **
****** The System **********************************************
spectrometer(MHz)   500
spinning_freq(kHz)  *
channels            H1
nuclei              H1 H1 H1
atomic_coords       *
cs_isotropic        4.1 4.14 5.0 ppm
csa_parameters      *
j_coupling          1 3 3
j_coupling          2 3 9
j_coupling          1 2 -14
quadrupole          *
dip_switchboard     *
csa_switchboard     *
exchange_nuclei     *
bond_len_nuclei     *
bond_ang_nuclei     *
tors_ang_nuclei     *
groups_nuclei       *
******* Pulse Sequence *****************************************
CHN 1
timing(usec)        0.5 (1600)1024D1 0.5 (0.5) (1600)1024D2
power(kHz)          500   0          500  500    0
phase(deg)           0    0           0    0     0
freq_offs(kHz)       0    0           0    0     0
phase_cycling_cos  4444   *           *   2341   *  2143(RCV)
phase_cycling_sin  3333   *           *   2341   *  2143(RCV)
******* Variables **********************************************
ppm_center_1=4.56
fig_title="2Q-filtered COSY in ABX system"
******* Options ************************************************
rho0                F1z
observables         F1p
EulerAngles         *
n_gamma             *
line_broaden(Hz)    0 0 3 3
zerofill            *
FFT_dimensions      1 2 ppm
options             -re -py
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
****************************************************************
-- Accompanying pdf figure was obtained with the additional option --widths 0.25

Now, we will plot the same simulation output (option -plot), but as a filled contour plot, and with a zoom on the peaks.

In [20]:
spinev('cosy/cosy-2QF-ABX -plot -contf --zlog --xlim=4.97,5.03 --ylim=4.06,4.18', opts)
****************************************************************
**   2Q-filtered COSY in ABX system, hypercomplex detection   **
****** The System **********************************************
spectrometer(MHz)   500
spinning_freq(kHz)  *
channels            H1
nuclei              H1 H1 H1
atomic_coords       *
cs_isotropic        4.1 4.14 5.0 ppm
csa_parameters      *
j_coupling          1 3 3
j_coupling          2 3 9
j_coupling          1 2 -14
quadrupole          *
dip_switchboard     *
csa_switchboard     *
exchange_nuclei     *
bond_len_nuclei     *
bond_ang_nuclei     *
tors_ang_nuclei     *
groups_nuclei       *
******* Pulse Sequence *****************************************
CHN 1
timing(usec)        0.5 (1600)1024D1 0.5 (0.5) (1600)1024D2
power(kHz)          500   0          500  500    0
phase(deg)           0    0           0    0     0
freq_offs(kHz)       0    0           0    0     0
phase_cycling_cos  4444   *           *   2341   *  2143(RCV)
phase_cycling_sin  3333   *           *   2341   *  2143(RCV)
******* Variables **********************************************
ppm_center_1=4.56
fig_title="2Q-filtered COSY in ABX system"
******* Options ************************************************
rho0                F1z
observables         F1p
EulerAngles         *
n_gamma             *
line_broaden(Hz)    0 0 3 3
zerofill            *
FFT_dimensions      1 2 ppm
options             -re -py
options_cmd_line   -plot -contf --zlog --xlim=4.97,5.03 --ylim=4.06,4.18 -px -py0 -vm -v0 -vf0 -vsf0 --verb
****************************************************************
-- Accompanying pdf figure was obtained with the additional option --widths 0.25
2022-03-14T21:49:03.193570 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

Interactive Plot: The 2D spectrum above is interactive even in the Web version of this notebook. Hover with a mouse over the figure, and the Zoom/Pan/Home menu will appear.


Now, let's plot the same data again, but as a regular (non-filled) contour plot, using the linear scale instead of logarithmic for the peak height, and using a different (Red-Blue) color map.

In [21]:
spinev('cosy/cosy-2QF-ABX -plot -cont --cmap RdBu --xlim=4.97,5.03 --ylim=4.06,4.18', opts)
****************************************************************
**   2Q-filtered COSY in ABX system, hypercomplex detection   **
****** The System **********************************************
spectrometer(MHz)   500
spinning_freq(kHz)  *
channels            H1
nuclei              H1 H1 H1
atomic_coords       *
cs_isotropic        4.1 4.14 5.0 ppm
csa_parameters      *
j_coupling          1 3 3
j_coupling          2 3 9
j_coupling          1 2 -14
quadrupole          *
dip_switchboard     *
csa_switchboard     *
exchange_nuclei     *
bond_len_nuclei     *
bond_ang_nuclei     *
tors_ang_nuclei     *
groups_nuclei       *
******* Pulse Sequence *****************************************
CHN 1
timing(usec)        0.5 (1600)1024D1 0.5 (0.5) (1600)1024D2
power(kHz)          500   0          500  500    0
phase(deg)           0    0           0    0     0
freq_offs(kHz)       0    0           0    0     0
phase_cycling_cos  4444   *           *   2341   *  2143(RCV)
phase_cycling_sin  3333   *           *   2341   *  2143(RCV)
******* Variables **********************************************
ppm_center_1=4.56
fig_title="2Q-filtered COSY in ABX system"
******* Options ************************************************
rho0                F1z
observables         F1p
EulerAngles         *
n_gamma             *
line_broaden(Hz)    0 0 3 3
zerofill            *
FFT_dimensions      1 2 ppm
options             -re -py
options_cmd_line   -plot -cont --cmap RdBu --xlim=4.97,5.03 --ylim=4.06,4.18 -px -py0 -vm -v0 -vf0 -vsf0 --verb
****************************************************************
-- Accompanying pdf figure was obtained with the additional option --widths 0.25
2022-03-14T21:49:06.315871 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

The following is a full-scale simulation of a 2D spectrum in a 6-spin system under MAS. The computation time is about 5 minutes. Zoom on the peaks to see more detail.

In [22]:
spinev('rfdr/rfdr', opts, HTML=True)
****** The System **************************************************
spectrometer(MHz)   400
spinning_freq(kHz)  8.0
channels            C13
nuclei              C13 C13 C13 C13 C13 C13
atomic_coords       leu.cor
cs_isotropic        leu.cs
csa_parameters      *
j_coupling          leu.j
quadrupole          *
dip_switchboard     *
csa_switchboard     *
exchange_nuclei     *
bond_len_nuclei     *
bond_ang_nuclei     *
tors_ang_nuclei     *
groups_nuclei       *
******* Pulse Sequence **********************************************
CHN 1
timing(usec)        (0)2048D1 0.5 (0) (rfdr8.pp)x2 (0) 0.5 (0)1024D2
power(kHz)           0        500  0    *           0  500  0
phase(deg)           0        270  0    *           0  90   0
freq_offs(kHz)       0        0    0    *           0  0    0
******* Variables ***************************************************
spinning_freq=8
taur=1000/spinning_freq
pulse_1_1_1=taur/6
pulse_1_7_1=taur/3
tsf_4=taur/64
psf_1_4=1/tsf_4
zfilter_[3 5]=1
frs_1_[1 4 7]=[-16 -4 -16]
fig_title="2D RFDF $^{13}$C$-^{13}$C correlation"
******* Options *****************************************************
rho0                F1x
observables         F1p
EulerAngles         rep100
n_gamma             12
line_broaden(Hz)    0 0 60 60
zerofill            *
FFT_dimensions      1c 2
options             -re -py
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb

Interactive Plot: The 2D spectrum above is interactive even in the Web version of this notebook. Hover with a mouse over the figure, and the Zoom/Pan/Home menu will appear.


Chemical Exchange and Dynamics

In [23]:
spinev('chem-exchange/exch', opts)
****** The System *******
spectrometer(MHz)  400
spinning_freq(kHz) *
channels           H1
nuclei             H1 H1
atomic_coords      *
cs_isotropic       1 -1
csa_parameters     *
j_coupling         *
quadrupole         *
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    (1 2)
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      *
******* Pulse Sequence ******************************
CHN 1
timing(usec)      (100)1024
power(kHz)          0
phase(deg)          0
freq_offs(kHz)      0
******* Variables ***********************************
scan_par k_1/0.7 1.5 3 4.4 6 16/
pdata_re=pdata_re/pdata_re(512,6)
fig_title="Chemical Exchange in a Two-Spin System"
******* Options *************************************
rho0               F1x
observables        F1p
EulerAngles        *
n_gamma            *
line_broaden(Hz)   *
zerofill           *
FFT_dimensions     1
options            -re -py
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
******************************************************
-- 4.4 ≈ π√2
-- The signal is normalized by the height of the last peak
2022-03-14T21:54:12.574697 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

Now, we will perform essentially the same simulation as above, but with more points for the exchange rate constant, and visualizing the output as a filled contour plot.

In [24]:
spinev('chem-exchange/exch2D', opts)
****** The System *******
spectrometer(MHz)  400
spinning_freq(kHz) *
channels           H1
nuclei             H1 H1
atomic_coords      *
cs_isotropic       1 -1
csa_parameters     *
j_coupling         *
quadrupole         *
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    (1 2)
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      *
******* Pulse Sequence ******************************
CHN 1
timing(usec)      (100)1024
power(kHz)          0
phase(deg)          0
freq_offs(kHz)      0
******* Variables ***********************************
scan_par k_1/1:50/
k_1.mx = 10^linspace(log10(0.2), log10(50), 50)
fig_title="Chemical Exchange in a Two-Spin System"
******* Options *************************************
rho0               F1x
observables        F1p
EulerAngles        *
n_gamma            *
line_broaden(Hz)   *
zerofill           *
FFT_dimensions     1
options            -re -py -contf --ylog --contn=41 --cmap plasma
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
2022-03-14T21:54:13.748627 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

In [25]:
spinev('quad-echo-dynamics/quad-echo', opts)
*********************************************************************************
** This example implements the dynamical model described in
** Kolokolov, D., Stepanov, A.G., & Jobic, H. (2015).
** Mobility of the 2-Methylimidazolate Linkers in ZIF-8 Probed by 2H NMR:
** Saloon Doors for the Guests. Journal of Physical Chemistry C, 119, 27512-27520.
****** The System ****************************************************************
spectrometer(MHz)  400
spinning_freq(kHz) *
channels           H2
nuclei             H2
atomic_coords      *
cs_isotropic       *
csa_parameters     *
j_coupling         *
quadrupole         1 175 0 0 109.5 0
quadrupole         2 203 0 0 36 90
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      (1) (1 2)
******* Pulse Sequence ******************************
CHN 1
timing(usec)       (2) (20) (2) (21) (3)8k
power(kHz)         125   0  125   0   0
phase(deg)           0   0    0   0   0
freq_offs(kHz)       0   0    0   0   0
phase_cycling       11   *   24   *   * 44(RCV)
******* Variables ***********************************

** CD3 group hopping
group_1_R=["0 0 0; 0 0 120; 0 0 -120"]'

** Two-site flip of a ring bearing the CD3 group and two CD groups
group_2_R=["0 17 0; 0 -17 0"]'

** The signal is a sum of one CD3 and two CD groups
ave_par1d sys2ext_map/1 2/
ave_par1d ave_wht/3 2/

fig_title="Quadrupole Echo: Mobility of ZIF-8 2-mIM-d$_6$ linker"

******* Options *************************************
rho0               F1z
observables        F1p
EulerAngles        asgind50h
n_gamma            *
line_broaden(Hz)   100 2000
zerofill           *
FFT_dimensions     1
options            -re -py
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
2022-03-14T21:54:14.248034 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/
In [26]:
spinev('quad-echo-dynamics/quad-echo-k', opts)
****** The System ****************************************************************
spectrometer(MHz)  600
spinning_freq(kHz) *
channels           H2
nuclei             H2
atomic_coords      *
cs_isotropic       *
csa_parameters     *
j_coupling         *
quadrupole         1 177 0.03 0 0 90
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      (1)
******* Pulse Sequence ******************************
CHN 1
timing(usec)       (2)  (0) (20)  (2) (21) (2.3)256
power(kHz)         125   0    0   125   0   0
phase(deg)          90   0    0     0   0   0
freq_offs(kHz)       0   0    0     0   0   0
******* Variables ***********************************

** Quad Echo Pulse Sequence
p90=2
tau=20
pulse_1_[1 4]_1=p90
power_1_[1 4]_1=1000/(4*p90)
p90a=(power_1_1_1>499)?0:p90  //  actual p90 is zero for ideal pulses
pulse_1_3_1=tau-p90a
pulse_1_5_1=tau-p90a/2

** Select -1 and +1 coherences (instead of phase cycling)
select_2=["-1 1"]

** 180° flip AND ±10° fast librations:
group_1_R_$1=["10  60 0; -10  60 0"]'
group_1_R_$2=["10 -60 0; -10 -60 0"]'

** Pure 2-site 180° flip:
*group_1_R_$1=["0; 60; 0"]
*group_1_R_$2=["0;-60; 0"]

scan_par k_exch(1,2)/10 50 250 1250 6250/

dim_2_units="1/s" // units to use for the legend

** Equilibrium populations
pe_exch=["1; 1"]

** Make a stack plot by shifting the data
pdata_re=pdata_re+ones(2048,1)*["0 1 2 3 4"]*2

** To also normalize by the max intensity, use this instead:
*pdata_re=pdata_re.*(ones(2048,1)*(1./max(pdata_re)))+ones(2048,1)*["0 1 2 3 4 5"]

fig_title="$^2$H spectra of a librating phenylene group undergoing 180° flip"

** Add Cq and eta to the figure and place the legend under the axes box
ani = str(quad_ani_1_$1,3)
asy = str(quad_asy_1_$1,1)
text=f"'$C_Q=[ani]$ kHz [nl]$\eta_Q=[asy]$'"
fig_options = f"--size 6.4,6.4 --legloc 'upper center' --leganch 0.5,-0.15 --legncol 3 --text 0.05,0.9,[text]"

******* Options *************************************
rho0               F1z
observables        F1p
EulerAngles        asgind100h
n_gamma            *
line_broaden(Hz)   100 2000
zerofill           2048
FFT_dimensions     1
options            -xn2 -re -py -lv
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
2022-03-14T21:54:19.835885 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

In [27]:
spinev('cest/cest', opts)
****** The System ***********************************
spectrometer(MHz)  500
spinning_freq(kHz) *
channels           H1
nuclei             H1
atomic_coords      *
cs_isotropic       *
csa_parameters     *
j_coupling         *
quadrupole         *
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      *
******* Pulse Sequence ******************************
CHN 1
timing(usec)       10e+6
power(kHz)         0.2
phase(deg)         0
freq_offs(kHz)     0
******* Variables ***************************************

** state 1 is H2O; state 2 is NH

**********************************************
**  user input
**********************************************

** chemical shifts, kHz
cs_iso_1_$1=0       // H2O
cs_iso_1_$2=-1.75   // NH

** Relaxation rates, Hz
R1$H20=0.2
R2$H20=0.6
R1$NH=2.0
R2$NH=3.0

** NH -> H2O exchange rate, kHz
k_exch(1,2)=0.4

** Molar ratio of H2O to NH protons
M=2000

** saturation pulse frequency sweep
scan_par1d freq_1_1_1/-2.5:0.01:2.5/

** saturation pulse power
scan_par2d power_1_1_1/0.2 0.1 0.05/

***********************************************

** T1 and T2 relaxation times, ms
T1SQ_1_$1=1000/R1$H20
T2SQ_1_$1=1000/R2$H20
T1SQ_1_$2=1000/R1$NH
T2SQ_1_$2=1000/R2$NH

** exchange parameters
p0_exch=["M; 1"]
pe_exch=p0_exch

** average over RF inhomogeneity
ave_par x/-1:0.025:0/
psf_1_1=1+0.05*x
W=sum(cos(pi*x.mx)+1)
ave_wht_1=(cos(pi*x)+1)/W

fig_title = "Chemical Exchange Saturation Transfer (CEST)"

******* Options etc *************************************
rho0               Ieq
observables        I1z
EulerAngles        *
n_gamma   	   *
line_broaden(Hz)   *
zerofill           *
FFT_dimensions     *
options            -xn2 -re -dp -py
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
2022-03-14T21:54:21.572823 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

Data Fitting and Optimization

The following calculation fits the CSA parameters to an experimental CSA sideband spectrum

In [28]:
spinev('csa-fitting/SnC2O4', opts)
****** The System ****************************************************************
spectrometer(MHz)  500
spinning_freq(kHz) 3.8
channels           Sn(74.56 -1/2)
nuclei             Sn
atomic_coords      *
cs_isotropic       *
csa_parameters     1 -600 0.1 0 0 0 ppm
j_coupling         *
quadrupole         *
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      *
******* Pulse Sequence ***********************************************************
CHN 1
timing(usec)      (0)32
power(kHz)         0           
phase(deg)         0       
freq_offs(kHz)     0
******* Variables ****************************************************************

pulse_1_1_1=1000/spinning_freq/32
signal_sf=40
fit_par cs_ani_1 cs_asy_1 signal_sf

** Figure options ****************************************************************
x_label="$^{119}$Sn frequency, kHz"
ani = str(cs_ppm_ani_1,3), x_
asy = str(cs_asy_1,2), x_
text = f"'$\delta_{\mathrm{ani}}=[ani]$ ppm [nl]$\eta_{\delta}=[asy]$'"
fig_options = f"--xinv --markers *b --lines '' --colors ky --text 0.08,0.8,[text]"
fig_title = "CSA sideband fitting in $^{119}$SnC$_2$O$_4$"

******* Options ******************************************************************
rho0               I1x
observables        I1p
EulerAngles        lebind29o
n_gamma            10
line_broaden(Hz)   *
zerofill           *
FFT_dimensions     1
options            -re -fft0 -ws -py
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
**********************************************************************************
-- See comments in the quad1_full example to understand how sideband inteinsities are simulated here
-- Experimental data are taken from Fig. 2(d) in P. Amornsakchai, D.C. Apperley, R.K. Harris, P. Hodgkinson, P.C. Waterfield, Solid-state NMR studies of some tin(II) compounds, Solid State Nucl. Magn. Reson 26 (2004) 160-171
2022-03-14T21:54:21.995066 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

The following calculation is a simplified version of using SpinEvolution to design high-quality selective excitation pulses, as described in detail in M. Veshtort, R.G. Griffin (2004). High-Performance Selective Excitation Pulses for Solid- and Liquid-State NMR Spectroscopy, ChemPhysChem, 5, 834-850.

The pulse shape that this optimization produces (in a fraction of a second!) is the e100A member of the E-Family.

In [29]:
spinev('selective-pulse-design/selpul', opts)
****** The System **********************************************************************
spectrometer(MHz)  *
spinning_freq(kHz) *
channels           H1
nuclei             H1
atomic_coords      *
cs_isotropic       *
csa_parameters     *
j_coupling         *
quadrupole         *
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      *
******* Pulse Sequence *****************************************************************
CHN 1
timing(usec)       t100.tm
power(kHz)         0
phase(deg)         90
freq_offs(kHz)     0
******* Variables **********************************************************************

scan_par cs_iso_1/0:0.025:5/

*** Compute the pulse shape
A=zeros(15,1)
B=zeros(15,1)
n=1:15
t=(50:100:9950)'
C=cos((2*pi/10000)*t*n)
S=sin((2*pi/10000)*t*n)
power_1_1=0.1*(A0+C*A+S*B)

*** Optimization routine options
RFC_TOL=0.001
RDX_FDJ=0.001

fit_par A0 A([1:15]) B([1:15])

*** Show the results *******************************************************************

** Plot the pulse shape
opts1 = "--title='Selective Pulse Optimization: Pulse Shape (e100A)' --xlabel='time, ms' --ylabel '$\omega_1/2\pi$, kHz'"
plot(t, 0.1*(A0+C*A+S*B), opts1), x_

** Recompute the excitation profile using different scan_par steps & range **
** Results will be saved in e100A_re.dat and e100A_im.dat
system("spinev profile -macro{name}=e100A"), x_

** Plot the results
files = "e100A_re.dat e100A_im.dat"
opts2 = " --title='Selective Pulse Optimization: Excitation Profile (e100A)' --xlabel='Frequency Offset, kHz'"
plot(files & opts2), x_

******* Options etc ********************************************************************
rho0               I1z
observables        I1p
EulerAngles        *
n_gamma            *
line_broaden(Hz)   *
zerofill           *
FFT_dimensions     *
options            -varselpul0.par -ne100A -fne100 -o0
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
****************************************************************************************
-- The initial conditions for the optimizarion are loaded from selpul0.par
-- The optimized pulse shape parameters are saved as e100A.par
-- The target excitation profile is specified by the e100_re/im.fit/wht files
-- The profile has has a 100 Hz pure excitation band and 150 Hz transition regions
2022-03-14T21:54:22.628835 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/
2022-03-14T21:54:22.746330 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

In the following spectral fitting calculation, chemical shifts and J-couplings are extracted from an 1H spectrum without any prior knowledge about their values. The figure shows the results of the fitting: the calculated (best-fit) and the experimental (target) spectra are identical, indicating that the spectral fitting was successful.

In [30]:
spinev('spectral-fitting/sfit -fnsfit1', opts)
****** The System *******
spectrometer(MHz)  300
spinning_freq(kHz) *
channels           H1
nuclei             *
atomic_coords      *
cs_isotropic       *
csa_parameters     *
j_coupling         *
quadrupole         *
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      *
******* Pulse Sequence ******************************
CHN 1
timing(usec)      (10000)8192
power(kHz)         0           
phase(deg)         0          
freq_offs(kHz)     0
******* Variables ***********************************
fig_title="Extraction of Chem. Shifts and J-couplings from ABCD-System Spectrum"
******* Options *************************************
rho0               F1x
observables        F1p
EulerAngles        *
n_gamma            *
line_broaden(Hz)   0.5
zerofill           *
FFT_dimensions     1
options            -re -sysh4 -decprec4g -sfit -py
options_cmd_line   -fnsfit1 -px -py0 -vm -v0 -vf0 -vsf0 --verb
**********************************************************
-- Use this file to fit any of the following *.fit files contained in this directory:
sfit1_re.fit, sfit2_re.fit, sfit3_re.fit, sfit4_re.fit. These *.fit files have been generated using parameters saved in sfit1.par, sfit2.par, sfit3.par, and sfit4.par files, accordingly.
-- For example, for spectral fitting of the sfit1_re.fit data, run
spinev sfit -fnsfit1
-- The best-fit parameters will be saved in sfit.par file, which can be compared with the parameter file used to generate the "experimental" data in the sfit1_re.fit file.

2022-03-14T21:54:24.315992 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

In vivo MRS

In [31]:
spinev('mrs-press/press -pseq')
2022-03-14T21:54:26.473917 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/
In [32]:
spinev('mrs-press/press', opts)
*******************************************************************************
** PRESS localization: 1H spectrum averaged over 3D voxel              
** Reference:  Kaiser, L. G., Young, K., Matson, G. B. (2008)
** Numerical simulations of localized high field 1H MR spectroscopy.
** Journal of Magnetic Resonance, 195(1), 67–75.                                                                          
****** The System *************************************************************
spectrometer(MHz)  125
spinning_freq(kHz) *
channels           H1
nuclei             *
atomic_coords      *
cs_isotropic       MOL.cs ppm
csa_parameters     *
j_coupling         MOL.j
quadrupole         *
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      *
******* Pulse Sequence *******************************************************
CHN 1
timing(usec)    (t128.tm) 0 (0) (t200.tm) 0 (0 0) (t200.tm) 0 (4000)8k
power(kHz)      slr90.pwr 0  0   s180.pwr 0  0 0  s180.pwr  0   0
phase(deg)        90      0  0     0      0  0 0    0       0   0
freq_offs(kHz)     0      0  0     0      0  0 0    0       0   0
CHN G
timing(usec)    (t128.tm) 0 (0) (t200.tm) 0 (0 0) (t200.tm) 0 (4000)
grad_offs(kHz)     0      0  0     0      0  0 0    0       0   0
******* Variables ************************************************************

** slr90.pwr is the selective excitation pulse powers, kHz, for a 10 ms pulse
** s180.pwr  is the selective refocusing pulse powers, kHz, for a 10 ms pulse
** See examples/selective-pulses to investigate how these pulses work

** Specify selective pulses lengths, usec
T90 =  4000
T180 = 5000

** Specify (refocusing time)/(pulse length) ratio for the excitation pulse
** The refocusing time for the excitation pulse is given as a comment in slr90.pwr
r90 = 0.5050  // slr90

** Set up the selective excitation pulse
pulse_[1 2]_1=T90/128
psf_1_1=10000/T90

** Set up the selective refocusing pulses
pulse_[1 2]_4=T180/200
pulse_[1 2]_7=T180/200
psf_1_[4 7]=10000/T180

** Coherence pathway selected with the crusher gradinents
select_[2 5]=[-1 1]

** Localization: 3D average over the voxel volume **
** G1, G2, G3 are offsets, kHz, generated by PFGs along X, Y, and Z
ave_par1d G1/-2.5:0.1:2.5/
ave_par2d G2/-1:0.05:1/
ave_par3d G3/-1:0.05:1/
*G[1 2 3]=[0 0 0]  // for a single point inside the voxel
grad_offs_[1 4 7]=G[1 2 3]

** Refocus the linear phase generated by the selective excitation pulse
pulse_[1 2]_6_1=T90*r90
grad_offs_6_1=G1

** Additional interpulse delays (due to crusher gradients etc.)
t1=1000
t2=1000
pulse_[1 2]_3_1=t1
pulse_[1 2]_6_2=t1+t2
pulse_[1 2]_8_1=t2

fig_options="--text 0.07,0.90,Myo-inositol"
fig_title="PRESS localization: 1H spectrum averaged over 3D voxel"

******* Options ***************************************************************
rho0               F1z
observables        F1p
EulerAngles        *
n_gamma            *
line_broaden(Hz)   1
zerofill           *
FFT_dimensions     1 ppm
options       -re -macroMOL=myo-inositol -sysh6 -varppm_center_1=3.6 -py
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
*******************************************************************************
-- A different molecule can be easily chosen by using different values for the
command line options -macroMOL=... -sysh... -varppm_center_1=...
2022-03-14T21:55:00.932534 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/
In [33]:
spinev('mrs-slaser/slaser2D -pseq -varX3=0.75')
EQ4000A B1max = 24 uT
GOIA   B1max = 24.9 uT
2022-03-14T21:55:06.123825 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/
In [34]:
spinev('mrs-slaser/slaser2D', opts)
EQ4000A B1max = 24 uT
GOIA   B1max = 24.9 uT
******************************************************************************************                                                                              
** EQ4000A/GOIA-W(16,4) semi-LASER slice map in N-acetylaspartate (NAA)
** The spin system: one NH proton and one CH3 proton
** Reference:
** Kaiser et al., Broadband selective excitation radiofrequency pulses for optimized localization in vivo, Magnetic Resonance in Medicine (2022)
** https://doi.org/10.1002/mrm.29119           
****** The System ************************************************************************
spectrometer(MHz)  125
spinning_freq(kHz) *
channels           H1
nuclei             H1 H1
atomic_coords      *
cs_isotropic       7.84 2 ppm
csa_parameters     *
j_coupling         *
quadrupole         *
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      *
******* Pulse Sequence *******************************************************************
CHN 1
timing(usec)   (tNs.tm) 0 (0) (t256.tm) 0 (0 0) (<4>) 0 (0) (<4>) 0 (0) (<4>) 0
power(kHz)    SHAPE.pwr 0  0   goia.pwr 0  0 0    *   0  0    *   0  0    *   0
phase(deg)    SHAPE.phs 0  0   goia.phs 0  0 0    *   0  0    *   0  0    *   0
freq_offs(kHz)       0  0  0        0   0  0 0    *   0  0    *   0  0    *   0
CHN G
timing(usec)   (tNs.tm) 0 (0) (t256.tm) 0 (0 0) (<4>) 0 (0) (<4>) 0 (0) (<4>) 0
grad_offs(kHz)      0   0  0        0   0  0 0    *   0  0    *   0  0    *   0
******* Variables ************************************************************************

** <4> at the timing(usec) line above means "the same as pulse sequence 4"
** SHAPE and Ns are macros set at the options line
** SHAPE.pwr/phs are the excitation pulse powers, kHz, and phases, deg, for a 10 ms pulse
** goia.pwr/phs are the refocusing pulse powers, kHz, and phases, deg, for a 10 ms pulse
** See slaser1D and examples/selective-pulses to investigate how these pulses work

** Specify the location of the spectrum center (zero frequecy in kHz) in ppm
ppm_center_1=4.9

** Specify selective excitation pulse length, usec
** EQ4000A: 5000, EB2000A: 4000, P10: 1600
T90 = ("SHAPE"=="EQ4000A")? 5000 : (("SHAPE"=="EB2000A")? 4000 : 1600)

** Specify selective refocusing GOIA-W(16,4) pulse length, usec
T180 = 2700

** Specify (refocusing time)/(pulse length) ratio for the excitation pulse
** The refocusing time for the excitation pulse is given as a comment in SHAPE.pwr
r90 = ("SHAPE"=="EQ4000A")? 0.43823 : (("SHAPE"=="EB2000A")? 0.29997 : 0.188)
*r90 = 0.43823  // EQ4000A
*r90 = 0.29997  // EB2000A
*r90 = 0.188    // P10

** Specify the pulse bandwidths, kHz
BW90 = ("SHAPE"=="EQ4000A")? 8.4 : (("SHAPE"=="EB2000A")? 5.6 : 4.0)
BW180 = 20*3500/T180  // The original pulse is 20 kHz for 3.5 ms pulse length

** Set up the selective excitation pulse
pulse_[1 2]_1=T90/Ns
psf_1_1=10000/T90
phase_1_1=phase_1_1+90  // to observe as Ix

** Print B1max, uT, for the excitation pulse
disp("SHAPE B1max = "&str(1000*max(abs(power_1_1*psf_1_1))/42.5773,3)&" uT")

** Set up the selective refocusing pulses
pulse_1_[4 7 10 13]=T180/256
pulse_2_[4 7 10 13]=T180/256
psf_1_[4 7 10 13]=10000/T180

** Print B1max, uT, for the refocusing pulse
disp("GOIA   B1max = "&str(1000*max(abs(power_1_4*psf_1_4))/42.5773,3)&" uT")

** Coherence pathway selected with the crusher gradinents
select_[2 5 8 11]=[-1  1 -1  1]

** Localization **
** Gradient strengths, kHz/cm required to localize a 1cm x 1cm x 1cm voxel
G1 = BW90   // X axis
G2 = BW180  // Y axis
G3 = BW180  // Z axis
** X1, X2 and X3 are the spacial offsets, cm, from the gradients center
X3 = 0   //  fixed offest along Z
scan_par1d X2/0.75:-0.01:-0.75/
scan_par2d X1/0.75:-0.01:-0.75/
grad_offs_1=X1*G1
g=load("goia.pfg")
grad_offs_[4 7 10 13]=g*X[2 2 3 3]*G[2 2 3 3]

** Refocus the linear phase generated by the selective excitation pulse
pulse_[1 2]_6_1=T90*r90
grad_offs_6_1=X1*G1

** Additional interpulse delays (due to crusher gradients etc.)
t1=1000
t2=1000
pulse_[1 2]_3=t1
pulse_[1 2]_6_2=t1+t2
pulse_[1 2]_9=t1+t2
pulse_[1 2]_12=t1+t2
pulse_[1 2]_14=t2

** Truncate the negative signal
pdata_re = (pdata_re<0)?0:pdata_re

x_label="Y (ref 180°), mm"
y_label="X (exc 90°), mm"
fig_title = f"Localization map of a SHAPE/GOIA-W(16,4) semi-LASER slice [nl] in a two-spin system with signals at 2.0 and 7.8 ppm"
fig_options = "--contn 11 --cmap gray --scaled --colorbar-off"

******* Options **************************************************************************
rho0               0.5*F1z
observables        F1p
EulerAngles        *
n_gamma            *
line_broaden(Hz)   *
zerofill           *
FFT_dimensions     *
options            -re -py -contf -macroNs=400 -macroSHAPE=EQ4000A
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
******************************************************************************************
-- Any of the three available shapes can be chosen by setting SHAPE macro to EQ4000A, EB2000A, or P10
-- The Ns macro (the number of steps in the shape) must be then set to 400 for EQ4000A, and to 256 for EB2000A or P10
2022-03-14T21:55:08.567659 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

Generating a complex figure

SpinEvolution plot command can be used to automatically generate complex publication-ready figures from the simulation results

In [35]:
spinev('figure/figure',opts)
****** The System ******************************************************
spectrometer(MHz)  *
spinning_freq(kHz) *
channels           H1
nuclei             H1
atomic_coords      *
cs_isotropic       *
csa_parameters     *
j_coupling         *
quadrupole         *
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      *
******* Pulse Sequence **************************************************
CHN 1
timing(usec)       0
power(kHz)         0
phase(deg)         0
freq_offs(kHz)     0
******* Variables *******************************************************

** This input file has been used to generate Figure 2 for the following paper:

** Kaiser et al., Broadband selective excitation radiofrequency pulses for optimized localization in vivo, Magnetic Resonance in Medicine (2022)
** https://doi.org/10.1002/mrm.29119

** There is no need to read the above paper to understand this input file
** Just see the resulting figure (figure.pdf) and follow the notes below

** The figure illustrates the properties of three selective excitation pulses
** Each row of subfigures corresponds to one of these pulses:
** P10, EB2000A, and EQ4000A
** The 1st column of subfigures shows the pulse shape
** The 2nd column shows the excitation profile
** The 3rd column shows a 2D slice simulation as a filled contour plot

** The data files for this figure were generated using
** examples/selective-pulses/sel-exc and examples/mrs-slaser/slaser2D

** Please read the following sections in the Plot Manual:
* Multiple subplots
* (La)TeX-style formatting
* Execution of user-specified Matplotlib code
* Options: --axes, --text

****************************************************************************

** Figure width and height, in
FW=6.90  // full page width
FH=5.65

** Aspect Ratio (W/H) for the subfigures
AR = 4/3

** The placement of the lower left subfigure will be specified as --axes X0,Y0,W,H
X0 = 0.060      // units: fraction of FW
Y0 = 0.060      // units: fraction of FH
H = 0.281       // units: fraction of FH
W = AR*H*FH/FW  // units: fraction of FW

** Horizontal and vertical spacing b/w subfigures, fractional units
dx = 0.054
dy = 0.046

** The placement of the filled contour plots (the 3rd column of subfigures)
X3 = X0+2*(W+dx)-0.02 // X0 of the 3rd column of subfigures, fractional units
W3 = H*FH/FW          // W of the 3rd column of subfigures (making them square)

** Axes labeling for the filled contour plots
T3 = "--text 0.30,0.03,'ref 180°\, mm',,w --text 0.92,0.30,'exc 90°\, mm',,w,90"

** Subfigure letter location, fractional coordinates
L = "0.07,0.87"

** Options for EQ4000A subfigures (G,H,I)

Q1 = f"EQ4000A_plot1.dat --xlabel 'time, ms' --ylabel '$B_1$ amplitude, $\mu T$' --ylim=-25,25 --xlim=0,5 --text 0.91,0.07,'EQ4000A',9.5,,90 --text [L],$\mathbf{G}$,11 --axes [X0],[Y0],[W],[H] "

Q2 = f"EQ4000A_re.dat --xlabel 'frequency offset, kHz' --ylim=-0.43,1.07 --ynticks 3 --xlim=-8,8 --xnticks 5 --text -1.8,0.35,'8.4 kHz',,,,d --exec ax.hlines(0.5,-4.2,4.2,colors='k',linewidths=0.7) --text [L],$\mathbf{H}$,11 --axes [X0+W+dx],[Y0],[W],[H] "

Q3 = f"EQ4000A_2D_re.dat --contf --axis-off --text [L],'$\mathbf{I}$',11,w [T3] --axes [X3],[Y0],[W3],[H] "

** Options for EB2000A subfigures (D,E,F)

B1 = f"EB2000A_plot1.dat --ylabel '$B_1$ amplitude, $\mu T$' --ylim=-25,25 --xlim=0,4 --text 0.91,0.07,'EB2000A',9.5,,90 --text [L],$\mathbf{D}$,11 --axes [X0],[Y0+H+dy],[W],[H] "

B2 = f"EB2000A_re.dat --ylim=-0.43,1.07 --ynticks 3 --xlim=-8,8 --xnticks 5 --text -1.8,0.35,'5.6 kHz',,,,d --exec ax.hlines(0.5,-2.8,2.8,colors='k',linewidths=0.7) --text [L],$\mathbf{E}$,11 --axes [X0+W+dx],[Y0+H+dy],[W],[H] "

B3 = f"EB2000A_2D_re.dat --contf --axis-off --text [L],'$\mathbf{F}$',11,w [T3] --axes [X3],[Y0+H+dy],[W3],[H] "

** Options for P10 subfigures (A,B,C)

P1 = f"P10_plot1.dat --ylabel '$B_1$ amplitude, $\mu T$' --legend real,imag --legloc 'upper center' --ylim=-25,25 --xlim=0,1.6 --text 0.91,0.14,'P10',9.5,,90 --text [L],$\mathbf{A}$,11 --axes [X0],[Y0+2*(H+dy)],[W],[H] "

P2 = f"P10_re.dat --legend '$M_x$, $M_y$' --ylim=-0.43,1.07 --ynticks 3 --xlim=-8,8 --xnticks 5 --text -1.10,0.33,'4 kHz',,,,d --exec ax.hlines(0.5,-2,2,colors='k',linewidths=0.7) --text [L],$\mathbf{B}$,11 --axes [X0+W+dx],[Y0+2*(H+dy)],[W],[H] "

P3 = f"P10_2D_re.dat --contf --axis-off --text [L],$\mathbf{C}$,11,w [T3] --axes [X3],[Y0+2*(H+dy)],[W3],[H] "

** Plot the Figure
** Options common to all subfigures are given first, followed by the options for each subfigure

plot(f"--lines=-,-- --colors=k --widths=0.9 --font Arial --fontsize 9 --ksize 8 --xpad 4 --ypad 2 --ykpad 2 --ticks-in --size [FW],[FH] --contn 11 --cmap gray --colorbar-off --save figure.pdf " & P1 & P2 & P3 & B1 & B2 & B3 & Q1 & Q2 & Q3)

******* Options etc *****************************************************
rho0               I1z
observables        I1z
EulerAngles        *
n_gamma            *
line_broaden(Hz)   *
zerofill           *
FFT_dimensions     *
options            -v0 -o0
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
**************************************************************************
2022-03-14T21:55:09.467863 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

EPR

In [36]:
spinev('epr/e-N14', opts)
************************************************************************************
* TEMPO/Nitroxide EPR powder pattern
* Data from: W. Snipes, J. Cupp, G. Cohn, and A. Keith, Biophys. J. 14 (1974), 20
* See also Fig. 3 in:  K.R. Thurber, R. Tycko, J. Chem. Phys., 137, 084508 (2012).
****** The System ******************************************************************
spectrometer(MHz)  *
spinning_freq(kHz) *
channels           e N14
nuclei             e N14
atomic_coords      *
cs_isotropic       *
csa_parameters     *
g-tensor           1 2.0094 2.0061 2.0021 0 0 0
j_coupling         *
spin-spin_coupling 1 2 43.1e+3 49.3e+3 0.012 0 0 0
quadrupole         *
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      *
******* Pulse Sequence ******************************
CHN 1
timing(usec)      (0.0004)8192
power(kHz)         0           
phase(deg)         0       
freq_offs(kHz)     0
CHN 2
timing(usec)      0.0004
power(kHz)         0           
phase(deg)         0       
freq_offs(kHz)     0
******* Variables *************************************************************

B0_field=9.4

** Convert the output data labeling from Frequency offset, kHz to Frequency, GHz
dim_1_labels= ref_freq_1*1e-3 + dim_1_labels*1e-6

x_label = "Frequency, GHz"
fig_title = "TEMPO/Nitroxide EPR powder pattern at 9.4T (e-$^{14}$N spin system)"

******* Options ****************************************************************
rho0               I1x
observables        I1p
EulerAngles        asgind100o
n_gamma            *
line_broaden(Hz)   5e+6
zerofill           *
FFT_dimensions     1
options            -re -py
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
*********************************************************************************
-- We use powder averaging over just one octant (the 'o' suffix in asgind100o).
This is legal only because both tensors are alligned with the crystal axes.
2022-03-14T21:55:10.176139 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

In the following figure, the main plot is supplemented with two instes, showing the shape of a single peak, and the "symmetric staircase" shape of the baseline, which is completely unnoticeable on the full-scale spectrum.

In [37]:
spinev('epr/Mn55', opts)
****** The System *******
spectrometer(MHz)  500
spinning_freq(kHz) *
channels           e6(329688 -5/2) Mn55
nuclei             e6 Mn55
atomic_coords      *
cs_isotropic       *
csa_parameters     *
g-tensor           1 2.0023 2.0023 2.0023 0 0 0
j_coupling         *
spin-spin_coupling 1 2 250e+3 0 0 0 0 0
zerofield_coupling 1 1500e+3 0 0 0 0
quadrupole         *
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      *
******* Pulse Sequence ******************************
CHN 1
timing(usec)      (0.00004)64k
power(kHz)         0           
phase(deg)         0       
freq_offs(kHz)     0
CHN 2
timing(usec)      0.00004
power(kHz)         0           
phase(deg)         0       
freq_offs(kHz)     0
******* Variables ***********************************

** Place the reference frequency at the center of the spectrum
ref_freq_1 = ref_freq_1 + 1e-3*cs_iso_1

** Convert the output data labeling from Frequency offset, kHz to Frequency, GHz
dim_1_labels = dim_1_labels*1e-6 + ref_freq_1*1e-3

*** Plotting the output ****************************

* Create THREE plots (on the same figure) from the output data:
* 1) full scale plot, 2) zoom on the baseline, and 3) zoom on one of the peaks
* -pu option is used to force plotting output solely from fig_options

X = f"--widths 0.8 --save [name_]_re.pdf "
A = "Mn55_re.dat --title '$^{55}$Mn(II) EPR' --xlabel 'Frequency, GHz' --axes 0.1,0.1,0.8,0.8 "
B = "Mn55_re.dat --ylim=-0.05,0.25 --axes 0.60,0.63,0.28,0.25 "
C = "Mn55_re.dat --xlim=328.39,328.53 --axes 0.16,0.63,0.28,0.25"

fig_options = X & A & B & C

******* Options *************************************
rho0               I1x
observables        I1p
EulerAngles        asgind200o
n_gamma            *
line_broaden(Hz)   2e+6 2e+6
zerofill           *
FFT_dimensions     1
options            -re -py -pu -px
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
******************************************************

-- Note the space at the end of the strings we use to build fig_options
-- --axes option arguments: x0,y0,width,height, where x0,y0 are the coordinates of the lower left corner of the axes box, and width,height are its sizes; all four parameters are given as fractions of the corresponding full figure sizes (WxH)
-- $^{55}$Mn(II) is the title written using mathtext (~TeX) formatting
-- -px option saves Mn55_pl.json file, which can be used to create exactly the same figure by running "plot Mn55" from the command line (i.e. without re-running the whole spinev calculation). One can also edit this file manually to adjust the placement of the axes and other figure options
-- --widths option sets the width of the plot lines (in points, 1 point = 1/72 inch)
-- 'f' in front of a string instructs to format it, i.e. to expand all bracketed exressions inside the string; name_ is the name (or path), from which all output file names are constructed by appending _re.dat etc.
-- Run "plot -h" from the command line to see more details on plot options
2022-03-14T21:55:12.910415 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

DNP

In [38]:
spinev('dnp/static-se-profiles', opts)
***************************************************************************************
***  This simulation reproduces Fig. 8 from: Y. Hovav, A. Feintuch, S. Vega (2010).
***  Theoretical aspects of dynamic nuclear polarization in the solid state - The solid
***  effect. Journal of Magnetic Resonance, 207(2), 176–189.
****** The System *********************************************************************
spectrometer(MHz)  144
spinning_freq(kHz) *
channels           e H1
nuclei             e H1
atomic_coords      *
cs_isotropic       *
csa_parameters     *
j_coupling         *
spin-spin_coupling 1 2 868 -2125 0 0 30 0
quadrupole         *
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      *
******* Pulse Sequence ******************************
CHN 1
timing(usec)      (10000)x512
power(kHz)         0
phase(deg)         0
freq_offs(kHz)     0
CHN 2
timing(usec)       10000
power(kHz)         0
phase(deg)         0
freq_offs(kHz)     0
******* Variables ***********************************

spin_temp=100

** DQ Solid Effect
scan_par1d freq_1_1_1/-146e3:5:-142e3/

** ZQ Solid Effect
*scan_par1d freq_1_1_1/142e3:5:146e3/

scan_par2d power_1_1_1/1000 100 20/

T2SQ_1=0.01    // T2e, ms
T2SQ_2=1       // T2n, ms

T1SQ_1=5       // T1e, ms
T1SQ_2=1000    // T1n, ms

** Additional T2 relaxation parameters to use with -rmz model
*T2ZQ_1_2_1=0.01
*T2DQ_1_2_1=0.01

** Hyperfine coupling used in the paper: -460*I1zI2z+690*(I1zI2p+I1zI2m) [kHz]
** The fact that we are using the same parameters here can be verified by
** commenting out the scan paramaters above and dim_1_units below, uncommenting
*disp(H_("I1zI2z",0))
*disp(H_("I1zI2p+I1zI2m",0))
** and running the simulation in the analytic mode (with the -am option)

dim_1_units="MHz"
y_label = "$\epsilon_B$"
fig_options="--yrot --ysize 12"
fig_title = "Solid Effect Field Profiles in Static Samples (e-H spin system)"

******* Options ***********************************************
rho0               Ieq
observables        I2z
EulerAngles        *
n_gamma            *
line_broaden(Hz)   *
zerofill           *
FFT_dimensions     *
options            -ns1 -dp -re -id1e6 -lv -py
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
******************************************************************************************
-- Option -id1e6 is required here to prevent SpinEvolution from interpreting pulses with power >=500kHz as ideal; the option sets this limit to 1000MHz
-- The simulatiom is performed via the Liouville space propagator (option -lv)
2022-03-14T21:55:13.387200 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

In [39]:
spinev('dnp/mas-se-powder', opts)
***********************************************************************************
****  MAS Solid Effect: field profile (powder averaging over 50 crystallites) *****
****** The System *****************************************************************
spectrometer(MHz)  500
spinning_freq(kHz) 10
channels           e H1
nuclei             e H1
atomic_coords      *
cs_isotropic       *
csa_parameters     1 500 0.7 20 30 40
j_coupling         *
spin-spin_coupling 1 2 868 -2125 0 0 30 0
quadrupole         *
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      *
******* Pulse Sequence ******************************
CHN 1
timing(usec)       (100)x65536
power(kHz)         500
phase(deg)         0
freq_offs(kHz)     0
CHN 2
timing(usec)       100
power(kHz)         0
phase(deg)         0
freq_offs(kHz)     0
******* Variables ***********************************

spin_temp=100

** ZQ SE
scan_par freq_1_1_1/499e3:100:501e3/

** DQ SE
*scan_par freq_1_1_1/-501e3:100:-499e3/

T2SQ_1=0.01  // T2e, ms
T2SQ_2=1     // T2n, ms
T1SQ_1=5     // T1e, ms
T1SQ_2=1000  // T1n, ms

dim_1_units="MHz"
y_label = "$\epsilon_B$"
fig_options="--yrot --ysize 12  --markers ."
fig_title = "Solid Effect Field Profile (e-H spin system)"

******* Options *************************************
rho0               Ieq
observables        F2z
EulerAngles        leb50
n_gamma            *
line_broaden(Hz)   *
zerofill           *
FFT_dimensions     *
options            -ns1 -dp -re -id1e6 -lv -py
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
****************************************************************************************
-- Option -id1e6 is required here to prevent SpinEvolution from interpreting pulses with power >=500kHz as ideal; the option sets this limit to 1000MHz
-- MAS DNP simulations are always performed using automatically chosen integration steps
-- Powder averaging: no need to average over gamma; average only over alpha and beta
-- Note that we are not averaging here over different mutual orientations of the hyperfine coupling tensor and the g-tensor, i.e. over the various locations of the 1H around e
2022-03-14T21:55:15.373291 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

In [40]:
spinev('dnp/btbk', opts)
******************************************************************************
*  Cross-effect field profile for the bTbK molecule
*  This is a simplified (e-e-H) version of the full 5-spin btbkn example
****** The System *************************************************************
spectrometer(MHz)  200
spinning_freq(kHz) 5
channels           e H1
nuclei             e e H1
atomic_coords      *
cs_isotropic       *
csa_parameters     *
g-tensor           1 2.0097 2.0065 2.0024   0   0   0
g-tensor           2 2.0097 2.0065 2.0024 -58 79 -118
j_coupling         *
spin-spin_coupling 1 2 0 -60e3 0 0 65 0
spin-spin_coupling 1 3 0 3e3 0 0 0 0
quadrupole         *
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      *
******* Pulse Sequence ******************************
CHN 1
timing(usec)       (200)x65536
power(kHz)         1000
phase(deg)         0
freq_offs(kHz)     0
CHN 2
timing(usec)       200
power(kHz)         0
phase(deg)         0
freq_offs(kHz)     0
******* Variables ***********************************

spin_temp=100

ref_freq_1=131.725e+3
scan_par B0_field/4.679:0.001:4.707/

T2SQ_[1 2]=0.001  // T2e, ms
T1SQ_[1 2]=0.15   // T1e, ms
T1SQ_3=100        // T1n, ms

fig_title = "bTbK Field Profile: 3-spin vs 5-spin systems"
y_label = "$\epsilon_B$"
fig_options="--yrot --ysize 12 --markers . --colors kr"
legend_labels="e$_2$H, e$_2$N$_2$H"

******* Options *************************************
rho0               Ieq
observables        I3z
EulerAngles        leb50
n_gamma            *
line_broaden(Hz)   *
zerofill           *
FFT_dimensions     *
options            -ns1 -dp -re -id1e6 -v1 -lvc -xtol8e-4 -py -refbtbkn
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
****************************************************************************************
-- Option -id1e6 is required here to prevent SpinEvolution from interpreting pulses with power >=500kHz as ideal; the option sets this limit to 1000MHz
-- MAS DNP simulations are always performed using automatically chosen integration steps
2022-03-14T21:57:07.060611 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

In [41]:
spinev('dnp/dp', opts)
*******************************************************
****               Depolarization                  ****
****** The System *************************************
spectrometer(MHz)  500
spinning_freq(kHz) 10
channels           e H1
nuclei             e e H1
atomic_coords      e2h.cor
cs_isotropic       *
csa_parameters     1 800000 0.8 0 0 0
csa_parameters     2 800000 0.8 0 30 70
j_coupling         *
quadrupole         *
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      *
******* Pulse Sequence ******************************
CHN 1
timing(usec)      (100)x65536
power(kHz)         0
phase(deg)         0
freq_offs(kHz)     0
CHN 2
timing(usec)      100
power(kHz)         0
phase(deg)         0
freq_offs(kHz)     0
******* Variables ***********************************

scan_par1d spinning_freq/0.2:0.2:1 1.5 2/
scan_par2d T1e/0.1 1 10/

spin_temp=100
pulse_[1 2]_1_1=1000/spinning_freq

T2SQ_[1 2]=0.01  // T2e, ms
T1SQ_[1 2]=T1e   // T1e, ms
T1SQ_3=1000      // T1n, ms

dim_2_name="$T_{1e}$"
dim_2_units="ms"
y_label="Depolarization"
fig_title="Depolarization (e-e-H spin system)"
fig_options="--markers . --colors krg"

******* Options *************************************
rho0               Ieq
observables        I3z
EulerAngles        leb50
n_gamma            *
line_broaden(Hz)   *
zerofill           *
FFT_dimensions     *
options            -ns1 -dp -re -id1e6 -v1 -lv -py
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
****************************************************************************************
-- Option -id1e6 is required here to prevent SpinEvolution from interpreting pulses with power >=500kHz as ideal; the option sets this limit to 1000MHz
-- MAS DNP simulations are always performed using automatically chosen integration steps
2022-03-14T21:58:43.625961 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

Quadrupolar Nuclei

In the following spectrum, each sideband in represented by a signle point that gives the integral intensity of the sideband. Hence a bar plot is used to visualize the spectrum. The central peak is erased.

In [42]:
spinev('quadrupoles/quad1_full', opts)
****** The System *****************************
spectrometer(MHz)  500
spinning_freq(kHz) 10
channels           X(200 3/2)
nuclei             X
atomic_coords      *
cs_isotropic       *
csa_parameters     *
j_coupling         *
quadrupole         1 1000 0.25 0 0 0
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      *
******* Pulse Sequence ************************
CHN 1
timing(usec)      (0)128
power(kHz)         0
phase(deg)         0
freq_offs(kHz)     0
****** Variables *******************************

pulse_1_1_1=1000/spinning_freq/128

x_lim=["-600 600"]
y_lim=["0 1.6"]

fig_title="Full Sideband Manifold (integral peak intensities)"
fig_options="--markers b --text 0.85,0.9,$I=3/2$"

******* Options ********************************
rho0               I1x
observables        I1p
EulerAngles        lebind65o
n_gamma            128
line_broaden(Hz)   *
zerofill           *
FFT_dimensions     1
options            -re -fft0 -ws -py
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
************************************************
-- This computes the intensities of the spinning sidebands
-- The -fft0 option sets the number of frequency bins for collecting the spectral intensities during the g-COMPUTE algorithm to the number of points in D1 (i.e. 128). The spacing between the centers of the bins is made to coincide with the spinning frequency by choosing the dwell time equal to the 1/128-th of the rotor period, which makes the spectral width equal to 128 spinning frequencies. With this choice, each sideband, although broadened by the the 2nd-order quadruplar interaction, is collected in just one bin. The total intensity collected in that bin (i.e. the intensity of the point in the spectrum on the output) then reflects the total sideband intensity over all orientations in the powder.
-- Since the 2nd-order quadruplar interactions (although present in the
Hamiltonian) do not affect the total intensities of the sidebands, exactly the same spectrum can be obtained with the -quad1 option.
-- The -ws option is specified to disable the interpolation of the spectal frequencies (as functions of the orientation), which is useless in this case since the frequencies are made orientation-independent by the way they are binned. Enabling interpolation would produce the same result, but it would take longer to compute.
-- This kind of input file is easily remade into a sideband fitting task (see csa-sb-fitting example).
2022-03-14T21:58:44.123494 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

The following shows the spectrum of exactly the same system, but now the spectrum consists of 2 million points, which is enough to digitize the detailed lineshape of each sideband. If zoomed onto, each sideband will show a unique lineshape.

In [43]:
spinev('quadrupoles/quad_full', opts)
****** The System ************************************
spectrometer(MHz)  500
spinning_freq(kHz) 10
channels           X(200 3/2)
nuclei             X
atomic_coords      *
cs_isotropic       *
csa_parameters     *
j_coupling         *
quadrupole         1 1000 0.25 0 0 0
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      *
******* Pulse Sequence ************************
CHN 1
timing(usec)     (0.5)2m
power(kHz)         0
phase(deg)         0
freq_offs(kHz)     0
****** Variables ******************************
x_lim=["-600 600"]
y_lim=["-5 230"]
fig_title="Full Sideband Manifold with 2nd-Order Lineshapes"
fig_options="--text 0.85,0.9,$I=3/2$"
******* Options *******************************
rho0               I1x
observables        I1p
EulerAngles        asgind100o
n_gamma            200
line_broaden(Hz)   0.25
zerofill           *
FFT_dimensions     1
options            -re -py
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
*****************************************************
-- See quad_sb for an individual sideband computation and comments
2022-03-14T21:58:54.563665 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

The spectrum below is again computed for exactly the same system as the two spectra above. However, it is now computed centered at the -100 kHz sideband, and with a lowpass filter that leaves only 1024 points in the output spectrum.

In [44]:
spinev('quadrupoles/quad_sb', opts)
****** The System **************************
spectrometer(MHz)  500
spinning_freq(kHz) 10
channels           X(200 3/2)
nuclei             X
atomic_coords      *
cs_isotropic       100
csa_parameters     *
j_coupling         *
quadrupole         1 1000 0.25 0 0 0
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      *
******* Pulse Sequence *********************
CHN 1
timing(usec)     (0.5)2m
power(kHz)         0
phase(deg)         0
freq_offs(kHz)     0
****** Variables ***************************
dim_1_labels = dim_1_labels - cs_iso_1
fig_title="Single Spinning Sideband Lineshape"
fig_options="--text 0.85,0.9,$I=3/2$"
******* Options ****************************
rho0               I1x
observables        I1p
EulerAngles        asgind100o
n_gamma            200
line_broaden(Hz)   *
zerofill           *
FFT_dimensions     1
lowpass_npoints    1024
options            -re -py
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
********************************************
-- A single sideband can be obtained by shifting the spectrum to place
the sideband at zero frequency and then turning on the lowpass feature. In this example, the "full" spectrum with 2M points is cut down to the 1024 points. The resulting spectum is computed at the same resolution (SW/npoints) as the full spectrum would have been computed. A different resolution can be set by the variable lowpass_sw, in which case the number 2M would be essentially ignored.
-- One can verify that the output in this example coincides with the 10th sideband in the spectrum obtained in the quad_full example (except for a much higher resolution).
-- Note that the spectral width specified by the pulse sequence should be sufficient to cover the full spectrum to prevent folding.
2022-03-14T21:58:55.752644 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/

And finally, we compute the static (no MAS) spectrum of the same system

In [45]:
spinev('quadrupoles/quad1_stat', opts)
****** The System ****************************************
spectrometer(MHz)  500
spinning_freq(kHz) *
channels           X(200 3/2)
nuclei             X
atomic_coords      *
cs_isotropic       *
csa_parameters     *
j_coupling         *
quadrupole         1 1000 0.25 0 0 0
dip_switchboard    *
csa_switchboard    *
exchange_nuclei    *
bond_len_nuclei    *
bond_ang_nuclei    *
tors_ang_nuclei    *
groups_nuclei      *
******* Pulse Sequence ************************************
CHN 1
timing(usec)      (0.5)1024
power(kHz)          0
phase(deg)          0
freq_offs(kHz)      0
****** Variables ******************************************
fig_title="First-Order Static Spectrum"
fig_options="--text 0.1,0.9,$I=3/2$"
******* Options *******************************************
rho0               I1x
observables        1.73|-1/2><-3/2| 1.73|3/2><1/2| I1p
EulerAngles        asgind100o
n_gamma            *
line_broaden(Hz)   *
zerofill           *
FFT_dimensions     1
options            -re -quad1 -rsp -py
options_cmd_line   -px -py0 -vm -v0 -vf0 -vsf0 --verb
***********************************************************
-- This computes the spectra produced by each of the two observable transitions individually (the first two observables), as well as the total spectum obtained by observing I1p.
-- Note that I1p=1.73205(|-1/2><-3/2|+|3/2><1/2|) + 2.0|1/2><-1/2|
This can be observed, for example by running this input file with options
-s -sm, or by running the quad_norm example
-- The -rsp (remove singular peaks) option removes coherences with orientation-indepenent frequencies from the spectra. Since the second-order-broadening is not present in the Hamiltonian (due to the -quad1 option), the central transition is removed from the I1p spectrum.
-- See quad2_stat for the second-order effects
2022-03-14T21:58:56.108327 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/