Kernel contexts

From Spinach Documentation Wiki
Revision as of 14:19, 31 August 2015 by Kuprov (talk | contribs) (Created page with "A context is an intermediate layer between the kernel (which runs the mathematics) and the experiment (which is programmed as it would be on a spectrometer). Context functions...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

A context is an intermediate layer between the kernel (which runs the mathematics) and the experiment (which is programmed as it would be on a spectrometer). Context functions are responsible for setting up rotating frame transformations, transmitter offsets, powder averages, magic angle spinning and other such matters. The following contexts are available:

  1. crystal.m - single static orientation simulations.
  2. doublerot.m - double rotation simulations using Fokker-Planck formalism for the rotation part and a spherical grid for the powder average operation.
  3. floquet.m - single rotation simulations using Floquet formalism for the rotation part and a spherical grid for the powder average operation.
  4. gridfree.m - single rotation simulations using Fokker-Planck formalism for both the rotation part and the powder average operation. This module also supports stochastic Liouville equation formalism for spin relaxation theory.
  5. imaging.m - experimental module that provides infrastructure operators for MRI and other spatially distributed spin dynamics simulations.
  6. liquid.m - liquid state simulations.
  7. powder.m - static powder simulations using a spherical grid for the powder average operation.
  8. roadmap.m - static powder simulations using a spherical grid. Simulation results are returned as an array with an answer reported at each orientation found in the spherical grid.
  9. singlerot.m - single rotation simulations using Fokker-Planck formalism for the rotation part and a spherical grid for the powder average operation.

All context functions have the same call syntax, e.g.:

    answer=doublerot(spin_system,pulse_sequence,parameters,assumptions)

and call experiment functions using the same syntax:

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

Their parameter lists are also broadly similar. This allows rapid switching of the simulation context by simply calling the same experiment from a different context.