Spin Hamiltonian

Spin Hamiltonians are constructed by calling the function liquid_hamiltonian from the hqs_nmr_parameters package, which is meant to be used for organic molecules in a liquid. It accounts for terms due to:

  • Zeeman interaction (of each nucleus with the static magnetic field)
  • Isotropic chemical shifts
  • Indirect spin-spin scalar couplings (J-couplings)

Optionally, the flag with_zeeman of liquid_hamiltonian may be set to False. In that case, the function omits the pure Zeeman term, but includes the chemical shifts and the J-couplings.

The units of the Spin Hamiltonian conform to the conventions in the field of NMR. In consequence, the Hamiltonian is in angular frequency units of radians per second. To convert to Hz, the Hamiltonian needs to be divided by 2 . To convert to energy units (Joule), the Hamiltonian needs to be multiplied with the reduced Planck constant ().

How to set up a Spin Hamiltonian

We need to make use of NMRParameters objects, which are returned by the spin_system method of MolecularData objects, which store molecular parameters for individual molecules and indicate the static magnetic field in Tesla. For the ethanol molecule, we can access its molecular data from the examples module as:

from pprint import pprint
from hqs_nmr_parameters.examples import molecules
from hqs_nmr_parameters import liquid_hamiltonian

parameters = molecules["C2H5OH"]
nmr_parameters = parameters.spin_system()
spin_hamiltonian = liquid_hamiltonian(
    isotopes=nmr_parameters.isotopes,
    shifts=nmr_parameters.shifts,
    Jvalues=dict(nmr_parameters.j_couplings),
    field=11.7)
pprint(spin_hamiltonian)
SpinHamiltonianSystem(6){
0Z: -1.565006405055561e9,
1Z: -1.565006405055561e9,
2Z: -1.565006405055561e9,
3Z: -1.5650102706165495e9,
4Z: -1.5650102706165495e9,
5Z: -1.5650065146058724e9,
0X3X: 1.0995574287564276e1,
0Y3Y: 1.0995574287564276e1,
0Z3Z: 1.0995574287564276e1,
0X4X: 1.0995574287564276e1,
0Y4Y: 1.0995574287564276e1,
0Z4Z: 1.0995574287564276e1,
1X3X: 1.0995574287564276e1,
1Y3Y: 1.0995574287564276e1,
1Z3Z: 1.0995574287564276e1,
1X4X: 1.0995574287564276e1,
1Y4Y: 1.0995574287564276e1,
1Z4Z: 1.0995574287564276e1,
2X3X: 1.0995574287564276e1,
2Y3Y: 1.0995574287564276e1,
2Z3Z: 1.0995574287564276e1,
2X4X: 1.0995574287564276e1,
2Y4Y: 1.0995574287564276e1,
2Z4Z: 1.0995574287564276e1,
}

The output is an instance of the SpinHamiltonianSystem class, i.e., a representation of the system of spins as defined in struqture_py, a dependency of the HQS NMR Tool.