-
Notifications
You must be signed in to change notification settings - Fork 121
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
feature: Add get_compiled_circuit convenience method #787
feature: Add get_compiled_circuit convenience method #787
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #787 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 129 129
Lines 8363 8372 +9
Branches 1862 1865 +3
=========================================
+ Hits 8363 8372 +9
☔ View full report in Codecov by Sentry. |
assert result_rigetti.get_compiled_circuit() == quil_program | ||
|
||
|
||
def test_get_compiled_circuit_oqc(result_oqc, qasm2_program): |
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.
nit: several of these tests/fixtures can be parametrized with pytest instead of duplicated
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.
It looks like I should be able to do something like this -- but afaiu parameter inputs can't be fixtures. Do you know how to do it, beyond accepting the fixture name as a string and looking up the function from it? If you have other more specific recommendations please let me know.
@pytest.mark.parametrize("result,program", [(result_rigetti, quil_program), (result_oqc, qasm2_program)])
def test_get_compiled_circuit(result, program):
"""Test get_compiled_circuit method."""
assert result.get_compiled_circuit() == program
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.
Updated the result fixtures to reduce duplicated code
Add
get_compiled_circuit
to GateModelQuantumTaskResultIssue #, if available:
Closes #780
Description of changes:
Proposed method:
For Rigetti and OQC tasks, this could be used instead of the method described here: https://docs.aws.amazon.com/braket/latest/developerguide/braket-compiled-circuits-inspecting.html
Testing done:
New unit tests, local testing with successful quantum tasks ran on hardware
Merge Checklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your pull request.General
Tests
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.