Difference between revisions of "Basis set specification"

From Spinach Documentation Wiki
Jump to: navigation, search
(→‎What does basis set mean in spin dynamics?)
(wrap the per-substance cell array examples in nowiki so that the braces are not parsed as templates)
 
(77 intermediate revisions by 2 users not shown)
Line 7: Line 7:
 
==What does ''basis set'' mean in spin dynamics?==
 
==What does ''basis set'' mean in spin dynamics?==
 
Every quantum state of the spin system may be described by a density matrix, and the density matrix may be written as a linear combination of some basis matrices. In the simple case of one spin:
 
Every quantum state of the spin system may be described by a density matrix, and the density matrix may be written as a linear combination of some basis matrices. In the simple case of one spin:
−
 
  
 
<center><math>\hat{\rho }=a{{\hat{\sigma }}_{\text{X}}}+b{{\hat{\sigma }}_{\text{Y}}}+c{{\hat{\sigma }}_{\text{Z}}}</math></center>  
 
<center><math>\hat{\rho }=a{{\hat{\sigma }}_{\text{X}}}+b{{\hat{\sigma }}_{\text{Y}}}+c{{\hat{\sigma }}_{\text{Z}}}</math></center>  
−
 
  
 
where <math>\left\{ {{{\hat{\sigma }}}_{\text{X}}},{{{\hat{\sigma }}}_{\text{Y}}},{{{\hat{\sigma }}}_{\text{Z}}} \right\}</math> are Pauli matrices and <math>\left\{ a,b,c \right\}</math> are complex numbers. In this case, the Pauli matrices are the ''basis set'' and the complex numbers are the ''expansion coefficients''. Systems with multiple spins have many more operators in the basis set: not only single-spin operators, but also multi-spin operators (for example <math>\hat{\sigma }_{\text{Z}}^{\left( 1 \right)}\otimes \hat{\sigma }_{\text{Z}}^{\left( 2 \right)}</math>) which describe correlated simultaneous dynamics of multiple spins.
 
where <math>\left\{ {{{\hat{\sigma }}}_{\text{X}}},{{{\hat{\sigma }}}_{\text{Y}}},{{{\hat{\sigma }}}_{\text{Z}}} \right\}</math> are Pauli matrices and <math>\left\{ a,b,c \right\}</math> are complex numbers. In this case, the Pauli matrices are the ''basis set'' and the complex numbers are the ''expansion coefficients''. Systems with multiple spins have many more operators in the basis set: not only single-spin operators, but also multi-spin operators (for example <math>\hat{\sigma }_{\text{Z}}^{\left( 1 \right)}\otimes \hat{\sigma }_{\text{Z}}^{\left( 2 \right)}</math>) which describe correlated simultaneous dynamics of multiple spins.
Line 17: Line 15:
  
 
[[File:large_spin_system.png|center|frame|'''Figure 1.''' Stereo plot of the anti-difluoroheptane spin system with significant ''J''-couplings shown by dashed lines. In regular liquid state NMR simulations it may safely be assumed that the spins belonging to different methyl groups on the opposite sides of the molecule never become correlated.]]
 
[[File:large_spin_system.png|center|frame|'''Figure 1.''' Stereo plot of the anti-difluoroheptane spin system with significant ''J''-couplings shown by dashed lines. In regular liquid state NMR simulations it may safely be assumed that the spins belonging to different methyl groups on the opposite sides of the molecule never become correlated.]]
 +
 +
The corresponding operators may be dropped from the basis set. This reduces the number of coefficients in the density matrix expansion, and therefore the matrix dimension required for simulation. It is easy to demonstrate that, in very large molecules, the number of different correlated states that never get populated is very large. Dropping these states from the basis set accelerates simulations by many orders of magnitude. Some specific states may also be inaccessible due to the presence of symmetries, conservation laws, spin relaxation, and many other factors. ''Spinach'' can take all of these factors into account (and run simulations at a massively reduced computational cost), but it needs you to provide the information that would enable it to make the decisions about which states should and should not be considered relevant.
 +
 +
[[File:State_space_populations.png|center|frame|'''Figure 2.''' Numerical simulation of the density matrix norm dynamics during the evolution and detection period of a pulse-acquire NMR experiment on the 22-spin system of strychnine. All distances and magnetic parameters imported from a GIAO DFT B3LYP/EPR-II calculation. Bloch-Redfield-Wangsness relaxation superoperator (including DD, CSA and cross-correlation terms) was used with isotropic rotational diffusion correlation time of 200 ps.]]
 +
 +
Figure 2 gives the general idea about the correlation orders expected in typical liquid state NMR simulations - it is clear that correlations involving large numbers of spins are not populated and may therefore be dropped from the basis set. The theory of incomplete basis set simulations in magnetic resonance is currently under active development. The following equation provides an estimate of the minimal basis set requirements:
 +
 +
<center><math>k > 2\sqrt {\frac{h}{r}} {\rm{erf}}{{\rm{c}}^{ - 1}}\left( {\xi {\rm{erfc}}\left( {\frac{1}{2}\sqrt {\frac{r}{h}} } \right)} \right)</math></center>
 +
 +
where <math>k</math> gives the maximum spin correlation order to be included in the basis, <math>\xi</math> is the target accuracy, <math>r</math> is the average relaxation rate in the system and <math>h</math> is the average spin-spin coupling (single-spin interactions, such as Zeeman, NQI and ZFS, do not count).
  
 
==Formalism selection==
 
==Formalism selection==
−
The first choice the user is required to make is the simulation formalism, using bas.formalism parameter. The following formalisms are supported:
+
The first decision you are required to make concerns the simulation formalism, using [[bas]].formalism parameter, for example:
 +
 
 +
    [[bas]].formalism='sphten-liouv';
 +
 
 +
Unless you have good reasons not to, choose 'sphten-liouv' here. The following formalisms are supported by the kernel:
  
 
{| class="wikitable"
 
{| class="wikitable"
 +
!Formalism keyword
 +
!Formalism description
 +
|-
 
|'sphten-liouv'
 
|'sphten-liouv'
−
|Irreducible spherical tensor basis, matrix representation, Liouville space. A lot of Spinach functionality either requires this formalism or operates most efficiently within it. This should be the default choice unless you have good reasons to pick something else.
+
|
 +
Liouville space formalism; the fundamental operators from which the basis set is built are single-spin irreducible spherical tensors. These operators are ordered with respect to many common transformations and conservation laws encountered in magnetic resonance. Many useful operations may therefore be performed semi-analytically. A lot of ''Spinach'' functionality either requires this formalism or operates most efficiently within it. This should be the default choice unless you have good reasons to pick something else.
 
|-
 
|-
 
|'zeeman-liouv'
 
|'zeeman-liouv'
−
|Zeeman basis, matrix representation, Liouville space. Identical in most respects to sphten-liouv, with the exception of state space restriction and analytical coherence selection functionality, which is not available.
+
|Liouville space formalism; the fundamental operators from which the basis set is built are single transition operators between the projection states on the Z axis. The state vector coefficients in this formalism are easy to interpret because they correspond to populations of standard textbook spin states. This formalism is essentially a vectorisation of 'zeeman-hilb'; it permits only limited state space reduction; most calculations would have exponential complexity scaling if this option is chosen.
 
|-
 
|-
 
|'zeeman-hilb'
 
|'zeeman-hilb'
−
|Zeeman basis, matrix representation, Hilbert space. Only the core functionality (operators, states, propagators, evolution) is available. This option is mostly useful for backwards compatibility checks be-cause it reproduces identically the formalism found in most begin-ner-level NMR and EPR textbooks.
+
|Hilbert space formalism; the fundamental states from which the basis set is built are the projection states on the Z axis. This is the standard density operator formalism described in most magnetic resonance textbooks. Only the core functionality (operators, states, propagators, evolution) is available. This option is mostly useful for backwards compatibility checks; it cannot support complicated relaxation theories or chemical kinetics. All calculations within this formalism would have exponential complexity scaling.
 
|}
 
|}
  
−
In almost all cases the working formalism should be sphten-liouv because state space restriction method (and therefore polynomial complexity scaling algorithms) is available for it.
+
System-level state space reduction, and therefore polynomial complexity scaling, is only available within 'sphten-liouv' formalism. If your system has more than 20 spins, 'sphten-liouv' is your only realistic choice. For small but strongly coupled spin systems without significant relaxation effects, choose 'zeeman-hilb'.
  
 
==Approximation selection==
 
==Approximation selection==
 +
To run an ''exact'' calculation in any formalism, set:
  
−
Incomplete basis sets are supported by sphten-liouv formalism only. This section provides some practical advice on the choice of basis sets for restricted state space calcula-tions. Using incomplete basis sets requires detailed understanding of the spin dynamics in the system – unless you know precisely what you are doing, it is a good idea to set
+
     [[bas]].approximation='none';
−
 
 
−
     bas.approximation='none';
 
  
−
this option corresponds to running a formally exact simulation. Spinach would still run much faster than any other time-domain Liouville space code. Exact simulations are, however, impossible with more than about 20 spins and the following table lists incomplete basis set parameters in Spinach:
+
This option requests a complete basis set, which is only practical up to about twelve spins in Hilbert space and six spins in Liouville space. Systems containing bosonic modes are subject to the same considerations, with the Fock space truncation of each mode adding its own dimension: the IK-SBS basis set below builds its coupling graphs from the mode couplings declared in [[Spin system specification#Bosonic modes|inter.modes]] and from the spin-spin coupling tensors, so that spin-mode correlations survive the approximation; IK-1 and IK-2 are for spin-only systems and refuse bosonic modes. ''Approximate'' calculations are those that use an incomplete basis set. The user is expected to provide the information that ''Spinach'' would use to build the basis set. The following frequently encountered choices are provided with the kernel:
  
 
{| class="wikitable"
 
{| class="wikitable"
−
!Parameter
+
!Approximation
−
!Values
+
!Approximation description
−
!Comments
+
!Parameters
 
|-
 
|-
−
|bas.approximation
+
|[[bas]].approximation='IK-0'
−
|'none', 'IK-0', 'IK-1', 'IK-2', 'ESR-1', 'ESR-2'
+
|Includes all product states between up to (and including) [[bas]].inter_level spins located anywhere within the system. The asymptotic scaling of this basis set is polynomial.
−
|'none' generates the complete basis set. Note that the scaling of this basis set is exponential.
+
|[[bas]].inter_level
−
'IK-0' includes all product states up to order bas.level between all spins. The asymptotic scaling of this basis set is polynomial.
 
−
'IK-1' includes all product states up to order bas.level between directly coupled spins and up to order bas.space_level between spins that are closer than sys.tols.prox_cutoff. The asymptotic scaling of this basis set is polynomial.
 
−
'IK-2' includes, for every spin, the spin orders involving all directly coupled spins and up to order bas.space_level between spins that are closer than tols.prox_cutoff. The asymptotic scaling of this basis set is polynomial.
 
−
'ESR-1' generates the complete state space for all electrons and includes the identity and longitudinal states for each nucleus. This is often a good choice for simple high-field ESR experiments. Note that the asymptotic scaling of this basis set is exponential.
 
−
'ESR-2' generates the complete state space for all electrons and all anisotropically coupled nuclei, but only includes the identity and longitudinal states for isotropically coupled nuclei. This is often a good choice for complicated high-field ESR experiments. Note that the asymptotic scaling of this basis set is exponential.
 
 
|-
 
|-
−
|bas.level
+
|[[bas]].approximation='IK-1'
−
|positive integer
+
|Includes all product states between up to (and including) [[bas]].inter_level directly coupled spins, and up to order [[bas]].prox_level between spins that are closer than [[Appendix_A:_internal_tolerances|tols]].prox_cutoff (default is 100 Angstrom). The asymptotic scaling of this basis set is polynomial.
−
|Defines maximum subgraph size for the partitioning of the coupling network. Relevant for IK-0 and IK-1 basis sets.
+
|[[bas]].inter_level, [[bas]].prox_level, [[Appendix_A:_internal_tolerances|tols]].prox_cutoff
 
|-
 
|-
−
|bas.space_level
+
|[[bas]].approximation='IK-2'
−
|positive integer
+
|Includes, for every spin, all correlations with all directly coupled spins, and correlations with up to (and including) [[bas]].prox_level with spins that are closer than [[Appendix_A:_internal_tolerances|tols]].prox_cutoff (default is 100 Angstrom). The asymptotic scaling of this basis set is polynomial.
−
|Defines maximum subgraph size for the partitioning of the spatial proximity network. Relevant for IK-1 and IK-2 basis sets.
+
|[[bas]].prox_level, [[Appendix_A:_internal_tolerances|tols]].prox_cutoff
 
|-
 
|-
−
|bas.manual
+
|[[bas]].approximation='IK-DNP'
−
|(m x nspins) logical matrix
+
|Basis set for systems containing both electrons and nuclei. Three coupling graphs are built from the coupling tensors with 2-norm above [[Appendix_A:_internal_tolerances|tols]].inter_cutoff: inter-electron, electron-nuclear, and inter-nuclear. Each graph is traced to its own correlation level given in the three-element vector [[bas]].inter_level=[ee en nn]; inside the resulting subgraphs, pure inter-nuclear correlations above the third level are dropped.
−
|A list of m spin sets (defined by the user as logical row vectors with 1 in the position of the included spins and zeroes elsewhere) to be added to the list of subgraphs of the coupling graph. This trig-gers the inclusion of the complete state space of the chosen spin subsystems into the basis.
+
|[[bas]].inter_level (three elements), [[Appendix_A:_internal_tolerances|tols]].inter_cutoff
 
|-
 
|-
−
|bas.connectivity
+
|[[bas]].approximation='IK-SBS'
−
|'scalar_couplings', 'full_tensors'
+
|Basis set for spin-boson systems, which must contain both spins and bosonic modes. The spin-spin coupling graph is built from the coupling tensors under [[bas]].connectivity, and the bosonic mode couplings declared in [[Spin system specification#Bosonic modes|inter.modes]] with 2-norm above [[Appendix_A:_internal_tolerances|tols]].inter_cutoff are added: pairwise exchange, dispersive, Kerr, and longitudinal channels link the two modes, coupling_mod and zeeman_mod entries link the modes to the spin pairs and spins they modulate. The graph is split into boson-boson, spin-boson, and spin-spin graphs, each traced to its own correlation level given in the three-element vector [[bas]].inter_level=[bb sb ss]; inside the resulting subgraphs, pure boson-boson correlations above the first level and pure spin-spin correlations above the third level are dropped.
−
|This has an influence on how the reduced basis set is built: 'scalar_couplings' builds the reduced basis using the isotropic interaction and distance information, 'full_tensors' use full interaction and distance information. Because the dipolar coupling network in most systems is very dense and scalar coupling network very sparse, the scalar connectivity basis sets generated by Spinach are smaller than the full tensor connectivity basis sets.
+
|[[bas]].inter_level (three elements), [[bas]].connectivity, [[Appendix_A:_internal_tolerances|tols]].inter_cutoff
 
|}
 
|}
  
−
Most spin dynamics simulation trajectories never populate the entire state space of the spin system, and it is therefore possible to run exact simulations at a much reduced computational cost in a suitably restricted basis (see our recent publications in the docs\published_papers directory for further details). Spinach would run simulations in any basis you set, the key question is about the size (=quality) of it. Just like it happens in Quantum Chemistry, the responsibility for choosing the basis rests with the user: for example, a two-spin order basis set is unlikely to be accurate, and including ten-spin orders for a liquid state NMR system is likely to be a computationally expensive overkill.
+
Note that, in most liquid state NMR calculations, the proximity cut-off of 100 Angstroms is an overkill, and a 5 Angstrom cut-off is usually adequate. The default is so large to accommodate more exotic situations, such as those in DNP and MAS NMR simulations.
 +
 
 +
In all reduced basis sets, the subgraphs are generated separately for each chemical substance, using the connectivity and proximity information of that substance only, and the correlation levels are clipped to the number of spins in the substance; the state lists are then merged into one global basis with a single unit state. The field names [[bas]].level and [[bas]].space_level of earlier versions are retired: [[basis.m]] stops with an error that names the replacement.
 +
 
 +
An important parameter that controls the basis state selection process defines what is considered to be an interaction. In liquid state NMR, the most appropriate interaction network is defined by ''J''-couplings because dipolar couplings and other anisotropic interactions are averaged out. In that case, setting
 +
 
 +
    [[bas]].connectivity='scalar_couplings';
  
−
The picture below gives the general idea about the correlation orders expected in typical simulations. Liquid state NMR systems are usually well reproduced in IK-2 basis set, solid state simulations of crystals require complete basis sets, but powder patterns (both stationary and spinning) are usually well reproduced with IK-0 basis at level 3 or higher. For ESR systems, ESR-1 or (if relaxation theory treatment is required) ESR-2 are generally accurate, but a complete basis sets may occasionally be necessary.
+
instructs ''Spinach'' to use the isotropic parts of the coupling tensors to build the spin interaction graph. However, in solid state NMR, DNP and many ESR systems a coupling is essentially anisotropic and the interaction network must also count traceless interactions because they manifest directly. In that case, setting
  
−
The theory of incomplete basis set simulations in magnetic resonance is currently under active development. If in doubt, use the complete basis set – up to about 10 spins (Liouville space) or 20 spins (Hilbert space), Spinach would be able to handle it. With bigger spin systems the only practical choice is to restrict the basis.
+
    [[bas]].connectivity='full_tensors';
  
−
[[File:State_space_populations.png|right|frame|Numerical simulation of the density matrix norm dynamics during the evolution and detection period of a pulse-acquire NMR experiment on the 22-spin system of strychnine. All distances and magnetic parameters imported from a GIAO DFT B3LYP/EPR-II calculation. Bloch-Redfield-Wangsness relaxation superoperator (including DD, CSA and cross-correlation terms) was used with isotropic rotational diffusion correlation time of 200 ps.]]
+
instructs ''Spinach'' to use full interaction tensors to build the spin interaction graph.
  
−
In the example above, state space restriction to five-spin orders would produce accurate results, and a basis set such as IK-1(5,3) – state space restriction to five-spin orders between directly coupled spins and to three-spin orders for all spins within 4 Angstroms (default distance tolerance) of each other – would be an appropriate choice. Systems where spin-spin couplings are stronger and more numerous would require a larger basis set: in ESR and solid state NMR systems it is not uncommon to see 8-spin and higher orders populated. The following equation provides an estimate of the minimal basis set requirements:
+
==Advanced state space tailoring==
 +
The built-in approximations described in the table above are usually sufficient in practice. However, particularly tough cases may require you to exercise finer control over which states are included and which are not. To that end, ''Spinach'' provides an option to force the inclusion of user-specified correlations. A typical specification for a 16-spin system (protons and fluorine, numbered sequentially along the chain) of difluoroheptane shown in Figure 1 would look like the following:
  
−
<center><math>k > 2\sqrt {\frac{h}{r}} {\rm{erf}}{{\rm{c}}^{ - 1}}\left( {\xi {\rm{erfc}}\left( {\frac{1}{2}\sqrt {\frac{r}{h}} } \right)} \right)</math></center>
+
    [[bas]].formalism='sphten-liouv';
 +
    [[bas]].approximation='IK-0';
 +
    [[bas]].inter_level=1;
 +
    [[bas]].manual=[1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0; ...
 +
                0 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0; ...
 +
                0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1];
 +
 
 +
This specification requests the simplest possible basis set (IK-0, level 1) that simply contains the states of individual spins, but no correlations. However, the [[bas]].manual specification then instructs ''Spinach'' to add the complete basis set of the subsystem with spins 1 to 10, the complete basis set of the subsystem with spins 4 to 13, and the complete basis set of the subsystem with spins 7 to 16, and to eliminate repetitions within the resulting list of operators (note that the subsystems overlap). The complete Liouville space basis set for a 16-spin system would be 4,294,967,296-dimensional, which is far too big. However, the basis set described above is only 1,564,672-dimensional, which is manageable, but still contains all the spin orders that are realistically populated during the system dynamics - a plot similar to Figure 2 reveals that only correlations between up to eight spins are populated significantly in this system in liquid state. Each row of [[bas]].manual must lie within one chemical substance; a row that crosses substance boundaries is an error.
  
−
where <math>k</math> gives the maximum spin correlation order to be included in the basis, <math>\xi</math> is the target accuracy, <math>r</math> is the average relaxation rate in the system and <math>h</math> is the average spin-spin coupling (single-spin inter-actions, such as Zeeman, NQI and ZFS, do not count). Running analytics.m function to produce the plot of the kind shown in the figure above is always a good idea – research literature comparing the performance of different basis sets in different settings has yet to emerge.
+
The recipe for the manual state space tailoring therefore is to identify overlapping clusters of strongly correlated spins, so that every relevant state occurs in at least one of those clusters, and to give the information about the clusters to ''Spinach'', which will take care of the basis set construction. Running [[trajan.m]] function to produce the plot of the kind shown in Figure 2 and confirm that the basis set is sufficiently large is always a good idea – research literature comparing the performance of different basis sets in different settings has yet to emerge.
  
−
==Symmetry factorization==
+
==Symmetry factorisation==
−
A simulation that starts in a particular symmetry state and evolves under the Hamiltonian that con-serves that symmetry would never populate states of different symmetries. This is recognized by the Spinach kernel, which supports spin permutation symmetries. The following groups are supported ('A' index indicates the largest Abelian subgroup of the corresponding permutation group):
+
A simulation that starts in a state of particular symmetry and evolves under the Hamiltonian that conserves that symmetry would never populate states of different symmetries. This is recognised by ''Spinach'' kernel, which supports spin ''permutation'' symmetries (not geometric point groups!). The following permutation groups are supported ('A' index indicates the largest Abelian subgroup):
  
 
     S2, S3, S4, S4A, S5, S6
 
     S2, S3, S4, S4A, S5, S6
  
−
along with their direct products. All spin quantum numbers are supported. The following example declares three groups of equivalent spins, each related by S3 permutation group, the first one incorporating spins 14, 15, 16, the second one spins 17, 18, 19 and the third one spins 20, 21, 22.
+
along with their direct products (which are generated internally in an automatic way). All spin quantum numbers are supported. The following example declares three groups of equivalent spins, each related by S3 permutation group, the first one incorporating spins 14, 15, 16, the second one spins 17, 18, 19 and the third one spins 20, 21, 22.
 +
 
 +
    [[bas]].sym_group={'S3','S3','S3'};
 +
    [[bas]].sym_spins={[14 15 16],[17 18 19],[20 21 22]};
 +
 
 +
Although all irreducible representations are commonly populated in Hilbert space simulations, in Liouville space only the fully symmetric irreducible representation is normally active. Accordingly, ''Spinach'' defaults to projecting the system into the fully symmetric irrep. Processing of other irreps may be forced by setting
 +
 
 +
    [[bas]].sym_a1g_only=0;
 +
 
 +
It is important to stress that the symmetry factorization described above is using ''permutation'' groups – all interaction tensors of symmetry-related spins must be identical in orientation, in magnitude, and in the identity of external coupled partner spins.
 +
 
 +
==Coherence order screening==
 +
Coherence order is often conserved (exactly or approximately) during spin system evolution. ''Spinach'' offers three options to restrict the basis set by coherence order. When two or three options are specified simultaneously, the resulting basis would only contain states that comply with all of the specified criteria at the same time. In all three cases, the filters are applied to each chemical substance individually; at the basis construction stage, the substances do not see each other. Each of the three fields is therefore a cell array with one element per chemical substance, in the order of the substances in inter.chem.parts (a single-substance system has one element); an empty element leaves that substance unfiltered, and a filter that refers to spins outside its substance is an error.
  
−
    bas.sym_group={'S3','S3','S3'};
+
The following statement:
−
    bas.sym_spins={[14 15 16],[17 18 19],[20 21 22]};
 
  
−
Although all irreducible representations are commonly populated in Hilbert space simulations, in Liouville space only the fully symmetric irreducible representation is normally active. Accordingly, Spinach defaults to projecting the system into the fully symmetric irrep. Processing of other irreps may be forced by setting bas.sym_a1g_only=0.
+
    [[bas]].projections={[-1 0 1]};
  
−
It is important to note that the symmetry factorization described above is operating in spin space – all interaction tensors of symmetry-related spins must be identical in orientation as well as magnitude.
+
causes only coherences of global order –1, 0 and 1 to be kept in the basis of the substance; for several substances, give one row vector per substance, e.g. {[-1 0 1],[]} to filter the first substance only. Coherence order is defined as the sum of the projection quantum numbers of all single-spin irreducible spherical tensor operators entering the direct product state.
  
−
==Correlation and coherence order screening==
+
The coherence order filter above refers to the whole system. In common high-field NMR experiments, only longitudinal states are sometimes populated on specific spins (such as 15N in a 1H pulse-acquire NMR experiment). The following statement:
−
It is often the case that the coherence order is conserved (exactly or approximately) during the system evolution process. Spinach offers two options to screen the basis sets according to coherence order and only keep the user-specified coherences. The following statement:
 
  
−
     bas.projections=[-1 0 1];
+
     [[bas]].longitudinal=<nowiki>{{'15N','13C',2,17}}</nowiki>;
  
−
causes coherences of order –1, 0 and 1 to be kept in the basis. Coherence order is defined as the sum of the projection quantum numbers of all single-spin irreducible spherical tensor operators entering the direct product state.
+
restricts the basis so as to keep only the longitudinal spin states on the spins of the specified type and / or the specified numbers. The inner cell array lists isotope names and spin numbers; there is one inner cell array per substance, and the numeric entries must belong to that substance. The field name [[bas]].longitudinals of earlier versions is retired. In some exotic cases (''e.g.'' very strongly coupled heteronuclei) it is necessary to include not only the longitudinal but also zero-quantum states of a specified subset(s) of spins. The following statement:
  
−
The coherence order filter above refers to the whole system. In common high-field NMR experiments it is also the case that only longitudinal states are populated on specific spins (such as 15N in a 1H pulse-acquire NMR experiment). The following statement:
+
    [[bas]].zero_quantum=<nowiki>{{{'15N'},[2 7 12]}}</nowiki>;
  
−
    bas.longitudinals={'15N','13C'};
+
instructs ''Spinach'' to keep only the states with zero total projection over the union of all 15N spins and spins 2, 7, and 12 of the substance; the inner cell array of each substance lists isotope names and spin numbers, and the zero-quantum condition is applied to the union of the spins it names.
  
−
additionally screens the basis so as to keep only the longitudinal spin states on the specified spins (in this case 15N and 13C).
+
''Version 2.11, authors: [[Ilya Kuprov]]''

Latest revision as of 10:02, 18 September 2026

Any Spinach input must contain a specification of the formalism to be used (Hilbert or Liouville space), a specification of the type of basis operators to be used (Pauli matrices or irreducible spherical tensors), and a choice of which quantum states should be taken into consideration during the simulation process. The selection of formalism, approximation and basis set is accomplished by a call to basis.m function:

    spin_system=basis(spin_system,bas);

which updates the spin_system data structure with formalism and basis set information. All relevant parameters are supplied as subfields of the bas structure, which is described in detail in this chapter.

What does basis set mean in spin dynamics?

Every quantum state of the spin system may be described by a density matrix, and the density matrix may be written as a linear combination of some basis matrices. In the simple case of one spin:

\(\hat{\rho }=a{{\hat{\sigma }}_{\text{X}}}+b{{\hat{\sigma }}_{\text{Y}}}+c{{\hat{\sigma }}_{\text{Z}}}\)

where \(\left\{ {{{\hat{\sigma }}}_{\text{X}}},{{{\hat{\sigma }}}_{\text{Y}}},{{{\hat{\sigma }}}_{\text{Z}}} \right\}\) are Pauli matrices and \(\left\{ a,b,c \right\}\) are complex numbers. In this case, the Pauli matrices are the basis set and the complex numbers are the expansion coefficients. Systems with multiple spins have many more operators in the basis set: not only single-spin operators, but also multi-spin operators (for example \(\hat{\sigma }_{\text{Z}}^{\left( 1 \right)}\otimes \hat{\sigma }_{\text{Z}}^{\left( 2 \right)}\)) which describe correlated simultaneous dynamics of multiple spins.

It is these multi-spin correlated states that are often unnecessary. Consider a very large coupled spin system of the kind shown in Figure 1. Even though, technically speaking, the two methyl groups on the opposite sides of the molecule are connected through the network of J-couplings, the practical likelihood of the corresponding correlation actually appearing in a regular liquid state NMR experiment is negligible - the groups are simply too far.

Figure 1. Stereo plot of the anti-difluoroheptane spin system with significant J-couplings shown by dashed lines. In regular liquid state NMR simulations it may safely be assumed that the spins belonging to different methyl groups on the opposite sides of the molecule never become correlated.

The corresponding operators may be dropped from the basis set. This reduces the number of coefficients in the density matrix expansion, and therefore the matrix dimension required for simulation. It is easy to demonstrate that, in very large molecules, the number of different correlated states that never get populated is very large. Dropping these states from the basis set accelerates simulations by many orders of magnitude. Some specific states may also be inaccessible due to the presence of symmetries, conservation laws, spin relaxation, and many other factors. Spinach can take all of these factors into account (and run simulations at a massively reduced computational cost), but it needs you to provide the information that would enable it to make the decisions about which states should and should not be considered relevant.

Figure 2. Numerical simulation of the density matrix norm dynamics during the evolution and detection period of a pulse-acquire NMR experiment on the 22-spin system of strychnine. All distances and magnetic parameters imported from a GIAO DFT B3LYP/EPR-II calculation. Bloch-Redfield-Wangsness relaxation superoperator (including DD, CSA and cross-correlation terms) was used with isotropic rotational diffusion correlation time of 200 ps.

Figure 2 gives the general idea about the correlation orders expected in typical liquid state NMR simulations - it is clear that correlations involving large numbers of spins are not populated and may therefore be dropped from the basis set. The theory of incomplete basis set simulations in magnetic resonance is currently under active development. The following equation provides an estimate of the minimal basis set requirements:

\(k > 2\sqrt {\frac{h}{r}} {\rm{erf}}{{\rm{c}}^{ - 1}}\left( {\xi {\rm{erfc}}\left( {\frac{1}{2}\sqrt {\frac{r}{h}} } \right)} \right)\)

where \(k\) gives the maximum spin correlation order to be included in the basis, \(\xi\) is the target accuracy, \(r\) is the average relaxation rate in the system and \(h\) is the average spin-spin coupling (single-spin interactions, such as Zeeman, NQI and ZFS, do not count).

Formalism selection

The first decision you are required to make concerns the simulation formalism, using bas.formalism parameter, for example:

    bas.formalism='sphten-liouv';

Unless you have good reasons not to, choose 'sphten-liouv' here. The following formalisms are supported by the kernel:

Formalism keyword Formalism description
'sphten-liouv'

Liouville space formalism; the fundamental operators from which the basis set is built are single-spin irreducible spherical tensors. These operators are ordered with respect to many common transformations and conservation laws encountered in magnetic resonance. Many useful operations may therefore be performed semi-analytically. A lot of Spinach functionality either requires this formalism or operates most efficiently within it. This should be the default choice unless you have good reasons to pick something else.

'zeeman-liouv' Liouville space formalism; the fundamental operators from which the basis set is built are single transition operators between the projection states on the Z axis. The state vector coefficients in this formalism are easy to interpret because they correspond to populations of standard textbook spin states. This formalism is essentially a vectorisation of 'zeeman-hilb'; it permits only limited state space reduction; most calculations would have exponential complexity scaling if this option is chosen.
'zeeman-hilb' Hilbert space formalism; the fundamental states from which the basis set is built are the projection states on the Z axis. This is the standard density operator formalism described in most magnetic resonance textbooks. Only the core functionality (operators, states, propagators, evolution) is available. This option is mostly useful for backwards compatibility checks; it cannot support complicated relaxation theories or chemical kinetics. All calculations within this formalism would have exponential complexity scaling.

System-level state space reduction, and therefore polynomial complexity scaling, is only available within 'sphten-liouv' formalism. If your system has more than 20 spins, 'sphten-liouv' is your only realistic choice. For small but strongly coupled spin systems without significant relaxation effects, choose 'zeeman-hilb'.

Approximation selection

To run an exact calculation in any formalism, set:

    bas.approximation='none';

This option requests a complete basis set, which is only practical up to about twelve spins in Hilbert space and six spins in Liouville space. Systems containing bosonic modes are subject to the same considerations, with the Fock space truncation of each mode adding its own dimension: the IK-SBS basis set below builds its coupling graphs from the mode couplings declared in inter.modes and from the spin-spin coupling tensors, so that spin-mode correlations survive the approximation; IK-1 and IK-2 are for spin-only systems and refuse bosonic modes. Approximate calculations are those that use an incomplete basis set. The user is expected to provide the information that Spinach would use to build the basis set. The following frequently encountered choices are provided with the kernel:

Approximation Approximation description Parameters
bas.approximation='IK-0' Includes all product states between up to (and including) bas.inter_level spins located anywhere within the system. The asymptotic scaling of this basis set is polynomial. bas.inter_level
bas.approximation='IK-1' Includes all product states between up to (and including) bas.inter_level directly coupled spins, and up to order bas.prox_level between spins that are closer than tols.prox_cutoff (default is 100 Angstrom). The asymptotic scaling of this basis set is polynomial. bas.inter_level, bas.prox_level, tols.prox_cutoff
bas.approximation='IK-2' Includes, for every spin, all correlations with all directly coupled spins, and correlations with up to (and including) bas.prox_level with spins that are closer than tols.prox_cutoff (default is 100 Angstrom). The asymptotic scaling of this basis set is polynomial. bas.prox_level, tols.prox_cutoff
bas.approximation='IK-DNP' Basis set for systems containing both electrons and nuclei. Three coupling graphs are built from the coupling tensors with 2-norm above tols.inter_cutoff: inter-electron, electron-nuclear, and inter-nuclear. Each graph is traced to its own correlation level given in the three-element vector bas.inter_level=[ee en nn]; inside the resulting subgraphs, pure inter-nuclear correlations above the third level are dropped. bas.inter_level (three elements), tols.inter_cutoff
bas.approximation='IK-SBS' Basis set for spin-boson systems, which must contain both spins and bosonic modes. The spin-spin coupling graph is built from the coupling tensors under bas.connectivity, and the bosonic mode couplings declared in inter.modes with 2-norm above tols.inter_cutoff are added: pairwise exchange, dispersive, Kerr, and longitudinal channels link the two modes, coupling_mod and zeeman_mod entries link the modes to the spin pairs and spins they modulate. The graph is split into boson-boson, spin-boson, and spin-spin graphs, each traced to its own correlation level given in the three-element vector bas.inter_level=[bb sb ss]; inside the resulting subgraphs, pure boson-boson correlations above the first level and pure spin-spin correlations above the third level are dropped. bas.inter_level (three elements), bas.connectivity, tols.inter_cutoff

Note that, in most liquid state NMR calculations, the proximity cut-off of 100 Angstroms is an overkill, and a 5 Angstrom cut-off is usually adequate. The default is so large to accommodate more exotic situations, such as those in DNP and MAS NMR simulations.

In all reduced basis sets, the subgraphs are generated separately for each chemical substance, using the connectivity and proximity information of that substance only, and the correlation levels are clipped to the number of spins in the substance; the state lists are then merged into one global basis with a single unit state. The field names bas.level and bas.space_level of earlier versions are retired: basis.m stops with an error that names the replacement.

An important parameter that controls the basis state selection process defines what is considered to be an interaction. In liquid state NMR, the most appropriate interaction network is defined by J-couplings because dipolar couplings and other anisotropic interactions are averaged out. In that case, setting

    bas.connectivity='scalar_couplings';

instructs Spinach to use the isotropic parts of the coupling tensors to build the spin interaction graph. However, in solid state NMR, DNP and many ESR systems a coupling is essentially anisotropic and the interaction network must also count traceless interactions because they manifest directly. In that case, setting

    bas.connectivity='full_tensors';

instructs Spinach to use full interaction tensors to build the spin interaction graph.

Advanced state space tailoring

The built-in approximations described in the table above are usually sufficient in practice. However, particularly tough cases may require you to exercise finer control over which states are included and which are not. To that end, Spinach provides an option to force the inclusion of user-specified correlations. A typical specification for a 16-spin system (protons and fluorine, numbered sequentially along the chain) of difluoroheptane shown in Figure 1 would look like the following:

    bas.formalism='sphten-liouv';
    bas.approximation='IK-0';
    bas.inter_level=1;
    bas.manual=[1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0; ...
                0 0 0 1 1 1 1 1 1 1 1 1 1 0 0 0; ...
                0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1];

This specification requests the simplest possible basis set (IK-0, level 1) that simply contains the states of individual spins, but no correlations. However, the bas.manual specification then instructs Spinach to add the complete basis set of the subsystem with spins 1 to 10, the complete basis set of the subsystem with spins 4 to 13, and the complete basis set of the subsystem with spins 7 to 16, and to eliminate repetitions within the resulting list of operators (note that the subsystems overlap). The complete Liouville space basis set for a 16-spin system would be 4,294,967,296-dimensional, which is far too big. However, the basis set described above is only 1,564,672-dimensional, which is manageable, but still contains all the spin orders that are realistically populated during the system dynamics - a plot similar to Figure 2 reveals that only correlations between up to eight spins are populated significantly in this system in liquid state. Each row of bas.manual must lie within one chemical substance; a row that crosses substance boundaries is an error.

The recipe for the manual state space tailoring therefore is to identify overlapping clusters of strongly correlated spins, so that every relevant state occurs in at least one of those clusters, and to give the information about the clusters to Spinach, which will take care of the basis set construction. Running trajan.m function to produce the plot of the kind shown in Figure 2 and confirm that the basis set is sufficiently large is always a good idea – research literature comparing the performance of different basis sets in different settings has yet to emerge.

Symmetry factorisation

A simulation that starts in a state of particular symmetry and evolves under the Hamiltonian that conserves that symmetry would never populate states of different symmetries. This is recognised by Spinach kernel, which supports spin permutation symmetries (not geometric point groups!). The following permutation groups are supported ('A' index indicates the largest Abelian subgroup):

    S2, S3, S4, S4A, S5, S6

along with their direct products (which are generated internally in an automatic way). All spin quantum numbers are supported. The following example declares three groups of equivalent spins, each related by S3 permutation group, the first one incorporating spins 14, 15, 16, the second one spins 17, 18, 19 and the third one spins 20, 21, 22.

    bas.sym_group={'S3','S3','S3'};
    bas.sym_spins={[14 15 16],[17 18 19],[20 21 22]};

Although all irreducible representations are commonly populated in Hilbert space simulations, in Liouville space only the fully symmetric irreducible representation is normally active. Accordingly, Spinach defaults to projecting the system into the fully symmetric irrep. Processing of other irreps may be forced by setting

    bas.sym_a1g_only=0;

It is important to stress that the symmetry factorization described above is using permutation groups – all interaction tensors of symmetry-related spins must be identical in orientation, in magnitude, and in the identity of external coupled partner spins.

Coherence order screening

Coherence order is often conserved (exactly or approximately) during spin system evolution. Spinach offers three options to restrict the basis set by coherence order. When two or three options are specified simultaneously, the resulting basis would only contain states that comply with all of the specified criteria at the same time. In all three cases, the filters are applied to each chemical substance individually; at the basis construction stage, the substances do not see each other. Each of the three fields is therefore a cell array with one element per chemical substance, in the order of the substances in inter.chem.parts (a single-substance system has one element); an empty element leaves that substance unfiltered, and a filter that refers to spins outside its substance is an error.

The following statement:

    bas.projections={[-1 0 1]};

causes only coherences of global order –1, 0 and 1 to be kept in the basis of the substance; for several substances, give one row vector per substance, e.g. {[-1 0 1],[]} to filter the first substance only. Coherence order is defined as the sum of the projection quantum numbers of all single-spin irreducible spherical tensor operators entering the direct product state.

The coherence order filter above refers to the whole system. In common high-field NMR experiments, only longitudinal states are sometimes populated on specific spins (such as 15N in a 1H pulse-acquire NMR experiment). The following statement:

    bas.longitudinal={{'15N','13C',2,17}};

restricts the basis so as to keep only the longitudinal spin states on the spins of the specified type and / or the specified numbers. The inner cell array lists isotope names and spin numbers; there is one inner cell array per substance, and the numeric entries must belong to that substance. The field name bas.longitudinals of earlier versions is retired. In some exotic cases (e.g. very strongly coupled heteronuclei) it is necessary to include not only the longitudinal but also zero-quantum states of a specified subset(s) of spins. The following statement:

    bas.zero_quantum={{{'15N'},[2 7 12]}};

instructs Spinach to keep only the states with zero total projection over the union of all 15N spins and spins 2, 7, and 12 of the substance; the inner cell array of each substance lists isotope names and spin numbers, and the zero-quantum condition is applied to the union of the spins it names.

Version 2.11, authors: Ilya Kuprov