Difference between revisions of "Shaped pulse xy.m"

From Spinach Documentation Wiki
Jump to: navigation, search
(Notes)
(Update function See also links and function index membership)
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{DISPLAYTITLE:shaped_pulse_xy.m}}
+
{{DISPLAYTITLE:shaped_pulse_xy.m}} __NOTOC__
 
Shaped pulse function using Cartesian coordinates. Applies a user-specified pulse shape on user-specified operators while the rest of the drift Liouvillian continues to affect the spin system. The pulse is assumed to be piecewise-constant and should be supplied with sufficiently fine time discretization to properly reproduce the waveform.
 
Shaped pulse function using Cartesian coordinates. Applies a user-specified pulse shape on user-specified operators while the rest of the drift Liouvillian continues to affect the spin system. The pulse is assumed to be piecewise-constant and should be supplied with sufficiently fine time discretization to properly reproduce the waveform.
  
Line 5: Line 5:
  
 
     [rho,traj,P]=shaped_pulse_xy(spin_system,drift,controls,...
 
     [rho,traj,P]=shaped_pulse_xy(spin_system,drift,controls,...
                                  amplitudes,slice_durs,rho,method)
+
                                      amplitudes,slice_durs,rho,method)
  
==Arguments==
+
==Parameters==
  
 
       drift - the drift Liouvillian, the part of the Liouvillian that
 
       drift - the drift Liouvillian, the part of the Liouvillian that
 
               should continue running in the background. This should  
 
               should continue running in the background. This should  
               include the pulse transmitter offset, if any.  
+
               include the transmitter offset term, if any.  
 
   
 
   
 
     controls - a cell array of control operators corresponding to each
 
     controls - a cell array of control operators corresponding to each
Line 17: Line 17:
 
               of freedom, such as gradients and diffusion.
 
               of freedom, such as gradients and diffusion.
 
   
 
   
   amplitudes - a cell array of control amplitude vectors in angular
+
   amplitudes - a cell array of control amplitude vectors in rad/s, one
               frequency units.
+
               vector per control channel; the elements of each vector
 +
              correspond to different time points.
 
   
 
   
 
   slice_durs - a vector containing the duration of each pulse slice,
 
   slice_durs - a vector containing the duration of each pulse slice,
               seconds.
+
               seconds. For piecewise-constant methods, the number of
 +
              durations should be equal to the nuber of amplitudes.
 +
              For piecewise-linear methods, there should be one ele-
 +
              ment more in the amplitude array.
 
   
 
   
         rho - state vector of the initial state, or a stack thereof.
+
         rho - initial state vector or a bookshelf matrix thereof
 
   
 
   
       method - propagation method, 'expv' for Krylov propagation,
+
       method - propagation method and product quadrature:
              'expm' for exponential propagation, 'evolution' for
+
              Spinach evolution function
+
                Krylov algorithm (recommended):
 +
 +
                    'expv-pwc' - piecewise-constant
 +
                    'expv-pwl' - 2nd order Lie quadrature
 +
 +
                Explicit matrix exponentiation:
 +
 +
                    'expm-pwc' - piecewise-constant
 +
                    'expm-pwl' - 2nd order Lie quadrature
 +
 +
                Spinach evolution function call:
 +
 +
                    'evol-pwc' - piecewise-constant
 +
                    'evol-pwl' - 2nd order Lie quadrature
  
 
==Outputs==
 
==Outputs==
  
 
         rho - state vector for the final state, or a stack thereof
 
         rho - state vector for the final state, or a stack thereof
 
+
 
         traj - system trajectory as a [1 x (nsteps+1)] cell array,  
 
         traj - system trajectory as a [1 x (nsteps+1)] cell array,  
 
               the first point is the initial condition
 
               the first point is the initial condition
 
+
           P - effective pulse propagator (expensive)
+
           P - effective pulse propagator (expensive, best avoided)
  
 
==Examples==
 
==Examples==
Line 45: Line 62:
 
==Notes==
 
==Notes==
 
# Of the three propagation methods, 'expv' is recommended because it runs Krylov propagation that avoids explicit matrix exponentiation. The 'expm' option forces Matlab's very inefficient matrix exponentiation path and should only be used for debugging pourposes. In very anomalous cases (long pulses, large state vector stacks, very large state spaces), the 'evolution' option might become necessary.
 
# Of the three propagation methods, 'expv' is recommended because it runs Krylov propagation that avoids explicit matrix exponentiation. The 'expm' option forces Matlab's very inefficient matrix exponentiation path and should only be used for debugging pourposes. In very anomalous cases (long pulses, large state vector stacks, very large state spaces), the 'evolution' option might become necessary.
# Any number of operators of any nature are supported as control channels - for example, shaped gradients may be simulated if one of the control operators is a gradient operator.
 
  
 
==See also==
 
==See also==
[[shaped_pulse_af.m]], [[read_wave.m]], [[vg_pulse.m]], [[pulse_shape.m]], [[chirp_pulse_af.m]], [[chirp_pulse_xy.m]]
+
[[shaped_pulse_af.m]], [[read_wave.m]], [[vg_pulse.m]], [[pulse_shape.m]], [[chirp_pulse.m]], [[bruker_write.m]], [[cartesian2polar.m]], [[grad_pulse.m]], [[grad_sandw.m]], [[pmlg5.m]], [[polar2cartesian.m]], [[restrans.m]], [[rseq_compiler.m]], [[rsequence.m]], [[sawtooth.m]], [[sech_pulse.m]], [[spinal.m]], [[triwave.m]], [[wave_basis.m]], [[Kernel_functions]]
 
 
  
''Version 2.4, authors: [[Ilya Kuprov]]''
+
''Version 2.9, authors: [[Ilya Kuprov]], [[Anupama Acharya]]''

Latest revision as of 19:41, 6 June 2026

Shaped pulse function using Cartesian coordinates. Applies a user-specified pulse shape on user-specified operators while the rest of the drift Liouvillian continues to affect the spin system. The pulse is assumed to be piecewise-constant and should be supplied with sufficiently fine time discretization to properly reproduce the waveform.

Syntax

    [rho,traj,P]=shaped_pulse_xy(spin_system,drift,controls,...
                                     amplitudes,slice_durs,rho,method)

Parameters

      drift - the drift Liouvillian, the part of the Liouvillian that
              should continue running in the background. This should 
              include the transmitter offset term, if any. 

   controls - a cell array of control operators corresponding to each
              channel, this may include operators for spatial degrees
              of freedom, such as gradients and diffusion.

 amplitudes - a cell array of control amplitude vectors in rad/s, one
              vector per control channel; the elements of each vector
              correspond to different time points.

 slice_durs - a vector containing the duration of each pulse slice,
              seconds. For piecewise-constant methods, the number of
              durations should be equal to the nuber of amplitudes.
              For piecewise-linear methods, there should be one ele-
              ment more in the amplitude array.

        rho - initial state vector or a bookshelf matrix thereof

     method - propagation method and product quadrature: 

                Krylov algorithm (recommended):

                   'expv-pwc' - piecewise-constant
                   'expv-pwl' - 2nd order Lie quadrature

                Explicit matrix exponentiation:

                   'expm-pwc' - piecewise-constant
                   'expm-pwl' - 2nd order Lie quadrature

                Spinach evolution function call:

                   'evol-pwc' - piecewise-constant
                   'evol-pwl' - 2nd order Lie quadrature

Outputs

        rho - state vector for the final state, or a stack thereof

       traj - system trajectory as a [1 x (nsteps+1)] cell array, 
              the first point is the initial condition

          P - effective pulse propagator (expensive, best avoided)

Examples

An example of a Veshtort-Griffin shaped excitation pulse applied to a system with 31 J-coupled protons (examples/nmr_liquids/shaped_pulse_3.m):

Vg pulse.png

Notes

  1. Of the three propagation methods, 'expv' is recommended because it runs Krylov propagation that avoids explicit matrix exponentiation. The 'expm' option forces Matlab's very inefficient matrix exponentiation path and should only be used for debugging pourposes. In very anomalous cases (long pulses, large state vector stacks, very large state spaces), the 'evolution' option might become necessary.

See also

shaped_pulse_af.m, read_wave.m, vg_pulse.m, pulse_shape.m, chirp_pulse.m, bruker_write.m, cartesian2polar.m, grad_pulse.m, grad_sandw.m, pmlg5.m, polar2cartesian.m, restrans.m, rseq_compiler.m, rsequence.m, sawtooth.m, sech_pulse.m, spinal.m, triwave.m, wave_basis.m, Kernel_functions

Version 2.9, authors: Ilya Kuprov, Anupama Acharya