qit.hamiltonian.magnetic_dipole¶
- qit.hamiltonian.magnetic_dipole(dim, B=(0, 0, 1))¶
Local magnetic dipole Hamiltonian.
where
is the k-component of the angular momentum operator of spin i.- Parameters
dim (tuple[int]) – dimensions of the spins, i.e. dim == (2, 2, 2) would be a system of three spin-1/2’s.
B (callable[[int], tuple[float]]) – The effective magnetic field the spins locally couple to. Either a 3-tuple (homogeneous field) or a function B(i) that returns a 3-tuple for a site-dependent field.
- Returns
Hamiltonian operator
- Return type
array[complex]