QuasiMC.jl implements a modular framework for Quasi-Monte Carlo integration. The four main components interact as follows:
Generates low-discrepancy point sets in [0,1)^d. Available generators:
IIDStdUniform— pseudo-random (IID) uniform samplesLattice— rank-1 integration lattice with optional random shiftDigitalNetB2— Sobol' digital net (base 2) with optional scramblingHalton— Halton sequence using prime basesKronecker— Kronecker / irrational-rotation low-discrepancy sequenceDigitalNetAnyBases/Faure— more general digital-net constructions
DigitalNetB2 also supports QMCPy-style constructor options such as custom generating matrices, order aliases, widened t bit depth, msb handling for custom matrices, and higher-order interlacing via alpha > 1.
Lattice also supports QMCPy-style constructor inputs such as direct custom generating vectors, the integer shortcut for random odd vectors, order aliases, and LDData-format files, names, or URLs. In multilevel workflows, spawn_dd now preserves explicit lattice-vector sources when they carry enough entries for the requested dimension.
Lattice, DigitalNetB2, and Halton currently rely on the QMCToolsCL shared library supplied through QuasiMC's staged QMCToolsCL_jll dependency, so no Python setup is required for these QMC generators.
Transforms [0,1)^d samples to the desired probability domain:
Uniform— uniform on[a,b]^dGaussian— multivariate normal (PCA or Cholesky decomposition)BrownianMotion— standard Brownian motion pathsLebesgue— Lebesgue measure on[a,b]^dGeometricBrownianMotion— geometric Brownian motion pathsStudentT— multivariate Student-tTriangular— triangular distributionKumaraswamy— Kumaraswamy distributionJohnsonsSU— Johnson's SU distributionBernoulliCont— continuous BernoulliAcceptanceRejection/AcceptanceRejectionReal— deterministic acceptance-rejection samplers on the cube / real spaceDistributionsWrapper— bridge to Distributions.jl marginalsMaternGP— Matern Gaussian-process prior measureUniformTriangle— uniform sampling on a reference triangleZeroInflatedExpUniform— mixed zero-inflated / exponential-uniform measure
The function to be integrated:
CustomFun— user-supplied functionKeister—\pi^{d/2} \cos(\|x\|)(standard QMC test function)Genz— six Genz test functions (oscillatory, product peak, etc.)AsianOption/FinancialOption— financial option pricing (European, Asian, lookback, digital, barrier)FinancialOptionML— multilevel financial option interfaceBoxIntegral,Linear0,Sin1D,Ishigami,Hartmann6D— standard test integrandsMultimodal2D,FourBranch2D— reliability analysis test functionsSensitivityIndices— Sobol sensitivity-index estimatorBayesianLRCoeffs— Bayesian logistic-regression coefficient posteriorUMBridgeWrapper— UMBridge.jl-backed external model integrand
For problems with a natural hierarchy of discretization levels (e.g., PDE solvers with mesh refinement), the AbstractMLIntegrand interface supports multilevel methods. A multilevel integrand implements:
ml_evaluate(f, x, level)— returns(Qcoarse, Qfine)pairs for the telescoping sumdimension_at_level(f, level)— stochastic dimension at each levelcost_at_level(f, level)— computational cost per sample at each level
Helper functions spawn_dd and spawn_tm create new samplers at each level with the appropriate dimension.
QuasiMC.jl follows the same four-component architecture as QMCPy: discrete distributions, true measures, integrands, and stopping criteria. For extension work, the key framework contract is method-based rather than field-based:
QuasiMC.dimension(obj)returns the stochastic dimension of a discrete distribution, true measure, or integrand.QuasiMC.discrete_distribution(obj)returns the underlying point generator.QuasiMC.true_measure(f)returns the integrand's true measure.
Existing built-in types satisfy this contract through their stored fields, but new subtype authors may overload these methods instead of reproducing the same field layout. That preserves encapsulation while letting the generic sampling, transform, and stopping-criterion pipeline remain plug-and-play.
Built-in constructors on abstract arguments are expected to honor this contract as well. In practice, that means methods like Uniform(dd::AbstractDiscreteDistribution) or Keister(tm::AbstractTrueMeasure) should query dimension(dd) or dimension(tm) instead of assuming a concrete .dimension field exists.
QuasiMC.jl uses four package-level stability labels for exported names:
| Status | Representative symbols | Meaning |
|---|---|---|
| Stable | IIDStdUniform, Lattice, DigitalNetB2, Gaussian, BrownianMotion, Keister, Genz, CubMCCLT, CubMCG, CubQMCLatticeG, CubQMCNetG, CubQMCNetGRep |
Expected to remain source-compatible except for deliberate documented breaking releases |
| Beta | CubQMCBayesLatticeG, CubQMCBayesNetG, CubMLMC, CubMLMCCont, CubMLQMC, CubMLQMCCont |
Usable and tested, but advanced interfaces may still be refined before long-term stabilization |
| Experimental | PFGPCI, UMBridgeWrapper, KernelMultiTask, KernelMultiTaskDerivs |
Exported for early adopters; behavior and interfaces may change with limited compatibility guarantees |
| Placeholder | gpu_fwht, gpu_fwht! |
Exported names reserved for future functionality; current implementation does not provide the advertised capability |
Adaptive algorithms that determine sample size:
CubMCCLT— IID Monte Carlo with CLT confidence intervalCubMCCLTVec— vectorized IID Monte Carlo with CLT-based doublingCubMCG— guaranteed IID Monte Carlo using Berry-Esseen-style boundsCubQMCLatticeG— replicated randomized lattice ruleCubQMCNetG— single randomized digital net in natural (radical-inverse) orderCubQMCNetGRep— replicated randomized digital netCubQMCBayesLatticeG— Bayesian QMC for lattices (kernel-based error bound)CubQMCBayesNetG— Bayesian QMC for digital nets (WHT-based error bound)CubQMCRepStudentT— replicated QMC with Student's t confidence intervalsPFGPCI— experimental probability-of-failure GP criterion with an optional Julia GP backend
CubMLMC— multilevel Monte Carlo (Giles 2008) with optimal sample allocationCubMLMCCont— continuation MLMC with progressively tighter tolerancesCubMLQMC— multilevel quasi-Monte Carlo with replicated low-discrepancy rulesCubMLQMCCont— continuation multilevel quasi-Monte Carlo using replicated lattice/digital net rules
The multilevel methods use the telescoping sum E[Q_L] = E[Q_0] + \sum_{\ell=1}^{L} E[Q_\ell - Q_{\ell-1}] to efficiently allocate computational effort across levels, exploiting the decreasing variance of level differences.
Stopping Criterion → requests samples
→ Discrete Distribution → generates [0,1)^d points
→ True Measure → transforms to target domain
→ Integrand → evaluates function
→ Stopping Criterion → checks error bound
→ repeat or return result
ML Stopping Criterion → for each level l:
→ spawn_dd / spawn_tm → create sampler at dimension d_l
→ Discrete Distribution → generates [0,1)^{d_l} points
→ True Measure → transforms to target domain
→ ml_evaluate(f, x, l) → returns (Q_coarse, Q_fine)
→ ML Stopping Criterion → estimates variance, adjusts allocation
→ repeat or add levels until convergence