A quantum mechanical magnetic field measurement device, comprising: a spin ensemble with a Larmor resonance frequency and a Larmor resonance period in the presence of a magnetic field, and an absorption resonance frequency; a first source for providing first electromagnetic radiation that spans the spectrum of radio waves, infrared radiation, optical radiation, and ultraviolet radiation at a first wavelength, wherein the first source is positioned to illuminate the spin ensemble to polarize spins in the spin ensemble; a detector (224,244) positioned to detect electromagnetic radiation from the spin ensemble from the first source or from a second source of electromagnetic radiation; a modulator for modulating the frequency of the first electromagnetic radiation from the first electromagnetic radiation source according to a cyclic modulating signal that repeats at the Larmor resonance frequency, characterised in that for part of the Larmor resonance period the first electromagnetic radiation is provided with a frequency at or near the absorption resonance frequency, and for another part of the Larmor resonance period the frequency is swept around the absorption resonance frequency at a frequency more than three times the Larmor resonance frequency such that the power spectrum of the first electromagnetic radiation has a plurality of discrete or continuous frequency sidebands around the absorption resonance frequency; and a controller for receiving input from the detector to provide a quantum mechanical measurement of the quantum state of the spin ensemble and to infer a measurement of the magnetic field, and providing an output of the measured magnetic field. a spin ensemble with a Larmor resonance frequency and a Larmor resonance period in the presence of a magnetic field, and an absorption resonance frequency; a first source for providing first electromagnetic radiation that spans the spectrum of radio waves, infrared radiation, optical radiation, and ultraviolet radiation at a first wavelength, wherein the first source is positioned to illuminate the spin ensemble to polarize spins in the spin ensemble; a detector (224,244) positioned to detect electromagnetic radiation from the spin ensemble from the first source or from a second source of electromagnetic radiation; a modulator for modulating the frequency of the first electromagnetic radiation from the first electromagnetic radiation source according to a cyclic modulating signal that repeats at the Larmor resonance frequency, characterised in that for part of the Larmor resonance period the first electromagnetic radiation is provided with a frequency at or near the absorption resonance frequency, and for another part of the Larmor resonance period the frequency is swept around the absorption resonance frequency at a frequency more than three times the Larmor resonance frequency such that the power spectrum of the first electromagnetic radiation has a plurality of discrete or continuous frequency sidebands around the absorption resonance frequency; and a controller for receiving input from the detector to provide a quantum mechanical measurement of the quantum state of the spin ensemble and to infer a measurement of the magnetic field, and providing an output of the measured magnetic field.