Skip to content

Commit

Permalink
Merge branch 'master' into non-commuting-expanding-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
albi3ro authored May 7, 2024
2 parents e2ccb56 + 7e51d2b commit 5c64d10
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/stable/external.txt
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ packaging==24.0
pandocfilters==1.5.1
parso==0.8.4
pathspec==0.12.1
PennyLane-Catalyst==0.5.0
PennyLane_Lightning==0.35.1
PennyLane-Catalyst==0.6.0
PennyLane_Lightning==0.36.0
pexpect==4.9.0
pillow==10.3.0
platformdirs==4.2.0
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ on:
jobs:
tests:
uses: ./.github/workflows/interface-unit-tests.yml
secrets:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
with:
branch: ${{ github.ref }}

Expand Down
5 changes: 4 additions & 1 deletion doc/releases/changelog-0.36.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@
* Fixed a bug in `qml.math.kron` that makes Torch incompatible with NumPy.
[(#5540)](https://github.com/PennyLaneAI/pennylane/pull/5540)

* Fixes a bug in `_group_measurements` that fails to group measurements with commuting observables when they are operands of `Prod`.
* Fixed a bug in `_group_measurements` that fails to group measurements with commuting observables when they are operands of `Prod`.
[(#5525)](https://github.com/PennyLaneAI/pennylane/pull/5525)

* `qml.equal` can now be used with sums and products that contain operators on no wires like `I` and `GlobalPhase`.
Expand All @@ -887,6 +887,9 @@
between `op.has_diagonalzing_gates` and `op.diagonalizing_gates()`
[(#5603)](https://github.com/PennyLaneAI/pennylane/pull/5603)

* Updated the `method` kwarg of `qml.TrotterProduct().error()` to be more clear that we are computing upper-bounds.
[(#5637)](https://github.com/PennyLaneAI/pennylane/pull/5637)

<h3>Contributors ✍️</h3>

This release contains contributions from (in alphabetical order):
Expand Down
2 changes: 1 addition & 1 deletion pennylane/compiler/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

from semantic_version import Version

PL_CATALYST_MIN_VERSION = Version("0.5.0")
PL_CATALYST_MIN_VERSION = Version("0.6.0")


class CompileError(Exception):
Expand Down
6 changes: 6 additions & 0 deletions pennylane/ops/functions/dot.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ def dot(
:ref:`Pauli Graph Colouring<graph_colouring>` and :func:`~pennylane.pauli.group_observables`.
"""

for t in (Operator, PauliWord, PauliSentence):
if isinstance(ops, t):
raise ValueError(
f"ops must be an Iterable of {t.__name__}'s, not a {t.__name__} itself."
)

if len(coeffs) != len(ops):
raise ValueError("Number of coefficients and operators does not match.")
if len(coeffs) == 0 and len(ops) == 0:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"semantic-version>=2.7",
"autoray>=0.6.1",
"cachetools",
"pennylane-lightning>=0.35",
"pennylane-lightning>=0.36",
"requests",
"typing_extensions",
]
Expand Down
5 changes: 3 additions & 2 deletions tests/test_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def catalyst_incompatible_version():

@pytest.mark.usefixtures("catalyst_incompatible_version")
def test_catalyst_incompatible():
"""Test qjit with an incompatible Catalyst version < 0.4.0"""
"""Test qjit with an incompatible Catalyst version that's lower than required."""

dev = qml.device("lightning.qubit", wires=1)

Expand All @@ -54,7 +54,8 @@ def circuit():
return qml.state()

with pytest.raises(
CompileError, match="PennyLane-Catalyst 0.5.0 or greater is required, but installed 0.0.1"
CompileError,
match="PennyLane-Catalyst 0.[0-9]+.0 or greater is required, but installed 0.0.1",
):
qml.qjit(circuit)()

Expand Down

0 comments on commit 5c64d10

Please sign in to comment.