-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Add QkDag instruction appliers and getter to C API
#15313
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
Conversation
This adds `qk_dag_get_instruction` as a mirror to `qk_circuit_get_instruction` (unifying the code in anticipation of making it lower-allocation in the future), and the standard-instruction application functions `qk_dag_apply_measure`, `qk_dag_apply_barrier` and `qk_dag_apply_reset`. We're still missing `qk_dag_apply_unitary`, but that's for a different commit.
|
One or more of the following people are relevant to this code:
|
Pull Request Test Coverage Report for Build 19687548632Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Shobhit21287
left a comment
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.
Hi Jake, this looks good! Until we can represent operations generally, its good to have these as different function.
|
Shobit: thanks for doing the review! When you're submitted a PR review, there's a choice of three options for the review: "comment", "approve" and "request changes". If your review is saying "I think this is good to merge", you want to check the "approve" button instead of leaving it on "comment". (We don't usually use "request changes" - we just leave those as "comment" - because "request changes" puts an actual block on merge, and requires the same reviewer to come back and dismiss their stale review.) |
raynelfss
left a comment
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.
This functionally looks good to me, I saw a couple of things here and there when it came to documentation. And, assuming because of #15221 we won't be adding a release note here. So feel free to ping me once the documentation issues are solved.
| /// This must be cleared by a call to `qk_circuit_instruction_clear` to avoid leaking its | ||
| /// allocations. | ||
| /// | ||
| /// Panics if the operation name contains a nul, or if the instruction has non-float parameters. |
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.
Is this meant to be nul or is it a typo? It shows up later in the code so I'm assuming it's some meaning I don't know of, but in case it isn't.
| /// Panics if the operation name contains a nul, or if the instruction has non-float parameters. | |
| /// Panics if the operation name contains a null, or if the instruction has non-float parameters. |
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.
The ASCII \0 byte is referred to by both "nul" and "null" - the former comes from its three-letter short representation. We use nul elsewhere in the docs for it at the moment, so we might want to tidy up uniformly later.
Co-authored-by: Raynel Sanchez <[email protected]>
raynelfss
left a comment
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.
This looks good to me. There's a couple things in the documentation that could be improved upon though.
Co-authored-by: Raynel Sanchez <[email protected]>
This adds
qk_dag_get_instructionas a mirror toqk_circuit_get_instruction(unifying the code in anticipation of making it lower-allocation in the future), and the standard-instruction application functionsqk_dag_apply_measure,qk_dag_apply_barrierandqk_dag_apply_reset.We're still missing
qk_dag_apply_unitary, but that's for a different commit.Summary
Details and comments
Close #15193
Close #15311