Skip to content

Commit

Permalink
version bump (#181)
Browse files Browse the repository at this point in the history
* version bump

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* Update CHANGELOG.md

* Can depend on PennyLane v0.20 again (only tests were affected by v0.21.0 related changes); correct

* jacobian expected

* make test_hermitian flaky

Co-authored-by: antalszava <[email protected]>
  • Loading branch information
Jaybsoni and antalszava authored Feb 7, 2022
1 parent 127dd76 commit d9cb1c7
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 13 deletions.
10 changes: 4 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# Release 0.21.0-dev

# Release 0.21.0

### New features since last release

* Add two devices for runtime programs and one VQE runtime program solver.
[(#157)](https://github.com/PennyLaneAI/pennylane-qiskit/pull/157)

### Breaking changes

### Improvements

Expand All @@ -15,13 +12,14 @@

### Documentation

### Bug fixes
* Improved the quality of docstrings in the library.
[(#174)](https://github.com/PennyLaneAI/pennylane-qiskit/pull/174)

### Contributors

This release contains contributions from (in alphabetical order):

Guillermo Alonso-Linaje, Romain Moyard, Tanner Rogalsky, Antal Száva
Guillermo Alonso-Linaje, Romain Moyard, Tanner Rogalsky, Jay Soni, Antal Száva

---

Expand Down
2 changes: 1 addition & 1 deletion pennylane_qiskit/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
Version number (major.minor.patch[-label])
"""

__version__ = "0.21.0-dev"
__version__ = "0.21.0"
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
qiskit>=0.32
mthree>=0.17.2
git+https://github.com/PennyLaneAI/pennylane.git
pennylane>=0.20
qiskit>=0.25
numpy
sympy
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
requirements = [
"qiskit>=0.25",
"mthree>=0.17",
"pennylane @ git+https://github.com/PennyLaneAI/pennylane.git",
"pennylane>=0.20",
"numpy",
"networkx>=2.2",
]
Expand Down
20 changes: 16 additions & 4 deletions tests/test_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -1114,9 +1114,21 @@ def circuit(a_val, b_val):

jac = qml.jacobian(circuit)(x, y)

jac_expected = [
[-np.sin(x + np.cos(y)), np.cos(x * y) * y],
[np.sin(x + np.cos(y)) * np.sin(y), np.cos(x * y) * x],
]
# Note: with v0.21.0, the behaviour of qml.jacobian changed. Branch
# based on the version number to ensure that the test case passes even
# with <v0.21.
if qml.__version__ < "0.21.0":

jac_expected = [
[-np.sin(x + np.cos(y)), np.sin(x + np.cos(y)) * np.sin(y)],
[np.cos(x * y) * y, np.cos(x * y) * x],
]

else:

jac_expected = [
[-np.sin(x + np.cos(y)), np.cos(x * y) * y],
[np.sin(x + np.cos(y)) * np.sin(y), np.cos(x * y) * x],
]

assert np.allclose(jac, jac_expected)
2 changes: 2 additions & 0 deletions tests/test_sample.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import pytest

import numpy as np
from flaky import flaky
import pennylane as qml

from pennylane_qiskit import AerDevice, BasicAerDevice
Expand Down Expand Up @@ -201,6 +202,7 @@ def test_pauliz_hadamard_pauliy(self, theta, phi, varphi, device, shots, tol):
) / 4
assert np.allclose(var, expected, **tol)

@flaky(max_runs=5, min_passes=3)
def test_hermitian(self, theta, phi, varphi, device, shots, tol):
"""Test that a tensor product involving qml.Hermitian works correctly"""
dev = device(3)
Expand Down

0 comments on commit d9cb1c7

Please sign in to comment.