Difference between revisions of "Human2opspec.m"
(sync with Spinach main f053e432: add master syntax line, Parameters heading) |
|||
| (12 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| − | Converts user-friendly descriptions of spin states and operators into the | + | {{DISPLAYTITLE:human2opspec.m}} __NOTOC__ |
| − | formal description | + | Converts user-friendly descriptions of spin states and operators into the formal operator and state description used by ''Spinach'' kernel. |
| − | |||
| − | 1. If both inputs are strings | + | ==Syntax== |
| + | |||
| + | [opspecs,coeffs]=human2opspec(spin_system,operators,spins) | ||
| + | |||
| + | ==Parameters== | ||
| + | The function supports three types of syntax: | ||
| + | |||
| + | '''1. If both inputs are strings''' | ||
[opspecs,coeffs]=human2opspec(spin_system,'Lz','13C') | [opspecs,coeffs]=human2opspec(spin_system,'Lz','13C') | ||
| − | the function returns a list of single-spin opspecs for all spins with the | + | the function returns a list of single-spin opspecs for all spins with the specified name. In the example above, the list of Lz operator specifications for all 13C nuclei in the system would be returned. Valid labels for operators in this type of call are 'E' (identity), 'Lz', 'Lx', 'Ly', 'L+', 'L-', 'Tl,m' (irreducible spherical tensor, l and m are integers), 'CTx', 'CTy', 'CTz', 'CT+', and 'CT-' (central transition operators in the Zeeman basis). Valid labels for the spins are standard isotope names as well as 'electrons', 'nuclei', and 'all'. |
| − | specified name. In the example above, the list of Lz operator | + | |
| − | + | '''2. If one input is a string and the other is a vector''' | |
| − | + | [opspecs,coeffs]=human2opspec(spin_system,'Lz',[1 2 4]) | |
| − | |||
| − | |||
| − | + | the function returns a list of single-spin opspecs for all spins with the specified number. In the example above, the list of Lz operator specifications for all 13C nuclei in the system would be returned. Valid labels for operators are the same as in Item 1 above. | |
| − | + | ||
| + | '''3. If the two inputs are a cell array of strings and a cell array of numbers''' | ||
| − | [opspecs,coeffs]=human2opspec(spin_system,{'Lz',' | + | [opspecs,coeffs]=human2opspec(spin_system,{'Lz','Ly'},{1,2}) |
| + | |||
| + | would return the Lz(x)Ly product operator specification with Lz on spin 1 and Ly on spin 2. Valid labels for operators are the same as in Item 1. | ||
| + | |||
| + | ==Outputs== | ||
| + | |||
| + | opspecs - Spinach operator specification: a cell array of | ||
| + | row vectors specifying which operator enters the | ||
| + | Kronecker product for which spin. | ||
| + | |||
| + | coeffs - coefficient with which each of the Kronecker pro- | ||
| + | ducts enters the overall sum. | ||
| + | |||
| + | ==Notes== | ||
| + | Direct calls to this function should not be necessary, use [[operator.m]] and [[state.m]] functions instead. | ||
| + | |||
| + | ==See also== | ||
| + | [[operator.m]], [[state.m]], [[equilibrium.m]], [[coherence.m]], [[correlation.m]], [[singlet.m]], [[adelim.m]], [[dfpt.m]], [[homospoil.m]], [[lin2lm.m]], [[lin2lmn.m]], [[lm2lin.m]], [[lmn2lin.m]], [[path_trace.m]], [[scomponents.m]], [[sinkhole.m]], [[sparse2csr.m]], [[sphten2zeeman.m]], [[stitch.m]], [[zte.m]], [[Kernel_utilities]], [[Kernel_functions]] | ||
| − | + | ''Version 2.8, authors: [[Luke Edwards]], [[Ilya Kuprov]]'' | |
| − | |||
| − | ' | ||
Latest revision as of 06:52, 30 August 2026
Converts user-friendly descriptions of spin states and operators into the formal operator and state description used by Spinach kernel.
Syntax
[opspecs,coeffs]=human2opspec(spin_system,operators,spins)
Parameters
The function supports three types of syntax:
1. If both inputs are strings
[opspecs,coeffs]=human2opspec(spin_system,'Lz','13C')
the function returns a list of single-spin opspecs for all spins with the specified name. In the example above, the list of Lz operator specifications for all 13C nuclei in the system would be returned. Valid labels for operators in this type of call are 'E' (identity), 'Lz', 'Lx', 'Ly', 'L+', 'L-', 'Tl,m' (irreducible spherical tensor, l and m are integers), 'CTx', 'CTy', 'CTz', 'CT+', and 'CT-' (central transition operators in the Zeeman basis). Valid labels for the spins are standard isotope names as well as 'electrons', 'nuclei', and 'all'.
2. If one input is a string and the other is a vector
[opspecs,coeffs]=human2opspec(spin_system,'Lz',[1 2 4])
the function returns a list of single-spin opspecs for all spins with the specified number. In the example above, the list of Lz operator specifications for all 13C nuclei in the system would be returned. Valid labels for operators are the same as in Item 1 above.
3. If the two inputs are a cell array of strings and a cell array of numbers
[opspecs,coeffs]=human2opspec(spin_system,{'Lz','Ly'},{1,2})
would return the Lz(x)Ly product operator specification with Lz on spin 1 and Ly on spin 2. Valid labels for operators are the same as in Item 1.
Outputs
opspecs - Spinach operator specification: a cell array of
row vectors specifying which operator enters the
Kronecker product for which spin.
coeffs - coefficient with which each of the Kronecker pro-
ducts enters the overall sum.
Notes
Direct calls to this function should not be necessary, use operator.m and state.m functions instead.
See also
operator.m, state.m, equilibrium.m, coherence.m, correlation.m, singlet.m, adelim.m, dfpt.m, homospoil.m, lin2lm.m, lin2lmn.m, lm2lin.m, lmn2lin.m, path_trace.m, scomponents.m, sinkhole.m, sparse2csr.m, sphten2zeeman.m, stitch.m, zte.m, Kernel_utilities, Kernel_functions
Version 2.8, authors: Luke Edwards, Ilya Kuprov