Conversation
|
👋 Hey there! It looks like the changelog might need an update. Please take a moment to edit the
|
c325b14 to
c7a4b40
Compare
73d6dbb to
b1d48a2
Compare
|
Will need to release |
| ms(1.1,0,0) q[0], q[1]; | ||
| """, | ||
| "Invalid phase value", | ||
| ), | ||
| ( | ||
| """ | ||
| OPENQASM 3.0; | ||
| qubit[2] q; | ||
| ms(0,-1.5) q[0], q[1]; | ||
| ms(0,-1.5,0) q[0], q[1]; |
There was a problem hiding this comment.
If OpenQASM supports optional argument to gate definitions, we will want to test both including optional argument and not including it. And if a default value is required, it should be 0.25, not 0.
There was a problem hiding this comment.
Afaik, OpenQASM does not support optional args to gates.
- Either we have two gate definitions for
mswith distinct names or, - Stick to the max number of args and use
xin the arg which is not required such that the term using this arg vanishes when we providex.
Note that 0.25 might be a default for ionq but not for other providers which support ms gate.
There was a problem hiding this comment.
Summarizing our conversation about this and putting on record: I think we decided best approach was to add support for both a two and a three parameter ms gate in pyqasm, distinguishing between the two based on the include statement e.g. with a custom ionqnative.inc to signal 0.25 default
a968763 to
a8eb767
Compare
d69487c to
7d0b4c6
Compare
touch ups bump pyqasm
7d0b4c6 to
bbe7254
Compare
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
ryanhill1
left a comment
There was a problem hiding this comment.
rename_qasm_registers was removed with release 0.8.7 so you can take that function out. Additionally, need to satisfy the following code coverage which has dropped. There likely have been testing functions deleted that you may be able to reuse. Because all these had tests running previously
qbraid/passes/qasm/compat.py 117 13 89% 136, 159-160, 185, 195, 201-202, 213, 224-230
qbraid/passes/qasm/decompose.py 89 1 99% 245
qbraid/programs/gate_model/pytket.py 84 1 99% 112
qbraid/programs/gate_model/qasm3.py 55 4 93% 63, 87, 93, 98
qbraid/transpiler/conversions/cirq/cirq_quil_output.py 249 6 98% 366-367, 376-377, 386-387
qbraid/transpiler/conversions/openqasm3/openqasm3_to_ionq.py 107 10 91% 101-102, 148-149, 165-166, 193-194, 210, 248
qbraid/transpiler/conversions/qasm2/cirq_custom.py 73 13 82% 61-65, 123, 126-127, 147-151
qbraid/transpiler/conversions/qasm2/qasm2_to_qasm3.py 9 1 89% 32
6fb7ccc to
274447e
Compare
ryanhill1
left a comment
There was a problem hiding this comment.
These updates look great! It's getting super close. As of your latest commit, it still looks like we're missing ~21 lines of code coverage:
Name Stmts Miss Cover Missing
--------------------------------------------------------------------------------------------
qbraid/passes/qasm/compat.py 127 2 98% 222-223
qbraid/passes/qasm/decompose.py 91 1 99% 253
qbraid/programs/gate_model/pytket.py 84 1 99% 112
qbraid/transpiler/conversions/cirq/cirq_quil_output.py 249 6 98% 366-367, 376-377, 386-387
qbraid/transpiler/conversions/openqasm3/openqasm3_to_ionq.py 98 4 96% 102-103, 195, 233
qbraid/transpiler/conversions/qasm2/cirq_custom.py 73 7 90% 61-65, 126-127
--------------------------------------------------------------------------------------------
TOTAL 7004 21 99%I know it's annoying, but we need to meet that pytest standard before merging. Like I mentioned before, easiest way is probably just to look through the tests that have been deleted, find the ones that previously hit the lines that are now missing, and re-work them to fit the new format. Or, if you think it would be quicker to write new tests from scratch for this missed lines, that works too.
| ms(1.1,0,0) q[0], q[1]; | ||
| """, | ||
| "Invalid phase value", | ||
| ), | ||
| ( | ||
| """ | ||
| OPENQASM 3.0; | ||
| qubit[2] q; | ||
| ms(0,-1.5) q[0], q[1]; | ||
| ms(0,-1.5,0) q[0], q[1]; |
There was a problem hiding this comment.
Summarizing our conversation about this and putting on record: I think we decided best approach was to add support for both a two and a three parameter ms gate in pyqasm, distinguishing between the two based on the include statement e.g. with a custom ionqnative.inc to signal 0.25 default
|
Let's also bump project version to And also, could you describe in more detail the braket |
Okay, I requested re-review as I saw that codecov bot showed all modified lines are covered. Will add more tests! |
The braket |
|
@TheGupta2012 Yeah it's because |
Summary of changes
Changes to the
qbraid.passes.qasmanalyze.py,format.pyandunfold.pymodules and migrated functionality and respective tests topyqasmcompat.pyanddecompose.pyare kept as is, others moved topyqasmalong with the testsOpenQasm2ProgramandOpenQasm3Programclasses now use thepyqasmmethodsrebasemethod and corresponding tests are marked to be moved to thepyqasmmodule as part of the rebase PRChanges to the
qbraid.programsqbraid/programs/typer.pycatchespyqasmparsing exceptions and raises qbraid custom qasm exceptions. Relevant tests are updated.Updates to coverage for transpiler
MSgate in braket is not supported right now, due to a bug in implementation.