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

feat(python): Constructors, iterators, and other utility methods have been added to make working with ResultData, RegisterMap, and others easier. #342

Merged
merged 23 commits into from
Aug 29, 2023

Conversation

MarquessV
Copy link
Contributor

@MarquessV MarquessV commented Aug 10, 2023

This supports pyQuil#1630 by making it easier to construct and iterate over the result data types.

This does not change the return shape of qpu::api::retrieve_results. The target would be to construct a QpuResultData, but the data we need simply isn't available in that function to build it.

We could alternatively use the Executable struct, which has it's own workflow that already returns QpuResultData, but pyQuil's QAM is already workflow based and it's quite clunky to try and use one in the other.

I think it would be good to reconcile this before a v1.0 release, but this gets us passed the issue for now. In the end, this actually doesn't shove off too much to pyQuil.

TODO:

  • Add stubs after API approval
  • Figure out if we can better expose types for QPU/QVMResultData.asdict() Took a different approach.

crates/lib/src/execution_data.rs Show resolved Hide resolved
crates/python/src/execution_data.rs Show resolved Hide resolved
crates/python/src/execution_data.rs Outdated Show resolved Hide resolved
crates/python/src/execution_data.rs Show resolved Hide resolved
crates/python/src/execution_data.rs Show resolved Hide resolved
crates/python/src/execution_data.rs Show resolved Hide resolved
@MarquessV MarquessV marked this pull request as ready for review August 14, 2023 19:31
Copy link
Contributor

@Shadow53 Shadow53 left a comment

Choose a reason for hiding this comment

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

A few minor suggestions, but looks good overall

crates/python/src/execution_data.rs Outdated Show resolved Hide resolved
crates/python/src/execution_data.rs Outdated Show resolved Hide resolved
crates/python/src/qpu/result_data.rs Show resolved Hide resolved
crates/python/src/qpu/result_data.rs Show resolved Hide resolved
Copy link
Contributor

@BatmanAoD BatmanAoD left a comment

Choose a reason for hiding this comment

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

This looks reasonable to me. I've added lots of questions for my own edification, but I'm not sure any of them indicate a lack of sufficient comments or documentation so much as my own lack of context.

@MarquessV MarquessV merged commit 2166b80 into main Aug 29, 2023
2 checks passed
@MarquessV MarquessV deleted the pyquil-1630-support branch August 29, 2023 17:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants