ham_zf#

torchspin.ham_zf(sys, idxElectrons=None, dtype=torch.complex128, device='cpu')[source]#

Zero-field splitting Hamiltonian (MHz).

Parameters:
  • sys (SpinSystem) – Spin system. ZFS is specified via sys.D and sys.DFrame, or via Stevens coefficients sys.B and sys.BFrame. If both D and B are None, a zero matrix is returned.

  • idxElectrons (list[int] | None) – 1-based indices of electrons for which to compute ZFS. Defaults to all electrons.

  • dtype (dtype) – Output dtype. Default torch.complex128.

  • device (str) – PyTorch device string.

Returns:

torch.Tensor – ZFS Hamiltonian matrix (MHz), shape (nStates, nStates).

Return type:

Tensor