  The stochastic-gauge representation is a method of mapping the equation of
motion for the quantum mechanical density operator onto a set of equivalent
stochastic differential equations. One of the stochastic variables is termed
the "weight", and its magnitude is related to the importance of the stochastic
trajectory. We investigate the use of Monte Carlo algorithms to improve the
sampling of the weighted trajectories and thus reduce sampling error in a
simulation of quantum dynamics. The method can be applied to calculations in
real time, as well as imaginary time for which Monte Carlo algorithms are
more-commonly used. The method is applicable when the weight is guaranteed to
be real, and we demonstrate how to ensure this is the case. Examples are given
for the anharmonic oscillator, where large improvements over stochastic
sampling are observed.
