Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor RNG ownership semantics #611

Merged
merged 4 commits into from
Aug 19, 2023
Merged

Refactor RNG ownership semantics #611

merged 4 commits into from
Aug 19, 2023

Conversation

Strilanc
Copy link
Collaborator

  • Change stim::TableauSimulator's constructor to require a move-reference for its rng
  • Change stim::FrameSimulator's constructor to require a move-reference for its rng
  • Change stim::FrameSimulator's RNG from a reference to a normal object owned by the simulator
  • Replace SHARED_TEST_RNG method with INDEPENDENT_TEST_RNG method
  • Rewrite all tests to use INDEPENDENT_TEST_RNG, fixing potential overlaps in randomness
  • Also fix some pybind11::args args -> const pybind11::args &args warnings
  • Also fix some int vs size_t comparison warnings

Fixes #353

- Change `stim::TableauSimulator`'s constructor to require a move-reference for its rng
- Change `stim::FrameSimulator`'s constructor to require a move-reference for its rng
- Change `stim::FrameSimulator`'s RNG from a reference to a normal object owned by the simulator
- Replace SHARED_TEST_RNG method with INDEPENDENT_TEST_RNG method
- Rewrite all tests to use INDEPENDENT_TEST_RNG, fixing potential overlaps in randomness
- Also fix some `pybind11::args args` -> `const pybind11::args &args` warnings
- Also fix some int vs size_t comparison warnings

Fixes #353
@Strilanc Strilanc enabled auto-merge (squash) August 19, 2023 23:10
@Strilanc Strilanc merged commit b56c1d7 into main Aug 19, 2023
53 checks passed
@Strilanc Strilanc deleted the flipsim branch August 19, 2023 23:29
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.

Refactor rng state so that simulation classes maintain internal rng
1 participant