  Purifying a high-temperature ensemble of quantum particles towards a known
state is a key requirement to exploit quantum many-body effects. An alternative
to passive cooling, which brings a system to its ground state, is based on
feedback to stabilise the system actively around a target state. This
alternative, if realised, offers additional control capabilities for the design
of quantum states. Here we present a quantum feedback algorithm capable of
stabilising the collective state of an ensemble from an infinite-temperature
state to the limit of single quanta. We implement this on ~50,000 nuclei in a
semiconductor quantum dot, and show that the nuclear-spin fluctuations are
reduced 83-fold down to 10 spin macrostates. While our algorithm can purify a
single macrostate, system-specific inhomogeneities prevent reaching this limit.
Our feedback algorithm further engineers classically correlated ensemble states
via macrostate tuning, weighted bimodality, and latticed multistability,
constituting a pre-cursor towards quantum-correlated macrostates.
