-
Notifications
You must be signed in to change notification settings - Fork 4
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
Expose hardware prng sequence #515
Expose hardware prng sequence #515
Conversation
05c6136
to
276ea18
Compare
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.
Partial review, will do more later.
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.
Looking good, about ready to approve. I'm as uneasy as before about merging this experimental utility into the SDK itself, but it's the best option we have at the moment because of python binding & distribution. Your take here is neat, compartmentalized, and tested.
Things I'd like to see before merge:
- A module doc as a general explainer about what's going on here. Doesn't have to specify a higher-level application but should give some context - as it is, I think almost any user might miss the point here.
- A trustworthy explainer link for LFSR for context
- A Rust e2e example under
examples
since it would require live QPU access
Thinking ahead: I'm also wondering if "program builder" or "program operator" is going to be a common pattern going forward and what that might look like. Doesn't block this PR, but I do wonder if a trait might help conceptually group tools like this in the mind of a user and help them understand how they're used:
trait ProgramOperator {
fn apply(&self, program: Program) -> Result<Program, Self::Error> {
...
}
}
67e1b37
to
33af34c
Compare
|
It's actually kind of difficult to find a concise and effective summary of LFSR that is not Wikipedia. If we want to avoid linking Wikipedia,: https://pylfsr.github.io/ may be our best best.
|
6eb7a7b
to
3e4776b
Compare
I've decided to separate out the random module from the randomized measurements. The latter is more feature complete, but the research thrust here does not strictly require it. If we want to extend support for that feature we can merge #536 . |
This PR supports two new features:
CALL choose_random_real_sub_regions
instruction.RandomizedMeasurement
struct / class that will add per-shot randomized measurements to a program, as well as support the client in ascertaining which random unitary was played on each qubit per shot.The documentation should stand on its own here. One note, I've put all of this functionality into
qpu/experimental
(both in Rust and Python). It is experimental both in the sense that it is an experimental feature in the QCS SDK that should not be considered stable as well as in the sense that it supports features relevant to QIS experimentalists.Review Guidance:
crates/lib/src/qpu/experimental/random.rs
.crates/lib/src/qpu/experimental/randomized_measurements.rs
measurements builds off the primitives defined in the file above.crates/python/qcs_sdk/qpu/experimental.pyi
. Their implementation is defined incrates/python/src/qpu/experimental.pyi
.crates/lib/src/qpu/experimental/randomized_measurements.rs
andcrates/python/tests/qpu/test_experimental.py
.