ham_ee#

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

Electron-electron interaction Hamiltonian (MHz).

Parameters:
  • sys (SpinSystem) – Spin system. Coupling tensors are in sys.ee (MHz) and frames in sys.eeFrame.

  • eSpins (list[int] | None) – 1-based indices of electron spins to include. At least 2 must be given, each in 1..nElectrons and without duplicates; otherwise ValueError is raised (as in EasySpin). Defaults to all electrons.

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

  • device (str) – PyTorch device string.

Returns:

torch.Tensor – Electron-electron Hamiltonian matrix (MHz), shape (nStates, nStates).

Return type:

Tensor