  We present an all-optical method for efficiently preparing cold atoms in a
desired Zeeman state, either on the magnetically insensitive clock state
(m_F=0) or a particular state suitable for processing or storing quantum
information. By applying the theoretical fitting model to a single microwave
spectrum, we can individually determine the population distribution, microwave
polarization ratio, and microwave Rabi frequency. We can dynamically track the
population distribution during the optical pumping process using this real-time
microwave spectrum. In a steady-state condition, a simplified model, which
considers resonant and off-resonant transitions, indicates that there is an
upper limit to the purity under a weak optical pumping field. The population
purity up to 96(2)% or 98(1)% on the desired quantum state has been achieved
after optimizing the intensity and polarization of the optical pumping field.
Our study provides valuable information and potential applications in precision
measurement and quantum computation research.
