zfsframes#

torchspin.zfsframes(sys)[source]#

Extract zero-field splitting parameters and principal frame orientations.

Port of EasySpin’s zfsframes.m. Analyzes the D-tensor of each electron spin and returns the conventional D/E ZFS parameters together with the Euler angles that rotate the molecular frame to the D principal frame.

Parameters:

sys (SpinSystem) – Spin system with D tensors defined.

Returns:

  • D_vals (list of float) – D parameter (MHz) for each electron. D = Dzz − (Dxx + Dyy) / 2.

  • E_vals (list of float) – E parameter (MHz) for each electron. E = (Dxx − Dyy) / 2.

  • Euler_angles (list of ndarray, shape (3,)) – Euler angles [alpha, beta, gamma] (radians) rotating the molecular frame to the D-tensor principal frame for each electron.

  • E0_vals (list of float) – Isotropic ZFS offset (MHz) per electron: E0 = (Dxx + Dyy + Dzz) / 3 (should be ~0 for traceless D).

Notes

If D is given as diagonal (nElectrons, 3) the columns are already principal values; Euler angles are taken from sys.DFrame.

If D is given as full 3×3 matrices (3*nElectrons, 3), the principal values are found by diagonalizing each D matrix, and the Euler angles are extracted from the eigenvector matrix.

Examples

>>> D_vals, E_vals, Euler, E0 = zfsframes(sys)
>>> print(f'D={D_vals[0]:.1f} MHz, E={E_vals[0]:.1f} MHz')