-
Notifications
You must be signed in to change notification settings - Fork 68
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
Qiskit v0.20 #101
Qiskit v0.20 #101
Conversation
Codecov Report
@@ Coverage Diff @@
## master #101 +/- ##
=======================================
Coverage 99.23% 99.23%
=======================================
Files 7 7
Lines 263 263
=======================================
Hits 261 261
Misses 2 2 Continue to review full report at Codecov.
|
@@ -812,16 +806,13 @@ def test_qasm_from_file(self, tmpdir, recorder): | |||
assert recorder.queue[5].parameters == [] | |||
assert recorder.queue[5].wires == Wires([3]) | |||
|
|||
assert len(record) == 11 | |||
assert len(record) == 5 |
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.
As far as I recall that the CU1Gate
was added at the time because it was the only gate that lacked the to_matrix
method. Hence it couldn't be converted.
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.
Nice! So it turns out the test was failing because the converter now works automatically for the CU1 gate 😆
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 think this looks fine @antalszava. Not exactly sure how removing the CU1Gate
impacts the tests, but it looks alright, and the tests seem to pass fine! 😄
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.
This is great, thanks @antalszava!
@thisac, I believe the CU1
gate is being automatically converted into a qml.QubitUnitary
gate, via the qiskit to_matrix()
method (which it previously didn't support, so a warning would be raised instead). As a result, the number of operations on the recorder increased, while the number of warning messages on the record
decreased.
@@ -812,16 +806,13 @@ def test_qasm_from_file(self, tmpdir, recorder): | |||
assert recorder.queue[5].parameters == [] | |||
assert recorder.queue[5].wires == Wires([3]) | |||
|
|||
assert len(record) == 11 | |||
assert len(record) == 5 |
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.
Nice! So it turns out the test was failing because the converter now works automatically for the CU1 gate 😆
with monkeypatch.context() as m: | ||
m.delenv("IBMQX_TOKEN", raising=False) | ||
IBMQDevice(wires=1) |
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.
🎉
CU1
gate in a test which tests for unsupported instructions. TheCU1
gate is now supported with Qiskit v0.20 and is converted using itsto_matrix
method andQubitUnitary
.IBMQX_TOKEN
environment variable in thetest_account_error
case (env var might be defined making the test fail)requirements.txt
andsetup.py