-
Notifications
You must be signed in to change notification settings - Fork 13
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
Handle PrimitiveResult as result type #340
Conversation
@@ -525,11 +533,14 @@ def process_circuits( | |||
|
|||
qcs, ppcirc_strs = [], [] | |||
for tkc in batch_chunk: | |||
tkc1 = tkc.copy() | |||
# Flatten bits to default register in lexicographic order: |
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 solves the issue raised in this comment. There is still an issue with circuits having non-default classical register names, but this is an independent pre-existing issue and is not addressed in this PR.
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.
Just to make sure I understand: this does actually all work if pytket-qiskit
is used to submit and retrieve the circuit no matter what the classical registers are named. Of course if one separately submits a circuit with non-default classical register names and tries to retrieve it with pytket-qiskit
then there is an error... but that is indeed a different issue!
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.
Yes, it works unless you then want to call get_counts()
on the result with specific bits, using the cbits
parameter to get_counts
. In that case it will throw an error -- but that was already the case (separate issue).
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.
Thanks that makes sense!
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.
Have tested this by hitting IBM using this local branch and everything seems to work well for me! Did have one question but is for my understanding and doesn't affect the PR. Feel free to merge or wait for others more familiar with the code to take a look also.
@@ -525,11 +533,14 @@ def process_circuits( | |||
|
|||
qcs, ppcirc_strs = [], [] | |||
for tkc in batch_chunk: | |||
tkc1 = tkc.copy() | |||
# Flatten bits to default register in lexicographic order: |
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.
Just to make sure I understand: this does actually all work if pytket-qiskit
is used to submit and retrieve the circuit no matter what the classical registers are named. Of course if one separately submits a circuit with non-default classical register names and tries to retrieve it with pytket-qiskit
then there is an error... but that is indeed a different issue!
Description
We were assuming a
SamplerResult
. We still handle that case, though I don't know if it ever occurs.This PR supersedes #335 .
Related issues
Fixes #334 .
Checklist