Difference between revisions of "Step.m"
(→See also) |
(→Examples) |
||
| Line 25: | Line 25: | ||
==Examples== | ==Examples== | ||
| − | See the source code of [[shaped_pulse_xy.m]] and most NMR pulse sequences ([[cosy.m]], [[hsqc.m]], and others) for examples of this function being used. | + | A 90-degree pulse in X phase on protons: |
| + | |||
| + | Lx=(operator(spin_system,'L+','1H')+... | ||
| + | operator(spin_system,'L-','1H'))/2; | ||
| + | rho=step(spin_system,Lx,rho,pi/2); | ||
| + | |||
| + | A 1 millisecond evolution period under a Hamiltonian H: | ||
| + | |||
| + | rho=step(spin_system,H,rho,1e-3); | ||
| + | |||
| + | A 45-degree pulse with a 60-degree phase on carbon: | ||
| + | |||
| + | Lx=(operator(spin_system,'L+','13C')+... | ||
| + | operator(spin_system,'L-','13C'))/2; | ||
| + | Lx=(operator(spin_system,'L+','13C')+... | ||
| + | operator(spin_system,'L-','13C'))/2; | ||
| + | rho=step(spin_system,cosd(60)*Lx+sind(60)*Ly,rho,pi/4); | ||
| + | |||
| + | See also the source code of [[shaped_pulse_xy.m]] and most NMR pulse sequences ([[cosy.m]], [[hsqc.m]], and others) for examples of this function being used. | ||
==Notes== | ==Notes== | ||
Revision as of 09:54, 7 August 2020
Time propagation function optimised for one-off calls, such as hard pulses or slices of shaped pulses. For trajectory calculation and detection periods of time-domain experiments, use evolution.m instead.
This function calculates the action by a matrix exponential on a vector without computing the matrix exponential. The actual implementation is more sophisticated, but the principle becomes apparent from the following equation:
where \(\bf{L}\) is a Liouvillian and \(\bf{\rho }\) is a state vector. This operation is cheaper than matrix exponentiation, but only when it is performed once. If many time steps are required, it is cheaper to pre-compute the exponential, which is what evolution.m does.
Syntax
rho=step(spin_system,L,rho,time_step)
Arguments
L - Liouvillian or Hamiltonian to be used for propagation
rho - state vector or density matrix to be propagated
time_step - length of the time step to take
Outputs
rho - state vector or density matrix
Examples
A 90-degree pulse in X phase on protons:
Lx=(operator(spin_system,'L+','1H')+...
operator(spin_system,'L-','1H'))/2;
rho=step(spin_system,Lx,rho,pi/2);
A 1 millisecond evolution period under a Hamiltonian H:
rho=step(spin_system,H,rho,1e-3);
A 45-degree pulse with a 60-degree phase on carbon:
Lx=(operator(spin_system,'L+','13C')+...
operator(spin_system,'L-','13C'))/2;
Lx=(operator(spin_system,'L+','13C')+...
operator(spin_system,'L-','13C'))/2;
rho=step(spin_system,cosd(60)*Lx+sind(60)*Ly,rho,pi/4);
See also the source code of shaped_pulse_xy.m and most NMR pulse sequences (cosy.m, hsqc.m, and others) for examples of this function being used.
Notes
- The sequence is programmed with a rather peculiar order of algebraic operations. This was carefully optimised to ensure best possible performance under a variety of scenarios (parallelisation, GPUs, large sparse arrays) in Matlab.
- Only use this function for short one-off events where you do not expect to see the same Liovillian again. Long-term propagation (trajectories, observables) under a static Liovillian should be handled with evolution.m or krylov.m functions instead.
See also
evolution.m, krylov.m, propagator.m, shaped_pulse_xy.m, shaped_pulse_af.m
Version 2.3, authors: Ilya Kuprov, Luke Edwards