diptensor#
- torchspin.diptensor(spin1, spin2, rvec_nm)[source]#
Compute the point-dipole coupling tensor between two spins.
Port of EasySpin’s
diptensor.m.- Parameters:
spin1 (float, array_like, or str) –
Spin 1 specification:
float — g-factor of electron spin
(3,) array — principal g-values of electron spin
(3, 3) array — full g-tensor of electron spin
str — isotope string, e.g.
'1H','14N'(nuclear spin)
spin2 (float, array_like, or str) – Spin 2 specification (same format as spin1).
rvec_nm (array_like, shape (3,)) – Distance vector from spin 1 to spin 2, in nanometres [nm].
- Returns:
T (ndarray, shape (3, 3)) –
Dipolar coupling tensor in MHz. The full secular Hamiltonian is:
H_dip = S1 · T · S2
where T_ij = (μ₀/4π) * (γ₁ γ₂ ℏ) / r³ * (3 r̂ᵢ r̂ⱼ − δᵢⱼ) / h
- Return type:
Notes
Formula:
T_ij = (μ₀ / 4π) * (ℏ γ₁ γ₂) / (r³) * (3 r̂_i r̂_j − δ_ij) / (2π × 10⁶)
The prefactor
μ₀/(4π) * ℏ γ₁ γ₂ / r³is in rad/s (angular frequency). Dividing by2π × 10⁶converts to MHz (linear frequency).Examples
>>> T = diptensor(2.0, 2.0, [0, 0, 1.0]) # e-e along z, r=1 nm >>> print(T.diagonal()) # [Txx, Tyy, Tzz] in MHz >>> T = diptensor('1H', '1H', [0, 0, 0.3]) # H-H at 0.3 nm (≈3 Å)