where D and S are the sets of determinants included in the deterministic and stochastic components, respectively. e |I 's are sorted by decreasing c 2 I , and two processes are used simultaneously to compute the contributions ε I . e rst process is stochastic and |I is drawn according to c 2 I . When a given ε I has been computed once, its contribution is stored such that if |I is drawn again later the contribution does not need to be recomputed. e only update is to increment the number of times it has been drawn for the Monte Carlo statistics. In parallel, a deterministic process is run, forcing to compute the contribution ε I with the smallest index which has yet to be computed. e deterministic component is chosen as the rst contiguous set of ε I . Hence, the computation of E is unbiased, and the exact deterministic value can be obtained in a nite time if the calculation is run long enough. e stochastic part is only a convergence accelerator providing a reliable error bar. e computation of E is run with a default stopping criterion set to |δE (2) /E (2) | = 0.002, where δE is the statistical error associated with E . We would like to stress that, thanks to the present semistochastic algorithm, the complete wave function is considered, and that no threshold is required. Consequently, size-consistency will be preserved if a size-consistent perturbation theory is applied.