  The magnetic exchange coupling between magnetic impurities and a
superconductor induce so-called Yu-Shiba-Rusinov (YSR) states which undergo a
quantum phase transition (QPT) upon increasing the exchange interaction beyond
a critical value. While the evolution through the QPT is readily observable, in
particular if the YSR state features an electron-hole asymmetry, the
concomitant change in the ground state is more difficult to identify. We use
ultralow temperature scanning tunneling microscopy to demonstrate how the
change in the YSR ground state across the QPT can be directly observed for a
spin-1/2 impurity in a magnetic field. We observe a change in the excitation
spectrum from the doublet ground state in the free spin regime (two spectral
features) to the singlet ground state in the screened spin regime (four
spectral features). We also identify a transition regime, where the YSR
excitation energy is smaller than the Zeeman energy. We thus provide a
straightforward way for unambiguously identifying the ground state of a
spin-1/2 YSR state.
