Solver
Tools for solving the NV center hamiltonian.
Zeeman Hamiltonian
from nvtools import unit
from nvtools.solver import Solver
solver = Solver()
# calculate absolute field value and angle to NV axis from two resonances
b_abs, theta = self.solver.field_from_resonances(2865 * unit.MHz, 2875 * unit.MHz)
# calculate B-Field vector from eight resonance frequencies
b_field = self.solver.field_vector_from_resonances([<list of eight resonance frequencies>])
Hyperfine Hamiltonian
from nvtools import unit
from nvtools.solver import Solver
# create a solver for a given nitrogen isotope
solver = Solver("14N") # or Solver("15N")
# get absolute field value and angle to NV axis from two resonances
b_abs, theta = self.solver.field_from_resonances(2865 * unit.MHz, 2875 * unit.MHz)