-
Notifications
You must be signed in to change notification settings - Fork 31
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
subexperiments associated with the identity Pauli observable should not be passed to Sampler #422
Comments
The way a user can hack around it without requiring any changes to CKT is to add a Pauli Z observable somewhere in the subsystem that is currently throwing an error with all identities. But even better would be not to run these experiments at all. I've had this in mind as one of the special cases at #262, but it looks like I failed to ever explicitly mention this there. I did mention it at #378 (comment), and I think the follow up at #387 is relevant to fixing this. I will also think if there's something we can do that doesn't involve breaking interfaces, which #387 would, technically. We could always write a helper function that elides calling the Sampler if there are no measurements, but then we're back to where we started: hiding the Sampler from the user. Alternatively, perhaps the sampler could be modified to have a flag that elides execution (rather than errors) if there are no measurements, but it would take time to get that integrated into all the Sampler implementations. |
Actually, automating this hack is probably the best way for us to "quick fix" this, too. We can modify The "better" fix is going to be to skip the circuit evaluation altogether, which will probably involve tweaking an interface and is related to the issues I linked above. |
) * Provide a workaround to #422, Sampler failing when no measurements * Add test for workaround to Issue #422. * Redo previous commit after running tox. * Fix tox error from previous build. * Fix tox error from last build. * Un-modify the metadata in a notebook With this, the current PR will touch one fewer file * Update test/cutting/test_cutting_roundtrip.py Co-authored-by: Jim Garrison <[email protected]> * Update test/cutting/test_cutting_roundtrip.py Co-authored-by: Jim Garrison <[email protected]> * black --------- Co-authored-by: Ibrahim <[email protected]> Co-authored-by: Ibrahim Shehzad <[email protected]>
) * Provide a workaround to #422, Sampler failing when no measurements * Add test for workaround to Issue #422. * Redo previous commit after running tox. * Fix tox error from previous build. * Fix tox error from last build. * Un-modify the metadata in a notebook With this, the current PR will touch one fewer file * Update test/cutting/test_cutting_roundtrip.py Co-authored-by: Jim Garrison <[email protected]> * Update test/cutting/test_cutting_roundtrip.py Co-authored-by: Jim Garrison <[email protected]> * black --------- Co-authored-by: Ibrahim <[email protected]> Co-authored-by: Ibrahim Shehzad <[email protected]> (cherry picked from commit f596307)
) (#436) * Provide a workaround to #422, Sampler failing when no measurements * Add test for workaround to Issue #422. * Redo previous commit after running tox. * Fix tox error from previous build. * Fix tox error from last build. * Un-modify the metadata in a notebook With this, the current PR will touch one fewer file * Update test/cutting/test_cutting_roundtrip.py Co-authored-by: Jim Garrison <[email protected]> * Update test/cutting/test_cutting_roundtrip.py Co-authored-by: Jim Garrison <[email protected]> * black --------- Co-authored-by: Ibrahim <[email protected]> Co-authored-by: Ibrahim Shehzad <[email protected]> (cherry picked from commit f596307) Co-authored-by: Jim Garrison <[email protected]>
We do not need to run circuits associated with the Identity observable, as the measurement readout is trivial.
Now, the cutting workflow in the tutorials will fail ungracefully when the subexperiments associated with the I observable are passed to the Sampler, as they do not contain any end-of-circuit measurements. Passing these circuits results in:
How do we handle this? Do we only return subexperiments which need actual measurement? If we do that, we'd need to extrapolate the trivial
I
measurements back into the final answer somehow.The text was updated successfully, but these errors were encountered: