On this page
Permuted Congruential Generator (64-bit, PCG64)
- class numpy.random.PCG64(seed=None)
- 
    BitGenerator for the PCG-64 pseudo-random number generator. - Parameters
- 
      - seed{None, int, array_like[ints], SeedSequence}, optional
- 
        A seed to initialize the BitGenerator. If None, then fresh, unpredictable entropy will be pulled from the OS. If anintorarray_like[ints]is passed, then it will be passed toSeedSequenceto derive the initialBitGeneratorstate. One may also pass in aSeedSequenceinstance.
 
 NotesPCG-64 is a 128-bit implementation of O’Neill’s permutation congruential generator ([1], [2]). PCG-64 has a period of and supports advancing an arbitrary number of steps as well as streams. The specific member of the PCG family that we use is PCG XSL RR 128/64 as described in the paper ([2]). PCG64provides a capsule containing function pointers that produce doubles, and unsigned 32 and 64- bit integers. These are not directly consumable in Python and must be consumed by aGeneratoror similar object that supports low-level access.Supports the method advanceto advance the RNG an arbitrary number of steps. The state of the PCG-64 RNG is represented by 2 128-bit unsigned integers.State and Seeding The PCG64state vector consists of 2 unsigned 128-bit values, which are represented externally as Python ints. One is the state of the PRNG, which is advanced by a linear congruential generator (LCG). The second is a fixed odd increment used in the LCG.The input seed is processed by SeedSequenceto generate both values. The increment is not independently settable.Parallel Features The preferred way to use a BitGenerator in parallel applications is to use the SeedSequence.spawnmethod to obtain entropy values, and to use these to generate new BitGenerators:>>> from numpy.random import Generator, PCG64, SeedSequence >>> sg = SeedSequence(1234) >>> rg = [Generator(PCG64(s)) for s in sg.spawn(10)]Compatibility Guarantee PCG64makes a guarantee that a fixed seed and will always produce the same random integer stream.References
State
| Get or set the PRNG state | 
Parallel generation
| 
 | Advance the underlying RNG as-if delta draws have occurred. | 
| 
 | Returns a new bit generator with the state jumped. | 
Extending
© 2005–2020 NumPy Developers
Licensed under the 3-clause BSD License.
 https://numpy.org/doc/1.19/reference/random/bit_generators/pcg64.html