  A hybrid stochastic-deterministic approach for computing the second-order
perturbative contribution $E^{(2)}$ within multireference perturbation theory
(MRPT) is presented. The idea at the heart of our hybrid scheme --- based on a
reformulation of $E^{(2)}$ as a sum of elementary contributions associated with
each determinant of the MR wave function --- is to split $E^{(2)}$ into a
stochastic and a deterministic part. During the simulation, the stochastic part
is gradually reduced by dynamically increasing the deterministic part until one
reaches the desired accuracy. In sharp contrast with a purely stochastic MC
scheme where the error decreases indefinitely as $t^{-1/2}$ (where $t$ is the
computational time), the statistical error in our hybrid algorithm displays a
polynomial decay $\sim t^{-n}$ with $n=3-4$ in the examples considered here. If
desired, the calculation can be carried on until the stochastic part entirely
vanishes. In that case, the exact result is obtained with no error bar and no
noticeable computational overhead compared to the fully-deterministic
calculation. The method is illustrated on the F$_2$ and Cr$_2$ molecules. Even
for the largest case corresponding to the Cr$_2$ molecule treated with the
cc-pVQZ basis set, very accurate results are obtained for $E^{(2)}$ for an
active space of (28e,176o) and a MR wave function including up to $2 \times
10^7$ determinants.
