  Optically detected magnetic resonance (ODMR) is an efficient and reliable
method that enables initialization and readout of spin states through
spin-photon interface. In general, high quantum efficiency and large
spin-dependent photoluminescence contrast are desirable for reliable quantum
information readout. However, reliable prediction of the ODMR contrast from
first-principles requires accurate description of complex spin polarization
mechanisms of spin defects. These mechanisms often include multiple radiative
and nonradiative processes in particular intersystem crossing (ISC)among
multiple excited electronic states. In this work we present our implementation
of the first-principles ODMR contrast, by solving kinetic master equation with
calculated rates from \textit{ab initio} electronic structure methods then
benchmark the implementation on the case of the negatively-charged nitrogen
vacancy center in diamond. We show the importance of correct description of
multi-reference electronic states and pseudo Jahn-Teller effect for
quantitatively, even qualitatively correct prediction of spin-orbit coupling
(SOC) and the rate of ISC. We present the complete calculation of SOC for
different ISC processes that align with both group theory and experimental
observations. Moreover, we provide a comprehensive picture of excitation and
relaxation dynamics, including previously unexplored internal conversion
processes. We show good agreement between our first-principles calculations and
the experimental ODMR contrast under magnetic field. We then demonstrate
reliable predictions of magnetic field direction, pump power, and microwave
frequency dependency, as important parameters for ODMR experiments. Our work
provides a predictive computational platform for spin polarization and optical
readout of solid-state quantum defects from first principles.
