Skip to content
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

Refactor reconstruct_expectation_values #391

Merged
merged 32 commits into from
Sep 8, 2023
Merged

Refactor reconstruct_expectation_values #391

merged 32 commits into from
Sep 8, 2023

Conversation

caleb-johnson
Copy link
Collaborator

@caleb-johnson caleb-johnson commented Aug 31, 2023

As a follow-up to #385 and in the larger effort associated with #363 , this PR refactors reconstruct_expectation_values to accept the outputs from the Sampler primitives directly (with the assumption that the metadata contains QPD bit information).

This PR will also refactor execute_experiments to output a data structure which can also be consumed by reconstruct_expectation_values. While this will be a breaking change, it will allow us to prevent an abrupt removal of a core function. Additionally, this breaking change actually results in returning more info to the user from execute_experiments. The user will now have the entire SamplerResult object(s), including the QPD bit information; whereas, before they only got the output quasi-dists and qpd bit info.

@caleb-johnson caleb-johnson changed the title Reconstruct Refactor reconstruct_expectation_values Aug 31, 2023
@garrison garrison added the cutting QPD-based circuit cutting code label Sep 1, 2023
@caleb-johnson caleb-johnson added this to the 0.4.0 milestone Sep 5, 2023
Copy link
Member

@garrison garrison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is looking pretty great already. Right now, it's a net loss of 13 lines 🎉. I will comb through it more carefully shortly.

Co-authored-by: Jim Garrison <garrison@ibm.com>
@caleb-johnson
Copy link
Collaborator Author

Thanks, this is looking pretty great already. Right now, it's a net loss of 13 lines 🎉. I will comb through it more carefully shortly.

Yes, and most of the added lines are documentation and tests; whereas, most of the removed lines are source code. Hooray

Co-authored-by: Jim Garrison <garrison@ibm.com>
Copy link
Member

@garrison garrison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks -- this looks great. Final tally: net addition of 23 lines, even when counting docstrings, new tests, and the release notes 🎉.

@caleb-johnson caleb-johnson merged commit 2d8ac11 into main Sep 8, 2023
@caleb-johnson caleb-johnson deleted the reconstruct branch September 8, 2023 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cutting QPD-based circuit cutting code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants