-
Notifications
You must be signed in to change notification settings - Fork 70
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 version 0.14 #65
Conversation
…or backend, adding test that an error is raised in such a case
Codecov Report
@@ Coverage Diff @@
## master #65 +/- ##
==========================================
- Coverage 99.09% 99.08% -0.01%
==========================================
Files 7 7
Lines 330 327 -3
==========================================
- Hits 327 324 -3
Misses 3 3
Continue to review full report at Codecov.
|
…as required by qiskit-terra
if self.backend_name == "unitary_simulator": | ||
raise QuantumFunctionError("The QubitStateVector operation is not supported on the unitary simulator backend.") | ||
|
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.
These lines were added as per this issue: Qiskit/qiskit-aer#497
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!
@@ -315,7 +318,8 @@ def rotate_basis(self, obs, wires, par): | |||
def pre_measure(self): | |||
for e in self.obs_queue: | |||
# Add unitaries if a different expectation value is given | |||
if hasattr(e, "return_type") and e.return_type == Sample: | |||
# Exclude unitary_simulator as it does not support memory=True | |||
if hasattr(e, "return_type") and e.return_type == Sample and self.backend_name != 'unitary_simulator': |
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.
"Backend support for memory=True now checked when that kwarg is passed. QiskitError results if not supported." - from the release notes of version 0.14.0
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 self.backend_name == "unitary_simulator": | ||
raise QuantumFunctionError("The QubitStateVector operation is not supported on the unitary simulator backend.") | ||
|
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!
@@ -315,7 +318,8 @@ def rotate_basis(self, obs, wires, par): | |||
def pre_measure(self): | |||
for e in self.obs_queue: | |||
# Add unitaries if a different expectation value is given | |||
if hasattr(e, "return_type") and e.return_type == Sample: | |||
# Exclude unitary_simulator as it does not support memory=True | |||
if hasattr(e, "return_type") and e.return_type == Sample and self.backend_name != 'unitary_simulator': |
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.
🤔
tests/test_apply.py
Outdated
@@ -68,6 +68,10 @@ class TestStateApply: | |||
def test_qubit_state_vector(self, init_state, device, tol): | |||
"""Test PauliX application""" | |||
dev = device(1) | |||
|
|||
if dev.backend_name == "unitary_simulator": | |||
pytest.skip("Test only runs for backends that are not the unitary simulator.") |
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.
Looks good! For maintainablity, I would suggest moving this into a fixture (e.g., skip_unitary
), and adding it to function arguments where it should be skipped.
@@ -1,3 +1,4 @@ | |||
qiskit>=0.12 | |||
PennyLane>=0.7.0 | |||
numpy | |||
networkx==2.3 |
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.
Note to self: "Pinning networkx version to 2.3 such that tests pass for Python 3.5 as required by qiskit-terra"
With Qiskit's new release, certain parts of PL-Qiskit need to be modified.
This PR further includes minor changes related to the series of creating new
QNodes
.An issue has been opened for Qiskit, as a wide range of tests is failing due to a modification on their end: https://github.com/Qiskit/qiskit-terra/issues/3619