  Detecting weak radio-frequency electromagnetic fields plays a crucial role in
wide range of fields, from radio astronomy to nuclear magnetic resonance
imaging. In quantum mechanics, the ultimate limit of a weak field is a
single-photon. Detecting and manipulating single-photons at megahertz
frequencies presents a challenge as, even at cryogenic temperatures, thermal
fluctuations are significant. Here, we use a gigahertz superconducting qubit to
directly observe the quantization of a megahertz radio-frequency
electromagnetic field. Using the qubit, we achieve quantum control over thermal
photons, cooling to the ground-state and stabilizing photonic Fock states.
Releasing the resonator from our control, we directly observe its
re-thermalization dynamics with the bath with nanosecond resolution. Extending
circuit quantum electrodynamics to a new regime, we enable the exploration of
thermodynamics at the quantum scale and allow interfacing quantum circuits with
megahertz systems such as spin systems or macroscopic mechanical oscillators.
