Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
throw away random numbers to avoid unexpected correlations #1569
When there is a need to inject particles (with fix deposit), a seed is used to generate a sequence of random numbers for the initial position of particles. There is a strong correlation between the first random number generated by different seeds.
Before the first few random numbers are thrown away, the position of first particle generated by different seed has a strong correlation. The figure shown here is the initial position of the first particles generated by different seeds, it is not uniform.
It can be fixed by simply throwing away the first few random numbers generated by each seed.
Jun-Chieh Wang (Applied Materials, firstname.lastname@example.org)
By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1).
By tossing the first 30 random numbers, a given seed will no longer produce exactly the same random numbers to the code/user which breaks the backward compatibility.
Post Submission Checklist
Please check the fields below as they are completed after the pull request has been submitted. Delete lines that don't apply
Further Information, Files, and Links
Put any additional information here, attach relevant text or image files, and URLs to external sites (e.g. DOIs or webpages)
This pull claims it will not break backwards compatibility, though I am afraid it will. Per the Pour documentation, a user provides a seed parameter. The provided seed will lead to a random but repeatable stream of numbers. If I provide the seed