In order to support per-particle state in Monte Carlo transport calculations the size of the state must be relatively small in comparison to the amount of storage normally associated with a particle. A Monte Carlo particle might have an energy or velocity, three position coordinates, and three direction coordinates associated with it, in addition to a few parameters which indicate the type of particle that is being represented. To prevent application storage from being dominated by random number state, the size of the state must be small when compared to perhaps a dozen words of memory. This precludes using lagged-Fibonacci [2] generators that require many tens to hundreds of words of memory even though this class of random number generators can produce sequences of very high quality.
Although the random number strategy we have implemented can be extended to any generator that is suitably bit efficient, all of the generators that we have implemented are linear congruential generators for which the state fits in a single 64-bit word. This meets the requirement of being small compared to the amount of storage normally associated with a Monte Carlo particle. We offer carefully chosen prime moduli to resolve patterns that appear in the linear congruential generators that are commonly used.
If we are to provide for an uncountable number of statistically independent random number states using a single random number stream of demonstrated quality, we need a mechanism to efficiently select random starting positions on the random number stream. A different linear congruential generator can be used for this purpose [3], but this provides insufficient de-correlation between the resulting random number seed states for individual particles. In the RNG library we use a cryptographic hash function to generate statistically independent random number states. The hash function can be used to construct a sequence of uncorrelated random number states by passing an ordinal sequence through it. The hash function may also be used to spawn a new random number state from a parent, with the position, in the random number sequence, of the child's state being uncorrelated to the position of the parent's state.