Add Kronecker sampler as well as tests and a demonstrating notebook - #326
Open
Samuel-Vangu wants to merge 1 commit into
Open
Add Kronecker sampler as well as tests and a demonstrating notebook#326Samuel-Vangu wants to merge 1 commit into
Samuel-Vangu wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a
Kroneckersampling class for integration on (hyper)cubic grids,following up on the discussion in #322.
What's included
src/grid/kronecker.py:Kronecker(n_points, dimension, seed=None, randomize=True, origin=None, axes=None). Generates the sequence(via
sympy.sieve) as irrational multipliers;randomize=Falsegives thedeterministic sequence (whose first point is always the origin),
randomize=Trueapplies a random Cranley-Patterson shift. No power-of-2or other special constraint on
n_pointsis required. Supports mappingonto an arbitrary parallelepiped via
origin/axes.src/grid/tests/test_kronecker.py: tests covering validation, weights,domain mapping, integration accuracy, reproducibility, and properties
specific to Kronecker sequences (construction verified directly against
an independent calculation with sqrt(2)/sqrt(3)/sqrt(5), origin as first
point when unrandomized, and the prefix/nesting property -- an N-point
design is always an exact prefix of a larger design with the same seed).
examples/