  The nitrogen-vacancy (NV) center in diamond has been developed as a promising
platform for quantum sensing, especially for magnetic field measurements in the
nano-tesla range with a nanometer resolution. Optical spin readout performance
has a direct effect on the signal-to-noise ratio (SNR) of experiments. In this
work, we introduce an online optimization method to customize the laser
waveform for readout. Both simulations and experiments reveal that our new
scheme optimizes the optically detected magnetic resonance in NV center. The
SNR of optical spin readout has been witnessed a 44.1% increase in experiments.
In addition, we applied the scheme to the Rabi oscillation experiment, which
shows an improvement of 46.0% in contrast and a reduction of 12.1% in mean
deviation compared to traditional constant laser power SNR optimization. This
scheme is promising to improve sensitivities for a wide range of NV-based
applications in the future.
