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.
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
Speed up
random_circuit
#8983Speed up
random_circuit
#8983Changes from 1 commit
b351dfa
205c076
422af3a
8efbb6f
dfb07d3
a05a17f
4cad199
c3511a5
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the first time I've ever seen field dtypes used in practice before. I had completely forgotten you could even do this in numpy. This is a cool application for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I only very rarely use them. For posterity: the reasons for the choice here is that I wanted the most efficient access from
rng.choice
(which also maintains dtype in its output), and for the subsequent cumulative sums overnum_qubits
andnum_params
to have defined strides in their access patterns, so the Numpy vectorisation after therng
choice would all work as expected.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need a release note? In general, I don't think we hold any of our functionality to
seed
-reproducible output across different Terra verions (or numpy versions, platforms, etc.). It would be good to have canonical documentation one way or the other though.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have done in the past - we certainly did it for the switch of SabreSwap to Rust (and my intent was to write another of those notes when I break the RNG compat in my new version of Sabre too).
I'm approximately in favour of mentioning it in the release notes - we use seed stability in our tests (e.g. the
SabreLayout
tests), so it's not inconceivable that others are doing similar things.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I would agree we're not committed to ensuring seed stability across releases, but it's still good to document it as an upgrade note, especially for functions like this (and sabre) where the output is used for testing. Just to document it'll be different for users when they upgrade from the previous release to the new one. We have done release notes like this in the past for
random_circuit
too: https://qiskit.org/documentation/release_notes.html#release-notes-0-19-0-upgrade-notes (it's in there a bit down the list).