Skip to content
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

Merged
merged 10 commits into from
Dec 20, 2019
Merged

Qiskit version 0.14 #65

merged 10 commits into from
Dec 20, 2019

Conversation

antalszava
Copy link
Contributor

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

@antalszava antalszava added the WIP label Dec 16, 2019
@josh146 josh146 added the bug Something isn't working label Dec 16, 2019
…or backend, adding test that an error is raised in such a case
@codecov
Copy link

codecov bot commented Dec 20, 2019

Codecov Report

Merging #65 into master will decrease coverage by <.01%.
The diff coverage is 100%.

@@            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
Impacted Files Coverage Δ
pennylane_qiskit/ibmq.py 100% <100%> (ø) ⬆️
pennylane_qiskit/qiskit_device.py 98.62% <100%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a569e99...cf02df2. Read the comment docs.

Comment on lines +208 to +210
if self.backend_name == "unitary_simulator":
raise QuantumFunctionError("The QubitStateVector operation is not supported on the unitary simulator backend.")

Copy link
Contributor Author

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

Copy link
Member

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':
Copy link
Contributor Author

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

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔

Comment on lines +208 to +210
if self.backend_name == "unitary_simulator":
raise QuantumFunctionError("The QubitStateVector operation is not supported on the unitary simulator backend.")

Copy link
Member

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':
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔

@@ -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.")
Copy link
Member

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.

@antalszava antalszava merged commit 95dcaf8 into master Dec 20, 2019
@antalszava antalszava deleted the qiskit_version_0_14 branch December 20, 2019 23:05
@@ -1,3 +1,4 @@
qiskit>=0.12
PennyLane>=0.7.0
numpy
networkx==2.3
Copy link
Contributor Author

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working WIP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants