Expand description
Quasi-random low-discrepancy sequences (feature quasirandom).
Quasi-random (low-discrepancy) sequences.
Quasi-random sequences cover the unit cube [0, 1)^D more evenly
than uniform PRNG draws - variance for Monte Carlo integration
scales O((log n)^d / n) rather than O(1/√n). They’re standard
tools for ray-tracing, financial simulation, and high-dimensional
numerical integration.
Three constructions are shipped:
VanDerCorputSequence- 1-D, any prime base.
HaltonSequence- multi-dim, Van der Corput across the first primes. Supports up to 32 dimensions.
SobolSequence- multi-dim, uses precomputed direction numbers. Supports up to 6 dimensions out of the box; the Joe-Kuo D6 file would extend this past 21 000.
These are not PRNGs and live alongside, not inside,
crate::Random. Use a PRNG when you want unpredictability;
use a quasi-random sequence when you want even coverage.
Structs§
- Halton
Sequence - Multi-dimensional Halton sequence - Van der Corput across the
first
HALTON_MAX_DIMprimes. Discrepancy is excellent for dimensions up to ~10; beyond that considerSobolSequenceor scrambled Halton. - Sobol
Sequence - Multi-dimensional Sobol sequence (Bratley-Fox 1988 starter set, dimensions 1–6). For higher-dimensional uses, switch to a Joe-Kuo D6 direction-number table (out of scope here).
- VanDer
Corput Sequence - 1-D Van der Corput sequence in a given prime base. Each step
reverses the index’s base-
bdigit expansion and reads it as a fraction in[0, 1).
Constants§
- HALTON_
MAX_ DIM - Maximum number of dimensions supported by
HaltonSequence. - SOBOL_
MAX_ DIM - Maximum number of dimensions
SobolSequencesupports with the shipped direction-number table.