6 releases
| 0.4.2 | Feb 6, 2026 |
|---|---|
| 0.4.1 | Feb 6, 2026 |
| 0.4.0 | Jan 25, 2026 |
| 0.3.2 | Jan 21, 2026 |
| 0.2.0 | Jan 14, 2026 |
#1611 in Math
61KB
1.5K
SLoC
GPU-accelerated Monte Carlo primitives for variance reduction.
This crate provides variance reduction techniques for Monte Carlo simulation that can be accelerated on GPU via RingKernel.
Features
- Counter-based PRNGs: Philox and other stateless generators suitable for GPU
- Variance Reduction: Antithetic variates, control variates, importance sampling
- GPU Compatibility: All types are designed for zero-copy GPU transfer
Example
use ringkernel_montecarlo::prelude::*;
// Create a Philox-based RNG
let mut rng = PhiloxRng::new(0, 42);
// Generate uniform random numbers
let u: f32 = rng.next_uniform();
// Generate normal variates
let z: f32 = rng.next_normal();
// Antithetic variates for variance reduction
let (u1, u2) = antithetic_pair(&mut rng);
// u1 and u2 are negatively correlated
Dependencies
~12–18MB
~259K SLoC