ham_nq#
- torchspin.ham_nq(sys, nSpins=None, dtype=torch.complex128, device='cpu')[source]#
Nuclear quadrupole Hamiltonian (MHz).
- Parameters:
sys (SpinSystem) – Spin system. Quadrupole tensors are in
sys.Q(MHz) and frames insys.QFrame. Ifsys.QisNone, returns zero matrix.nSpins (list[int] | None) – 1-based indices of nuclear spins to include. Defaults to all.
dtype (dtype) – Output dtype. Default
torch.complex128.device (str) – PyTorch device string.
- Returns:
torch.Tensor – Nuclear quadrupole Hamiltonian (MHz), shape
(nStates, nStates).- Return type: