Difference between revisions of "Crystal.m"

From Spinach Documentation Wiki
Jump to: navigation, search
(Sync syntax/arguments/outputs with current Spinach source)
(Update function See also links and function index membership)
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{DISPLAYTITLE:crystal.m}} __NOTOC__
 
{{DISPLAYTITLE:crystal.m}} __NOTOC__
 
 
Static single crystal simulation context. This function positions the spin system at a particular angle in the laboratory frame of reference, generates Hamiltonian, relaxation superoperator, kinetics superoperator, applies the necessary offsets and rotating frame transformations, updates the parameter set, and passes all of that to the pulse sequence.
 
Static single crystal simulation context. This function positions the spin system at a particular angle in the laboratory frame of reference, generates Hamiltonian, relaxation superoperator, kinetics superoperator, applies the necessary offsets and rotating frame transformations, updates the parameter set, and passes all of that to the pulse sequence.
  
 
==Syntax==
 
==Syntax==
  
answer=crystal(spin_system,pulse_sequence,parameters,assumptions)
+
    answer=crystal(spin_system,@pulse_sequence,parameters,assumptions)
 +
 
 +
The pulse sequence should have the following input syntax:
 +
 +
    answer=pulse_sequence(spin_system,parameters,H,R,K)
  
==Arguments==
+
==Parameters==
  
pulse_sequence      - pulse sequence function handle
+
  pulse_sequence      - pulse sequence function handle
 
   
 
   
 
   parameters.spins    - a cell array giving the spins that  
 
   parameters.spins    - a cell array giving the spins that  
Line 45: Line 48:
 
                           current orientation, and sent to the pulse  
 
                           current orientation, and sent to the pulse  
 
                           sequence in parameters.rho0 subfield
 
                           sequence in parameters.rho0 subfield
 
+
 
   parameters.*        - additional subfields may be required
 
   parameters.*        - additional subfields may be required
 
                         by your pulse sequence - check its  
 
                         by your pulse sequence - check its  
Line 55: Line 58:
  
 
==Outputs==
 
==Outputs==
 
 
This function returns whatever the pulse sequence returns. The parameters structure is passed to the pulse sequence with the following additional parameters set:
 
This function returns whatever the pulse sequence returns. The parameters structure is passed to the pulse sequence with the following additional parameters set:
  
Line 65: Line 67:
  
 
==Notes==
 
==Notes==
 
 
Arbitrary order rotating frame transformation is supported, including infinite order. See [[rotframe.m]] for further information.
 
Arbitrary order rotating frame transformation is supported, including infinite order. See [[rotframe.m]] for further information.
  
 
==See also==
 
==See also==
 +
[[assume.m]], [[rotframe.m]], [[doublerot.m]], [[floquet.m]], [[gridfree.m]], [[imaging.m]], [[liquid.m]], [[meshflow.m]], [[powder.m]], [[singlerot.m]], [[Kernel contexts]], [[Built-in_experiments]]
  
[[Kernel contexts]]
+
''Version 2.8, authors: [[Ilya Kuprov]]''
 
 
[[Built-in_experiments#Solid_state_NMR_experiments|Solid state NMR experiments]]
 
 
 
[[Built-in_experiments#ESR_experiments|ESR experiments]]
 
 
 
[[Built-in_experiments#DNP_experiments|DNP experiments]]
 
 
 
 
 
''Version 2.8, authors: [[Ilya Kuprov]]
 

Latest revision as of 19:35, 6 June 2026

Static single crystal simulation context. This function positions the spin system at a particular angle in the laboratory frame of reference, generates Hamiltonian, relaxation superoperator, kinetics superoperator, applies the necessary offsets and rotating frame transformations, updates the parameter set, and passes all of that to the pulse sequence.

Syntax

    answer=crystal(spin_system,@pulse_sequence,parameters,assumptions)

The pulse sequence should have the following input syntax:

    answer=pulse_sequence(spin_system,parameters,H,R,K)

Parameters

  pulse_sequence      - pulse sequence function handle

  parameters.spins    - a cell array giving the spins that 
                        the pulse sequence involves, e.g. 
                        {'1H','13C'}

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

  parameters.orientation - a row vector of the three Euler angles
                          (in radians) giving the orientation of
                           the system relative to the input orien-
                           tation.

  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 additional
                        information required by the sequence:

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

                         'aniso_eq' - thermal equilibrium is recomputed 
                         using the full anisotropic Hamiltonian at the
                         current orientation, and sent to the pulse 
                         sequence in parameters.rho0 subfield

  parameters.*        - additional subfields may be required
                        by your pulse sequence - check its 
                        documentation page 

  assumptions         - a character string setting the simulation 
                        assumptions, e.g. 'nmr' - see assume.m
                        for further details.

Outputs

This function returns whatever the pulse sequence returns. The parameters structure is passed to the pulse sequence with the following additional parameters set:

    parameters.spc_dim  - matrix dimension for the spatial
                          dynamics subspace

    parameters.spn_dim  - matrix dimension for the spin 
                          dynamics subspace

Notes

Arbitrary order rotating frame transformation is supported, including infinite order. See rotframe.m for further information.

See also

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

Version 2.8, authors: Ilya Kuprov