orisel#
- torchspin.orisel(sys, exp, opt=None, *, per_transition=False)[source]#
Orientation selectivity weights at a fixed field (EasySpin
orisel).For each orientation of the static field in the molecular frame, the spin Hamiltonian is diagonalized at
exp.Field; every pair of levelsu < vcontributes\[w_{uv} = R_{uv}\, \exp(-2\xi_{uv}^2), \qquad \xi_{uv} = \frac{|E_v - E_u| - \nu_{\text{mw}}}{\Gamma}, \qquad \Gamma = \frac{\sqrt{\sum_i n_i^2 \,\text{HStrain}_i^2 + \text{ExciteWidth}^2}}{\sqrt{2\ln 2}},\]with \(R_{uv}\) the transition rate \((|\langle u|\mu_{xL}|v\rangle|^2 + |\langle u|\mu_{yL}|v\rangle|^2)/2\) (
AveragedIntensity) and \(n\) the field direction (orisel.m:120-154). The weights are neither normalized nor multiplied by grid (solid-angle) weights, as in EasySpin. Any number of electron and nuclear spins is supported (full diagonalization). The result is differentiable with respect to tensor-valued spin-system parameters (g,A,D,HStrain, …).- Parameters:
sys (SpinSystem) – Spin system (
HStrainin MHz, molecular frame;lwis not used).exp (Experiment) – Required:
Field(mT, > 0),mwFreq(GHz) andExciteWidth(excitation FWHM, MHz;math.infgives weight 1 for every orientation and transition, as in EasySpin). Optional:Orientations, an(N, 2)array of[phi, theta](rad) in the molecular frame; when given, these orientations are used instead of a grid.opt (OriselOptions, optional) –
GridSize(default 46),GridSymmetry(default fromhamsymm(), grid in its symmetry frame) andAveragedIntensity(default True).per_transition (bool, keyword-only) –
False(default): EasySpin’s one-output form, weights summed over transitions.True: EasySpin’s two-output form[Weights, Transitions] = orisel(...).
- Returns:
With ``per_transition=False`` (
(weights, phi, theta))weights (Tensor, shape (nOri,)) – Selectivity per orientation (sum over all level pairs).
phi, theta (Tensor, shape (nOri,)) – Orientations (rad, molecular frame) the weights belong to: the grid rotated into the molecular frame (EasySpin
vec2ang(GridFrame*vecs)) orexp.Orientations.With ``per_transition=True`` (
(Weights, Transitions, phi, theta))Weights (Tensor, shape (nOri, nTrans)) – Weight of every level pair at every orientation.
Transitions (Tensor (int64), shape (nTrans, 2)) – Level pairs
(u, v), 1-based withu < vand levels numbered in ascending energy, in the order of EasySpin’snchoosek(1:N, 2)(the same numbering asOptions.Transitions). AllN(N-1)/2pairs are listed, including forbidden ones.
Examples
>>> from torchspin import SpinSystem >>> from torchspin.experiment import Experiment >>> from torchspin.orisel import orisel >>> sys = SpinSystem(S=0.5, g=[2.0, 2.1, 2.2], HStrain=[50, 50, 50]) >>> exp = Experiment(mwFreq=9.5, Field=320, ExciteWidth=100) >>> w, phi, theta = orisel(sys, exp) >>> W, trans, phi, theta = orisel(sys, exp, per_transition=True) >>> trans.tolist() [[1, 2]]