-
Notifications
You must be signed in to change notification settings - Fork 5
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
Use QPY as exchange format #104
Conversation
This reverts commit 505fea3.
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.
Overall looks good.
I have some comments to double-check about potential cases in which we could receive a qasm
@@ -66,8 +67,8 @@ def transpile( | |||
|
|||
results = [] | |||
for transpile_resp in transpile_resps: | |||
if transpile_resp.get("success") and transpile_resp.get("qasm") is not None: | |||
results.append(QuantumCircuit.from_qasm_str(transpile_resp.get("qasm"))) | |||
if transpile_resp.get("success") and transpile_resp.get("qpy") is not None: |
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.
If we can send the circuits as qasm because of the fallback, couldn’t we receive the result in qasm format too?
if so, we should add it to this part of the method
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.
Good catch! I simplified the logic using deserialize_circuit_from_qpy_or_qasm()
function
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.
Excellent! Thanks
if transpile_resp.get("success") and transpile_resp.get("qasm") is not None: | ||
results.append(QuantumCircuit.from_qasm_str(transpile_resp.get("qasm"))) | ||
if transpile_resp.get("success") and transpile_resp.get("qpy") is not None: | ||
results.append(get_circuit_from_qpy(transpile_resp.get("qpy"))) |
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.
Same comment about qasm
if transpile_resp.get("success") and transpile_resp.get("qasm") is not None: | ||
results.append(QuantumCircuit.from_qasm_str(transpile_resp.get("qasm"))) | ||
if transpile_resp.get("success") and transpile_resp.get("qpy") is not None: | ||
results.append(get_circuit_from_qpy(transpile_resp.get("qpy"))) |
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.
Again
tests/test_transpiler_service.py
Outdated
@@ -409,6 +430,14 @@ def test_fix_ecr_qasm3(): | |||
assert isinstance(list(circuit_from_qasm)[0].operation, ECRGate) | |||
|
|||
|
|||
def test_fix_ecr_qpy(): |
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.
I’d say this is not needed with QPY
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.
You are right. Thank you!
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.
Thanks!
* Use QPY as exchange format * Fix tests * Fix tests for QuantumVolume * Add test to check wrong input circuits * Convert last tests that were using QASM * Add ecr test for qpy * Add fix to avoid random test errors * Revert "Add fix to avoid random test errors" This reverts commit 505fea3. * Add release notes * Accept only QuantumCircuit as input * Fix tests * Use QASM as fallback serialization format if QPY fails * Fix test_layout_construction_no_service * Fix code for Python 3.8 * Add testcase for qpy fallback * Code review suggestions
* Use QPY as exchange format * Fix tests * Fix tests for QuantumVolume * Add test to check wrong input circuits * Convert last tests that were using QASM * Add ecr test for qpy * Add fix to avoid random test errors * Revert "Add fix to avoid random test errors" This reverts commit 505fea3. * Add release notes * Accept only QuantumCircuit as input * Fix tests * Use QASM as fallback serialization format if QPY fails * Fix test_layout_construction_no_service * Fix code for Python 3.8 * Add testcase for qpy fallback * Code review suggestions
This reverts commit bd3bf1c.
* Use QPY as exchange format * Fix tests * Fix tests for QuantumVolume * Add test to check wrong input circuits * Convert last tests that were using QASM * Add ecr test for qpy * Add fix to avoid random test errors * Revert "Add fix to avoid random test errors" This reverts commit 505fea3. * Add release notes * Accept only QuantumCircuit as input * Fix tests * Use QASM as fallback serialization format if QPY fails * Fix test_layout_construction_no_service * Fix code for Python 3.8 * Add testcase for qpy fallback * Code review suggestions
* Use QPY as exchange format * Fix tests * Fix tests for QuantumVolume * Add test to check wrong input circuits * Convert last tests that were using QASM * Add ecr test for qpy * Add fix to avoid random test errors * Revert "Add fix to avoid random test errors" This reverts commit 505fea3. * Add release notes * Accept only QuantumCircuit as input * Fix tests * Use QASM as fallback serialization format if QPY fails * Fix test_layout_construction_no_service * Fix code for Python 3.8 * Add testcase for qpy fallback * Code review suggestions
Summary
Fixes #103
Details and comments