Add support for repeated keys in result protos#5907
Conversation
wcourtney
left a comment
There was a problem hiding this comment.
Overall LGTM, but I have a few small questions/comments to resolve.
| // | ||
| // 1. The results of the measurements produce a list of bits ordered by | ||
| // the round of repetition. | ||
| // the round of repetition and instance within a round. |
There was a problem hiding this comment.
I didn't notice any tests that confirm this behavior. Can you add them or point me to them? Thanks!
There was a problem hiding this comment.
I see tests that you can serialize and deserialize with the expected result, but not that the serialization follows the contract listed in this proto.
wcourtney
left a comment
There was a problem hiding this comment.
Overall LGTM % some more test comments :-). Approving since I'm out after today and you should have the gist.
| // | ||
| // 1. The results of the measurements produce a list of bits ordered by | ||
| // the round of repetition. | ||
| // the round of repetition and instance within a round. |
There was a problem hiding this comment.
I see tests that you can serialize and deserialize with the expected result, but not that the serialization follows the contract listed in this proto.
| assert isinstance(proto, v2.result_pb2.Result) | ||
| assert len(proto.sweep_results) == 2 | ||
| deserialized = v2.results_from_proto(proto, measurements) | ||
| assert len(deserialized) == 2 |
There was a problem hiding this comment.
Prefer to test behavior independently rather than rolling many separate assertions into one monolithic test.
go/unit-testing-practices#behavior-testing-examples
This is a first step toward supporting repeated keys in circuits run through quantum engine. I need to expand the tests to cover cases where instances > 1, but the main logic is ready for review.