  In several domains of physics, including first principle simulations and
classical models for polarizable systems, the minimization of an energy
function with respect to a set of auxiliary variables must be performed to
define the dynamics of physical degrees of freedom. In this paper, we discuss a
recent algorithm proposed to efficiently and rigorously simulate this type of
systems: the Mass-Zero (MaZe) Constrained Dynamics. In MaZe the minimum
condition is imposed as a constraint on the auxiliary variables treated as
degrees of freedom of zero inertia driven by the physical system. The method is
formulated in the Lagrangian framework, enabling the properties of the approach
to emerge naturally from a fully consistent dynamical and statistical
viewpoint. We begin by presenting MaZe for typical minimization problems where
the imposed constraints are holonomic and summarizing its key formal
properties, notably the exact Born-Oppenheimer dynamics followed by the
physical variables and the exact sampling of the corresponding physical
probability density. We then generalize the approach to the case of conditions
on the auxiliary variables that linearly involve their velocities. Such
conditions occur, for example, when describing systems in external magnetic
field and they require to adapt MaZe to integrate semiholonomic constraints.
The new development is presented in the second part of this paper and
illustrated via a proof-of-principle calculation of the charge transport
properties of a simple classical polarizable model of NaCl.
