# deer_4p_soft_diag.m

Complete set of simulations related to four-pulse DEER. Runs pulse diagnostics, which is followed by echo diagnostics, which is followed by DEER simulation.

## Syntax

    deer_4p_soft_diag(spin_system,parameters)


## Arguments

     parameters.pulse_frq  - frequencies for the four
pulses, Hz

parameters.pulse_pwr  - power levels for the four
pulses, Hz

parameters.pulse_dur  - durations for the four
pulses, seconds

parameters.pulse_phi  - initial phases for the four

parameters.pulse_rnk  - Fokker-Planck ranks for the
four pulses

parameters.p1_p2_gap  - time between the end of the
first and the start of the
second pulse, seconds

parameters.p2_p4_gap  - time between the end of the
second the start of the third
pulse, seconds

parameters.p3_nsteps  - number of third pulse posi-
tions in the interval between
the first echo and the fourth
pulse

parameters.echo_time  - time to sample around the ex-
pected second echo position

parameters.echo_npts  - number of points in the second
echo discretization

parameters.rho0       - initial state

parameters.coil       - detection state

parameters.offset     - receiver offset for the time
domain detection, Hz

parameters.sweep      - sweep width for time domain
detection, Hz

parameters.npoints    - number of points in the free
induction decay

parameters.method     - soft puse propagation method,
'expv' for Krylov propagation,
'expm' for exponential propa-
gation, 'evolution' for Spin-
ach evolution function

parameters.assumptions - Hamiltonian generation assump-
tions, use 'deer' to keep two-
electron flip-flop terms and
'deer-zz' to drop them


## Outputs

  Figure 1: pulse diagnostics
Figure 2: DEER echo stack
Figure 3: principal components of the stack, echo
Figure 4: principal components of the stack, DEER


## Examples

A number of complete examples for two- and three-electron systems are given in examples/esr_solids folder. A good way to proceed (soft_4_pulse_deer_2e.m example file) is to look at how the pulses affect the system:

then to inspect the echo stack as a function of the pump pulse position:

and finally to inspect the principal components of the echo stack. The most prominent component is the DEER trace, the other components come from the finite size of the spherical integration grid.

## Notes

1. For the method, start with 'expm', change to 'expv' if the calculation runs out of memory, and use 'evolution' as the last resort.
2. Simulated echoes tend to be sharp and hard to catch because simulation does not have distributions in experimental parameters. Fourier transforming the echo prior to integration is recommended.
3. The time in the DEER trace refers to the second pulse insertion point, after end of first pulse.