Skip to content

Refactor simulator RNG handling#6944

Draft
justinpan0 wants to merge 2 commits into
quantumlib:mainfrom
justinpan0:random-number-generator-arg
Draft

Refactor simulator RNG handling#6944
justinpan0 wants to merge 2 commits into
quantumlib:mainfrom
justinpan0:random-number-generator-arg

Conversation

@justinpan0
Copy link
Copy Markdown
Contributor

Support both numpy RandomState and Generator for RNG handling in simulators #6567

@justinpan0
Copy link
Copy Markdown
Contributor Author

Updating the random number generation methods across various files in the cirq-core package to use the newer np.random.Generator instead of the older np.random.RandomState.

One small hack:

  1. For random_state.py, directly assigning RandomState._bit_generator could not yield the same result as Generator, even though the RandomState object is created with the same seed; instead I tried to get the RandomState's seed by the following line, and construct from there:
np.random.default_rng(random_state.get_state()[1][0])

Updates to random number generation:

@CirqBot CirqBot added the size: M 50< lines changed <250 label Jan 18, 2025
@justinpan0 justinpan0 force-pushed the random-number-generator-arg branch from c700603 to 8c7fe15 Compare January 22, 2025 03:35
@github-actions
Copy link
Copy Markdown

This pull request has been automatically labeled as stale because 90 days have passed without comments or other activity. If no further activity occurs and the status/stale label is not removed by a maintainer within 60 days, this pull request will be closed. If you would like to restore its active status, please leave a comment here; doing so will cause the staleness handler to remove the label.

If you have questions or feedback about this process, we welcome your input. You can open a new issue to let us know (please also reference this issue there, for continuity), or reach out to the project maintainers at quantum-oss-maintainers@google.com.

@github-actions github-actions Bot added status/stale Closed due to inactivity for an extended period of time and removed status/stale Closed due to inactivity for an extended period of time labels Apr 23, 2025
@NoureldinYosri
Copy link
Copy Markdown
Collaborator

thanks for starting this PR, do you still want to continue working on it?

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Sep 3, 2025

This pull request has been automatically labeled as stale because 90 days have passed without comments or other activity. If no further activity occurs and the status/stale label is not removed by a maintainer within 60 days, this pull request will be closed. If you would like to restore its active status, please leave a comment here; doing so will cause the staleness handler to remove the label.

If you have questions or feedback about this process, we welcome your input. You can open a new issue to let us know (please also reference this issue there, for continuity), or reach out to the project maintainers at quantum-oss-maintainers@google.com.

@github-actions github-actions Bot added status/stale Closed due to inactivity for an extended period of time and removed status/stale Closed due to inactivity for an extended period of time labels Sep 3, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 3, 2025

This pull request has been automatically labeled as stale because 90 days have passed without comments or other activity. If no further activity occurs and the status/stale label is not removed by a maintainer within 60 days, this pull request will be closed. If you would like to restore its active status, please leave a comment here; doing so will cause the staleness handler to remove the label.

If you have questions or feedback about this process, we welcome your input. You can open a new issue to let us know (please also reference this issue there, for continuity), or reach out to the project maintainers at quantum-oss-maintainers@google.com.

@github-actions github-actions Bot added status/stale Closed due to inactivity for an extended period of time and removed status/stale Closed due to inactivity for an extended period of time labels Dec 3, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 4, 2026

This pull request has been automatically labeled as stale because 90 days have passed without comments or other activity. If no further activity occurs and the status/stale label is not removed by a maintainer within 60 days, this pull request will be closed. If you would like to restore its active status, please leave a comment here; doing so will cause the staleness handler to remove the label.

If you have questions or feedback about this process, we welcome your input. You can open a new issue to let us know (please also reference this issue there, for continuity), or reach out to the project maintainers at quantum-oss-maintainers@google.com.

@github-actions github-actions Bot added status/stale Closed due to inactivity for an extended period of time and removed status/stale Closed due to inactivity for an extended period of time labels Mar 4, 2026
@mhucka
Copy link
Copy Markdown
Contributor

mhucka commented Apr 15, 2026

@justinpan0 Thank you for your efforts on this. For purposes of planning, could you let us know the status of this work?

@mhucka mhucka moved this to Waiting in Follow-up tracker Apr 15, 2026
@mhucka mhucka self-assigned this Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: M 50< lines changed <250

Projects

Status: Waiting

Development

Successfully merging this pull request may close these issues.

4 participants