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/