Skip to content

Add warning when default random number generator is used#461

Merged
thierry-martinez merged 13 commits intoTeamGraphix:masterfrom
thierry-martinez:reproducibility_warnings
Mar 16, 2026
Merged

Add warning when default random number generator is used#461
thierry-martinez merged 13 commits intoTeamGraphix:masterfrom
thierry-martinez:reproducibility_warnings

Conversation

@thierry-martinez
Copy link
Copy Markdown
Collaborator

@thierry-martinez thierry-martinez commented Mar 8, 2026

This commit adds a warning when ensure_rng is called with None.

It includes the following fixes:

This PR subsumes #459.

This commit adds a warning when `ensure_rng` is called with `None`.

It includes the following fixes:

- In `DepolarisingNoiseModel`, the field `rng` has been removed: the
  current API favors passing `rng` as a method parameter instead of
  storing it inside the structure.

- `rand_dm` and `rand_channel_kraus` now use the `rng` passed as a
  parameter for the entire computation, instead of relying partially on
  the default random number generator.

- Since TeamGraphix#235 appears not to have been properly fixed,
  `test_full_reduce_toffoli` is marked as `xfail`.
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.04%. Comparing base (aa0d407) to head (f8287db).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #461      +/-   ##
==========================================
+ Coverage   88.98%   89.04%   +0.06%     
==========================================
  Files          44       44              
  Lines        6545     6547       +2     
==========================================
+ Hits         5824     5830       +6     
+ Misses        721      717       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

@matulni matulni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@thierry-martinez thierry-martinez merged commit 345ad59 into TeamGraphix:master Mar 16, 2026
24 checks passed
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.

3 participants