RNG policy
Deterministic RNG policy for gwmock-newtonian-noise scaffold generation.
Policy:
- The only supported bit generator is :class:
numpy.random.PCG64, constructed through :func:numpy.random.default_rng. This matches the convention already recorded bygwmock_noise's public dummy backend provenance (rng_bit_generator: "PCG64"), so provenance recorded by both packages is directly comparable. - A simulator seeded with an integer
seedis fully deterministic: the same(config, seed)pair always produces bit-identical realizations, and a batch realization over durationTis bit-identical to the concatenation of streamed chunks covering the sameTfrom the same seed (the continuation contract the public protocol requires), because both draw from one uninterrupted :class:~numpy.random.Generatorbit stream in call order. - The physical joint backend (:mod:
gwmock_newtonian_noise.joint) declares a segmented process instead of one uninterrupted stream: segmentkdraws from :func:segment_seed_sequence(entropy, k), so any sample is fixed by the root entropy alone and batch and chunked calls agree for any chunking. - A simulator seeded with
Nonedraws fresh entropy from the OS on every construction and is not reproducible; this is recorded verbatim (seed: None) in provenance so a consumer can tell reproducible and non-reproducible realizations apart. The physical joint backend also records the OS entropy it drew (seed_entropy), which replays the draw as a seed.
create_generator(seed)
¶
Construct the shared innovation generator for one simulator instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
seed
|
int | SeedSequence | None
|
Integer seed or :class: |
required |
Returns:
| Name | Type | Description |
|---|---|---|
A |
Generator
|
class: |
Source code in src/gwmock_newtonian_noise/rng.py
35 36 37 38 39 40 41 42 43 44 45 46 | |
segment_seed_sequence(entropy, segment)
¶
Return the seed sequence of one fixed-length segment of a segmented stream.
A segmented process (see :class:~gwmock_newtonian_noise.joint.NewtonianJointSimulator)
draws segment k from the k-th spawned child of
SeedSequence(entropy). Every segment is reachable directly, without
drawing the segments before it, so a batch call and any chunking of a
stream over the same samples consume identical bit streams.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
entropy
|
int
|
Root entropy: the integer seed, or the OS entropy a
|
required |
segment
|
int
|
Zero-based segment index. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
The |
SeedSequence
|
class: |
Source code in src/gwmock_newtonian_noise/rng.py
49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 | |