  The sampling problem lies at the heart of atomistic simulations and over the
years many different enhanced sampling methods have been suggested towards its
solution. These methods are often grouped into two broad families. On the one
hand methods such as umbrella sampling and metadynamics that build a bias
potential based on few order parameters or collective variables. On the other
hand, tempering methods such as replica exchange that combine different
thermodynamic ensembles in one single expanded ensemble. We instead adopt a
unifying perspective, focusing on the target probability distribution sampled
by the different methods. This allows us to introduce a new class of
collective-variables-based bias potentials that can be used to sample any of
the expanded ensembles normally sampled via replica exchange. We also provide a
practical implementation, by properly adapting the iterative scheme of the
recently developed on-the-fly probability enhanced sampling method [Invernizzi
and Parrinello, J. Phys. Chem. Lett. 11.7 (2020)], which was originally
introduced for metadynamics-like sampling. The resulting method is very general
and can be used to achieve different types of enhanced sampling. It is also
reliable and simple to use, since it presents only few and robust external
parameters and has a straightforward reweighting scheme. Furthermore, it can be
used with any number of parallel replicas. We show the versatility of our
approach with applications to multicanonical and multithermal-multibaric
simulations, thermodynamic integration, umbrella sampling, and combinations
thereof.
