@@ -25,7 +25,7 @@ cdef extern from "distributions.h":
2525
2626 cdef void set_seed(aug_state* state, uint64_t seed, uint64_t inc)
2727
28- cdef void advance (aug_state* state, uint64_t delta)
28+ cdef void advance_state (aug_state* state, uint64_t delta)
2929
3030ctypedef uint64_t rng_state_t
3131
@@ -55,7 +55,8 @@ value is generated and returned. If `size` is an integer, then a 1-D
5555array filled with generated values is returned. If `size` is a tuple,
5656then an array with that shape is filled and returned.
5757
58- *No Compatibility Guarantee*
58+ **No Compatibility Guarantee**
59+
5960``pcg32.RandomState`` does not make a guarantee that a fixed seed and a
6061fixed series of calls to ``pcg32.RandomState`` methods using the same
6162parameters will always produce the same results. This is different from
@@ -84,6 +85,26 @@ The state of the PCG-32 PRNG is represented by 2 64-bit unsigned integers.
8485
8586See pcg64 for a similar implementation with a larger period.
8687
88+ ** Parallel Features **
89+
90+ ``pcg32.RandomState`` can be used in parallel applications in one of two ways.
91+ The preferable method is to use sub-streams, which are generated by using the
92+ same value in the first position of the seed and incrementing the second value.
93+
94+ >>> import randomstate.prng.pcg32 as rnd
95+ >>> rs = [rng.RandomState(1234, i + 1) for i in range(10)]
96+
97+ The alternative method is to use a single RandomState and advance to get
98+ non-overlapping sequences.
99+
100+ >>> import randomstate.prng.pcg32 as rnd
101+ >>> rs = [rng.RandomState(1234, 1) for _ in range(10)]
102+ >>> for i in range(10):
103+ rs[i].advance(2**32)
104+
105+ *Note*: Due to the limited period of ``pcg32.RandomState`` using ``advance``
106+ in parallel applications is not recommended.
107+
87108References
88109----------
89110.. [1] "PCG, A Family of Better Random Number Generators",
0 commit comments