From brianh@scg.scg.fujitsu.com  Wed Mar 15 13:16:05 1995
Received: from mail.barrnet.net  for brianh@scg.scg.fujitsu.com
	by www.ccl.net (8.6.10/930601.1506) id NAA01990; Wed, 15 Mar 1995 13:10:06 -0500
Received: from fujitsu1.fujitsu.com by mail.barrnet.net (8.6.10/BARRNET-Len-Rose)
	id KAA13598; Wed, 15 Mar 1995 10:10:05 -0800
Received: from scg.scg.fai.com (scg.scg.fujitsu.com) by fujitsu1.fujitsu.com (4.1/SMI-4.1)
	id AA16519; Wed, 15 Mar 95 10:10:41 PST
Received: by scg.scg.fai.com (4.1/SMI-4.1)
	id AA16432; Wed, 15 Mar 95 10:11:51 PST
Date: Wed, 15 Mar 95 10:11:51 PST
From: brianh@scg.scg.fujitsu.com (Brian Hammond)
Message-Id: <9503151811.AA16432@scg.scg.fai.com>
To: chemistry@ccl.net
Subject: Random number generator for QMC
Cc: brianh@scg.scg.fujitsu.com




Dave Young writes:

>Hello,
>
>        I am starting to do Quantum Monte Carlo calculations and
>I am interested in the performance of random number generators.
>
>        There have been a number of tests developed, the most trusted
>seem to be those in "Seminumerical Algorithms" by Knuth.  And there
>are a number of supplemental random number generators, such as the
>ran3 generator in "Numerical Recipies".  It has also been demonstrated
>that in the past the random number generators built into various 
>programming languages were not to be trusted.
>
>        My question is - Do the random number generators built into
>the current generation of compilers pass statistical tests?
>
>        I have tested the built in random number generators in
>Borland C++ and GNU C++ and so far they have passed all tests
>(working out of Knuth).  I would like to know if it is only C++ that
>has a reliable random number generator implemented or if all
>compilers are now reliable, or if it is only certain vendors even within
>the C++ language?
>
>        The reason that I would like to use built in random number
>generators is that Knuth indicates that code written directly in 
>assembly language can accomplish the task faster than code written in
>standard source code.  The GNU C++ built in random number generator
>is a factor of 2 faster than the ran3 generator using all available
>compiler optimization.
>
>
>                                Dave Young
>                                young@slater.cem.msu.edu
>                                youngdc@msucem
>

For QMC calculations the "quality" of pseudo-random numbers depends on the
algorithm used. Most modern Fortran- or C-library pseudo-random number
generators are good enough, particularly if you are doing branching
in which you are using a random number of pseudo-random numbers. 
Also you must consider how to create Gaussian distributed random 
numbers if your algorithm calls for them. I have seen presentations
where the overall cycle length of the underlying pseudo-random number
generator is quite noticeable due to creating Gaussian numbers by
adding 12 uniformly distributed numbers. 

So, in general use a pseudo-random number generator with a long
cycle length and use Box-Muller if you want Gaussian pseudo-random numbers.

-Brian

======================================================================== 
Brian L. Hammond                 _/_/_/_/    _/_/_/    _/_/_/_/_/   
Computational Research Div.     _/        _/      _/      _/
Fujitsu America, Inc.          _/_/_/    _/_/_/_/_/      _/
3055 Orchard Drive            _/        _/      _/      _/
San Jose, CA  95134          _/        _/      _/  _/_/_/_/_/
Tel: (408) 456-7322
Email: brianh@fai.com


