Fermi Physics Class Libraries Package: CLHEP-Random

ZOOM ZOOM

ZOOM Validated CLHEP Random Package

HEP Random is a collection of random number engines and a variety of distributions which use those engines to generate pseudo-random numbers.

The ZOOM validation consists of

The source code for headers and implementations of the ZOOM version of CLHEP Random may be browsed here .

The extensions, corrections and validations on this page are completed and reflected in the Random sub-package of the ZOOM distribution of CLHEP.


What is new:

10/23/98
New Distribution: RandMultiGauss Multivariate Gaussian Distribution, as per page 170 of the new Review of Particle Physics. Returns a HepVector of random variates according to a given HepVector means mu and HepSymMatrix covariance about the mean S.

10/23/98
Tests of Distributions:

testRandDists has Tests based on generating a large number of variates and verifying that known properties of each distribution hold. Distributions tested thus far are:

RandGauss
Mean and first four moments.
Counts at 1, 2, 3, 4, and 5+ sigma.
RandMultiGauss
Mean.
Covariance matrix.
9/17/98
Cleanup of the new random engines:
Ranlux64
The earlier CLHEP implementation of this did not accurately follow Luscher's prescription. Though it passed all the usual tests, it would likely have a shorter period that the correct algorithm. The implementation has been corrected to match Luscher's ranlxd.
Hurd288Engine, Hurd160Engine, TripleRand, Mtwist
These have had several cleanups associated with the translation from integer bit streams to doubles.
(float) and (unsigned int)
Methods returning random variables of single precision are included. As compared with flat(), for engines which take the trouble to ensure randomness out to 53 bits of mantissa, (float) and (unsigned int) run faster by generating fewer random bits.

8/25/98
Several new random engines have been added:

TripleRand
is a combination of the DualRand and the Hurd288 engines, with a period of over 2**400. This is intended as a small-state (60 bytes) reasonably fast "mother of all generators" for applications that are fairly paranoid.
Hurd288Engine
Hurd160ENgine
are a pair of linearly interconnected shift register engines, based on the paper by William Hurd (not to be confused with GNU Hurd) in IEEE Transactions on Computers, C23 No. 2 page 146. This method is claimed to remove some unsatisfactory properties in the Tausworthe methods, stemming from the latter using trinomial primitive polynomials. We implement 160 and 288 bit instances, based on lines 9 and 10 of table I in that paper.

Older "Whats New" Items


Testing for Proper Behavior of CLHEP Random sub-package


ZOOM-supplied Extensions

A couple of extensions to the basic interface are useful to our community. These are in the area of internally saving and restoring state, and support for large collections of generators without getting identical sequences.

(In no case will these extensions modify or eliminate existing correct functionality.
Any bug fixes which may change behavior will be indicated explicitly.)
Changes (fed back to CLHEP) are discussed here.

  • Additional Constructors
  • Additional Methods

  • Additional Distributions

    The package now include the following distributions:

    • All eight distributions in table 28.1 of the Review of Particle Properties. Of these, Uniform, Poisson, and Gaussian were already present in HEP Random. The ZOOM work adds:
      1. Binomial -- RandBinomial
      2. Chi-squared -- RandChiSquare
      3. Student's t -- RandStudentT
      4. Gamma -- RandGamma
      5. Multivariate Gaussian -- RandMultiGauss
    • The two special cases of these (Exponential and Breit-Wigner) provided in the original CLHEP Random.

  • Additional Random Engines
    DualRand
    A new random engine, implementing one which is in wide use in the Lattice Gauge Monte Carlo community. It is a combination of a (127,97) Tausworthe shift register generator and ordinary 32-bit integer congruence. This passes the statistical tests in the Diehard suite, and is rather fast. It also has the property that two instances based on different seeds will give truly different streams, and not two separated segments of the same long stream.
    Ranshi
    A huge-state (2K bytes) generator based on F. Gutbrod's method of that same name. It repeatedly simulates throwing spinning balls onto a large collection of other spinning balls. One instance of Ranshi uses as a state one 32-bit "red ball" and 512 32-bit "black ball" spins. Techniques to avoid "trap" sequences are employed. Though the properties of this process have not been studied with any rigor, the huge state lends confidence in a good random sequence of long period. Despite the huge state, the time taken to generate a single random is excellent.
    Ranlux64
    A 64-bit variant of the Ranlux engine, again from Europe. This (along with all the ZOOM-supplied additional engines) supplies doubles which are random out to all 53 bits of mantissa, rather than just 32 as the original Ranlux does.
    MTwist
    The Mersenne Twister engine. This is a huge-state (~2.5 Kbytes) engine which has mathematically proven outstanding randomness properties and a period of 2**19,937 -1. Our implementation is from the algorithm in the paper; there is a culture on the web page of speed improvements but it is rather fast as it is, and we wanted as few risks of incorrectness as possible. This is probably the best huge-state engine available.
    TripleRand
    is a combination of the DualRand and the Hurd288 engines, with a period of over 2**400. This is intended as a small-state (60 bytes) reasonably fast "mother of all generators" for applications that are fairly paranoid. The Hurd288 engine implements a set of linearly interconnected shift register engines, based on the paper by William Hurd (not to be confused with GNU Hurd) in IEEE Transactions on Computers, C23 No. 2 page 146. This method is claimed to remove some unsatisfactory properties in the Tausworthe methods, stemming from the latter using trinomial primitive polynomials. We implement 160 and 288 bit instances, based on lines 9 and 10 of table I in that paper.


    Corrections

    Several minor changes were made in the behavior of these classes, either to conform to the clearly intended behavior, or to conform to normal semantics a user would expect in C++:

    Validation and Extensions in Progress

  • Additional Methods
  • Additional Distributions

  • Additional Engines

  • Validation

    ZOOM Home Page - Fermilab at Work - Fermilab Home


    Mark Fischler
    Last modified: October 23, 1998