Difference between revisions of "Powder.m"

From Spinach Documentation Wiki
Jump to: navigation, search
(Notes)
(Update function See also links and function index membership)
 
(16 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{DISPLAYTITLE:powder.m}}
+
{{DISPLAYTITLE:powder.m}} __NOTOC__
Powder interface to pulse sequences. Generates a Liouvillian superoperator, the initial state and the coil state, then passes them on to the pulse sequence function.
+
Static powder interface to pulse sequences. Generates a Liouvillian superoperator, the initial state and the coil state, then passes them on to the pulse sequence function.
  
 
==Syntax==
 
==Syntax==
  
    answer=powder(spin_system,pulse_sequence,parameters,assumptions)
 
  
==Arguments==
+
    [answer,sph_grid]=powder(spin_system,pulse_sequence,...
   pulse_sequence       - pulse sequence function handle. See the
+
                                parameters,assumptions)
                          experiments directory for the list of
+
 
                          pulse sequences that ship with Spinach.
+
==Parameters==
 
+
 
  parameters.spins    -  a cell array giving the spins that the
+
   pulse_sequence     - pulse sequence function handle. See the
                          pulse sequence works on, in the order
+
                      experiments directory for the list of
                          of channels, e.g. {'1H','13C'}
+
                      pulse sequences that ship with Spinach.
 
   
 
   
   parameters.offset    - a cell array giving transmitter offsets
+
   parameters.spins  - a cell array giving the spins that the
                          in Hz on each of the spins listed in
+
                      pulse sequence works on, in the order
                          parameters.spins
+
                      of channels, e.g. {'1H','13C'}
 
   
 
   
   parameters.grid      - [[Appendix I: powder grids|powder averaging grid]]
+
   parameters.offset  - a cell array giving transmitter offsets
 +
                      in Hz on each of the spins listed in
 +
                      parameters.spins
 
   
 
   
   parameters.rframes  - rotating frame specification, e.g.
+
   parameters.grid    - name of the [[Appendix I: powder grids|spherical averaging grid]]
                        {{'13C',2},{'14N,3}} requests second
+
                      file (see the grids directory in the
                        order rotating frame transformation
+
                      kernel).
                        with respect to carbon-13 and third
 
                        order rotating frame transformation
 
                        with respect to nitrogen-14. When
 
                        this option is used, the assumptions
 
                        on the respective spins should be
 
                        laboratory frame.
 
 
   
 
   
   parameters.needs  - a cell array of strings specifying additional
+
   parameters.rframes - rotating frame specification, e.g.
                       information required by the sequence:
+
                       {{'13C',2},{'14N,3}} requests second
 +
                      order rotating frame transformation
 +
                      with respect to carbon-13 and third
 +
                      order rotating frame transformation
 +
                      with respect to nitrogen-14. When
 +
                      this option is used, the assumptions
 +
                      on the respective spins should be
 +
                      laboratory frame.
 
   
 
   
                      'zeeman_op' - Zeeman part of the Hamiltonian
+
  parameters.needs  - a cell array of strings specifying ad-
                       in the laboratory frame, to be placed into
+
                       ditional information required by the
                       parameters.hseeman and sent to pulse sequence
+
                       sequence:
 
   
 
   
                       'aniso_eq' - thermal equilibrium is recomputed
+
                       'zeeman_op' - Zeeman part of the Hami-
                       using the full anisotropic Hamiltonian at the
+
                       ltonian in the laboratory frame, to be
                       current orientation, and sent to the pulse  
+
                       placed into parameters.hzeeman and sent
                      sequence in parameters.rho0 subfield
+
                      to the pulse sequence
 
   
 
   
  parameters.sum_up  - when set to 1 (default), returns the
+
                      'aniso_eq' - thermal equilibrium is re-
                        powder average. When set to 0, returns
+
                      computed using the full anisotropic Ha-
                        individual answers for each point in
+
                      miltonian at each orientation, and sent
                        the powder as a cell array.
+
                      to pulse sequence via parameters.rho0
 
   
 
   
   parameters.*      - additional subfields may be required by your
+
   parameters.rho0  - initial state; may be a function handle
                        pulse sequence - check its documentation page
+
                      that depends on the three Euler angles
 +
                      in ZYZ active convention
 
   
 
   
    assumptions     - context-specific assumptions ('nmr', 'epr',
+
  parameters.serial - if set to true, disables automatic pa-
 +
                      rallelisation
 +
 +
  parameters.sum_up - if set to false, causes the pulse sequ-
 +
                      ence output at each orientation to be
 +
                      returned instead of the powder average
 +
 +
  parameters.*      - additional subfields may be required by
 +
                      the pulse sequence - check its documen-
 +
                      tation page
 +
 +
  assumptions       - context-specific assumptions ('nmr', 'epr',
 
                       'labframe', etc.) - see the pulse sequence
 
                       'labframe', etc.) - see the pulse sequence
 
                       header for information on this setting.
 
                       header for information on this setting.
  
 
==Outputs==
 
==Outputs==
This function returns a powder average of whatever it is that the pulse sequence returns. If a structure is returned by the pulse sequence, the structures are powder averaged field-by-field.
 
  
==Examples==
+
answer  - powder average of whatever the pulse sequence returns; if
There are over 100 examples using this context in the example set. The following cases are representative:
+
          parameters.sum_up is set to false, a cell array of outputs
 +
          at each orientation is returned
  
'''dnp_solids/crosspol_powder_static_1.m''' - electron-nuclear cross-polarisation DNP
+
sph_grid - powder averaging grid data structure with three Euler angles
 
+
          and weights for each point
'''esr_solids/hyscore_nitroxide_powder.m''' - HYSCORE spectrum of a nitroxide radical
 
 
 
'''giant_spin/triple_dy_eqmag_temp.m''' - temperature dependence of equilibrium magnetisation in a dysprosium cluster
 
 
 
'''nmr_solids/cp_powder_match_3.m''' - Hartmann-Hahn matching condition under MAS
 
  
 
==Notes==
 
==Notes==
Line 75: Line 84:
  
 
==See also==
 
==See also==
[[crystal.m]], [[liquid.m]], [[roadmap.m]], [[singlerot.m]], [[doublerot.m]], [[imaging.m]], [[gridfree.m]], [[floquet.m]]
+
[[singlerot.m]], [[rotframe.m]], [[crystal.m]], [[doublerot.m]], [[floquet.m]], [[gridfree.m]], [[imaging.m]], [[liquid.m]], [[meshflow.m]], [[Kernel contexts]], [[Built-in_experiments]]
 
 
  
''Version 2.2, authors: [[Ilya Kuprov]], [[Luke Edwards]]''
+
''Version 2.8, authors: [[Ilya Kuprov]], [[Luke Edwards]]''

Latest revision as of 19:40, 6 June 2026

Static powder interface to pulse sequences. Generates a Liouvillian superoperator, the initial state and the coil state, then passes them on to the pulse sequence function.

Syntax

    [answer,sph_grid]=powder(spin_system,pulse_sequence,...
                               parameters,assumptions)

Parameters

 pulse_sequence     - pulse sequence function handle. See the
                      experiments directory for the list of
                      pulse sequences that ship with Spinach.

 parameters.spins   - a cell array giving the spins that the
                      pulse sequence works on, in the order
                      of channels, e.g. {'1H','13C'}

 parameters.offset  - a cell array giving transmitter offsets
                      in Hz on each of the spins listed in
                      parameters.spins

 parameters.grid    - name of the spherical averaging grid
                      file (see the grids directory in the
                      kernel).

 parameters.rframes - rotating frame specification, e.g.
                      {{'13C',2},{'14N,3}} requests second
                      order rotating frame transformation
                      with respect to carbon-13 and third
                      order rotating frame transformation
                      with respect to nitrogen-14. When
                      this option is used, the assumptions
                      on the respective spins should be
                      laboratory frame.

 parameters.needs   - a cell array of strings specifying ad-
                      ditional information required by the
                      sequence:

                      'zeeman_op' - Zeeman part of the Hami-
                      ltonian in the laboratory frame, to be
                      placed into parameters.hzeeman and sent
                      to the pulse sequence

                      'aniso_eq' - thermal equilibrium is re-
                      computed using the full anisotropic Ha-
                      miltonian at each orientation, and sent
                      to pulse sequence via parameters.rho0

  parameters.rho0   - initial state; may be a function handle
                      that depends on the three Euler angles
                      in ZYZ active convention

  parameters.serial - if set to true, disables automatic pa-
                      rallelisation

  parameters.sum_up - if set to false, causes the pulse sequ-
                      ence output at each orientation to be
                      returned instead of the powder average

  parameters.*      - additional subfields may be required by
                      the pulse sequence - check its documen-
                      tation page 

  assumptions       - context-specific assumptions ('nmr', 'epr',
                      'labframe', etc.) - see the pulse sequence
                      header for information on this setting.

Outputs

answer - powder average of whatever the pulse sequence returns; if

          parameters.sum_up is set to false, a cell array of outputs
          at each orientation is returned

sph_grid - powder averaging grid data structure with three Euler angles

          and weights for each point

Notes

  1. THIS IS FOR STATIC POWDERS - use singlerot.m for MAS simulations.
  2. Arbitrary order rotating frame transformation is supported, including infinite order. See the header of rotframe.m for further information.
  3. The function supports parallel processing via Matlab's Distributed Computing Toolbox - different system orientations are evaluated on different labs.

See also

singlerot.m, rotframe.m, crystal.m, doublerot.m, floquet.m, gridfree.m, imaging.m, liquid.m, meshflow.m, Kernel contexts, Built-in_experiments

Version 2.8, authors: Ilya Kuprov, Luke Edwards