Skip to content

Add sobol sampler as well as tests and demonstrating notebook - #325

Open
Samuel-Vangu wants to merge 2 commits into
theochem:masterfrom
Samuel-Vangu:feature/add-sobol-sampler
Open

Add sobol sampler as well as tests and demonstrating notebook#325
Samuel-Vangu wants to merge 2 commits into
theochem:masterfrom
Samuel-Vangu:feature/add-sobol-sampler

Conversation

@Samuel-Vangu

Copy link
Copy Markdown

Adds a Sobol sampling class for integration on (hyper)cubic grids,
following up on the discussion in #322.

What's included

  • src/grid/sobol.py: Sobol(n_points, dimension, seed=None, randomize=True, origin=None, axes=None). Wraps scipy.stats.qmc.Sobol (already a grid
    dependency), generating points via random_base2 for the balance
    properties of the digital-net construction; n_points must therefore be a
    power of 2. randomize=False gives the deterministic, unscrambled
    sequence (whose first point is always the origin); randomize=True
    applies Owen scrambling. Supports mapping onto an arbitrary parallelepiped
    via origin/axes.
  • src/grid/tests/test_sobol.py: tests covering validation, weights, domain
    mapping, integration accuracy, reproducibility, and properties specific to
    Sobol' sequences (origin as first point when unrandomized, the nesting
    property between an N-point and a 2N-point design).
image
  • An example notebook in examples/: compares Sobol against baselines
    already in grid (plain Monte Carlo, Tensor1DGrids/Trapezoidal) on two
    chemistry-motivated integrands -- a product of Gaussian-type functions
    (smooth) and a spherical interaction-cutoff indicator (discontinuous) --
    to show honestly where Sobol's low-discrepancy advantage holds and where
    it doesn't.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant