From 289cf039daa1bfb98be4ba2eadef921e813dd89b Mon Sep 17 00:00:00 2001 From: JerryChen97 Date: Thu, 23 Jan 2025 17:09:44 -0500 Subject: [PATCH 01/18] Adjust the usage of ControlledQubitUnitary in the test_decomposition.py file to match the new interface of the ControlledQubitUnitary op. --- frontend/test/pytest/device/test_decomposition.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/test/pytest/device/test_decomposition.py b/frontend/test/pytest/device/test_decomposition.py index bbb3a7ebbd..93e589fe1d 100644 --- a/frontend/test/pytest/device/test_decomposition.py +++ b/frontend/test/pytest/device/test_decomposition.py @@ -49,7 +49,7 @@ class TestGateAliases: qml.CRZ(0.1, wires=[0, 1]), qml.CRot(0.1, 0.2, 0.3, wires=[0, 1]), qml.ControlledPhaseShift(0.1, wires=[0, 1]), - qml.ControlledQubitUnitary([[1, 0], [0, 1j]], control_wires=1, wires=0), + qml.ControlledQubitUnitary([[1, 0], [0, 1j]], wires=[1, 0]), ) control_base_ops = ( qml.PauliX, From 12b19df204132aedbfea8aed5bef11c227c72316 Mon Sep 17 00:00:00 2001 From: JerryChen97 Date: Fri, 24 Jan 2025 10:31:49 -0500 Subject: [PATCH 02/18] changelog --- doc/releases/changelog-dev.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/releases/changelog-dev.md b/doc/releases/changelog-dev.md index 235ac08466..fb2966e252 100644 --- a/doc/releases/changelog-dev.md +++ b/doc/releases/changelog-dev.md @@ -14,6 +14,9 @@

Bug fixes 🐛

+* Adjusted `wires` parameter of `qml.ControlledQubitUnitary` to be positional and removed `control_wires`. In comparison, new `wires` is defined as `control_wires + (target_)wires`. + [(#1483)](https://github.com/PennyLaneAI/catalyst/pull/1483) + * Fixed `argnums` parameter of `grad` and `value_and_grad` being ignored. [(#1478)](https://github.com/PennyLaneAI/catalyst/pull/1478) @@ -48,6 +51,7 @@ This release contains contributions from (in alphabetical order): +Yushao Chen, Sengthai Heng, Christina Lee, Mehrdad Malekmohammadi, From db00a5799f319f6cf8e89804b50d7fc981750aac Mon Sep 17 00:00:00 2001 From: "Yushao Chen (Jerry)" Date: Fri, 24 Jan 2025 10:37:53 -0500 Subject: [PATCH 03/18] Update doc/releases/changelog-dev.md --- doc/releases/changelog-dev.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/doc/releases/changelog-dev.md b/doc/releases/changelog-dev.md index fb2966e252..1a7c3df7fc 100644 --- a/doc/releases/changelog-dev.md +++ b/doc/releases/changelog-dev.md @@ -14,9 +14,6 @@

Bug fixes 🐛

-* Adjusted `wires` parameter of `qml.ControlledQubitUnitary` to be positional and removed `control_wires`. In comparison, new `wires` is defined as `control_wires + (target_)wires`. - [(#1483)](https://github.com/PennyLaneAI/catalyst/pull/1483) - * Fixed `argnums` parameter of `grad` and `value_and_grad` being ignored. [(#1478)](https://github.com/PennyLaneAI/catalyst/pull/1478) From 482e498bdf7a924b33ee82dea919b8d8530a403a Mon Sep 17 00:00:00 2001 From: JerryChen97 Date: Fri, 31 Jan 2025 18:33:03 -0500 Subject: [PATCH 04/18] re-fmt --- benchmark/batchrun.py | 2 +- benchmark/benchmark.py | 2 +- benchmark/catalyst_benchmark/measurements.py | 2 +- .../test_cases/chemvqe_catalyst.py | 2 +- .../test_cases/chemvqe_pennylane.py | 2 +- .../test_cases/grover_catalyst.py | 2 +- .../test_cases/grover_pennylane.py | 2 +- .../catalyst_benchmark/test_cases/qft_catalyst.py | 2 +- .../catalyst_benchmark/test_cases/qft_pennylane.py | 2 +- benchmark/catalyst_benchmark/toplevel.py | 4 ++-- benchmark/catalyst_benchmark/types.py | 2 +- frontend/catalyst/_configuration.py | 6 +++--- frontend/catalyst/_version.py | 2 +- frontend/catalyst/jax_extras/__init__.py | 2 +- frontend/catalyst/jax_extras/lowering.py | 2 +- frontend/catalyst/jax_extras/patches.py | 2 +- frontend/catalyst/jax_extras/tracing.py | 2 +- frontend/catalyst/logging/__init__.py | 2 +- .../third_party/cuda/primitives/__init__.py | 14 ++++++++++++++ frontend/test/async_tests/test_async.py | 2 +- frontend/test/lit/test_device_api.py | 3 +-- frontend/test/lit/test_mlir_decomposition.py | 2 +- frontend/test/lit/test_peephole_optimizations.py | 2 +- frontend/test/lit/test_quantum_control.py | 2 +- frontend/test/pytest/test_adjoint.py | 3 +-- frontend/test/pytest/test_braket_local_devices.py | 3 +-- frontend/test/pytest/test_braket_remote_devices.py | 3 +-- frontend/test/pytest/test_buffer_args.py | 2 +- frontend/test/pytest/test_c_template.py | 3 +-- frontend/test/pytest/test_capture_integration.py | 3 +-- frontend/test/pytest/test_custom_devices.py | 3 +-- frontend/test/pytest/test_device_api.py | 3 +-- frontend/test/pytest/test_jvpvjp.py | 2 +- .../test/pytest/test_measurement_transforms.py | 3 +-- frontend/test/pytest/test_preprocess.py | 3 +-- frontend/test/pytest/test_split_multiple_tapes.py | 2 +- frontend/test/pytest/test_verification.py | 2 +- frontend/test/test_oqc/oqc/test_oqc_device.py | 3 +-- frontend/test/test_oqd/oqd/test_oqd_device.py | 3 +-- 39 files changed, 55 insertions(+), 53 deletions(-) diff --git a/benchmark/batchrun.py b/benchmark/batchrun.py index ff0803dc3a..4a7140039e 100644 --- a/benchmark/batchrun.py +++ b/benchmark/batchrun.py @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" Measurement cycle management entry point """ +"""Measurement cycle management entry point""" import sys from catalyst_benchmark.toplevel import ( diff --git a/benchmark/benchmark.py b/benchmark/benchmark.py index 43946a7fb3..ef35845025 100644 --- a/benchmark/benchmark.py +++ b/benchmark/benchmark.py @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" Single measurement entry point """ +"""Single measurement entry point""" import sys from argparse import ArgumentParser from json import dump as json_dump diff --git a/benchmark/catalyst_benchmark/measurements.py b/benchmark/catalyst_benchmark/measurements.py index 5eaa06e3f6..1b406b62b7 100644 --- a/benchmark/catalyst_benchmark/measurements.py +++ b/benchmark/catalyst_benchmark/measurements.py @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" This file contains a libraru of single value measurement procedures plus the self-checking +"""This file contains a libraru of single value measurement procedures plus the self-checking routine ensuring the numeric equivalence across similar problems.""" # pylint: disable=import-outside-toplevel diff --git a/benchmark/catalyst_benchmark/test_cases/chemvqe_catalyst.py b/benchmark/catalyst_benchmark/test_cases/chemvqe_catalyst.py index 93abbbcc6a..59469f8d12 100644 --- a/benchmark/catalyst_benchmark/test_cases/chemvqe_catalyst.py +++ b/benchmark/catalyst_benchmark/test_cases/chemvqe_catalyst.py @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" ChemVQE problem, PennyLane+Catalyst implementation """ +"""ChemVQE problem, PennyLane+Catalyst implementation""" # pylint: disable=too-many-instance-attributes # pylint: disable=no-value-for-parameter; It happens when we use Catalyst control-flow diff --git a/benchmark/catalyst_benchmark/test_cases/chemvqe_pennylane.py b/benchmark/catalyst_benchmark/test_cases/chemvqe_pennylane.py index 9796d1fc83..f816f78a60 100644 --- a/benchmark/catalyst_benchmark/test_cases/chemvqe_pennylane.py +++ b/benchmark/catalyst_benchmark/test_cases/chemvqe_pennylane.py @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" ChemVQE problem, PennyLane/PennyLane+JAX implementation """ +"""ChemVQE problem, PennyLane/PennyLane+JAX implementation""" # pylint: disable=import-outside-toplevel # pylint: disable=too-many-instance-attributes diff --git a/benchmark/catalyst_benchmark/test_cases/grover_catalyst.py b/benchmark/catalyst_benchmark/test_cases/grover_catalyst.py index 363286a50b..05f096d4e4 100644 --- a/benchmark/catalyst_benchmark/test_cases/grover_catalyst.py +++ b/benchmark/catalyst_benchmark/test_cases/grover_catalyst.py @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" Grover-like problem, PennyLane+Catalyst implementation """ +"""Grover-like problem, PennyLane+Catalyst implementation""" # pylint: disable=too-many-instance-attributes diff --git a/benchmark/catalyst_benchmark/test_cases/grover_pennylane.py b/benchmark/catalyst_benchmark/test_cases/grover_pennylane.py index c1d8a57ea0..487edffd55 100644 --- a/benchmark/catalyst_benchmark/test_cases/grover_pennylane.py +++ b/benchmark/catalyst_benchmark/test_cases/grover_pennylane.py @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" Grover-like problem, PennyLane/PennyLane+JAX implementation """ +"""Grover-like problem, PennyLane/PennyLane+JAX implementation""" # pylint: disable=import-outside-toplevel # pylint: disable=too-many-instance-attributes diff --git a/benchmark/catalyst_benchmark/test_cases/qft_catalyst.py b/benchmark/catalyst_benchmark/test_cases/qft_catalyst.py index 526f71247f..d72ca5ca8c 100644 --- a/benchmark/catalyst_benchmark/test_cases/qft_catalyst.py +++ b/benchmark/catalyst_benchmark/test_cases/qft_catalyst.py @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" ChemVQE problem, PennyLane+Catalyst implementation """ +"""ChemVQE problem, PennyLane+Catalyst implementation""" from dataclasses import dataclass diff --git a/benchmark/catalyst_benchmark/test_cases/qft_pennylane.py b/benchmark/catalyst_benchmark/test_cases/qft_pennylane.py index fb9d6cd1a7..25ad8580ec 100644 --- a/benchmark/catalyst_benchmark/test_cases/qft_pennylane.py +++ b/benchmark/catalyst_benchmark/test_cases/qft_pennylane.py @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" ChemVQE problem, PennyLane+Catalyst implementation """ +"""ChemVQE problem, PennyLane+Catalyst implementation""" from copy import deepcopy from dataclasses import dataclass diff --git a/benchmark/catalyst_benchmark/toplevel.py b/benchmark/catalyst_benchmark/toplevel.py index 1bb94a0978..4b854dddb7 100644 --- a/benchmark/catalyst_benchmark/toplevel.py +++ b/benchmark/catalyst_benchmark/toplevel.py @@ -11,8 +11,8 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" This file defines certain high-level routines, such as the data collection cycle, data loading -and the plotting. Measurement ranges and scales are all defined here as global dictionaries. """ +"""This file defines certain high-level routines, such as the data collection cycle, data loading +and the plotting. Measurement ranges and scales are all defined here as global dictionaries.""" import sys from argparse import ArgumentParser diff --git a/benchmark/catalyst_benchmark/types.py b/benchmark/catalyst_benchmark/types.py index fb4543b3cd..36de233bad 100644 --- a/benchmark/catalyst_benchmark/types.py +++ b/benchmark/catalyst_benchmark/types.py @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" Benchmarking data type definitions """ +"""Benchmarking data type definitions""" from argparse import SUPPRESS, Action from dataclasses import dataclass diff --git a/frontend/catalyst/_configuration.py b/frontend/catalyst/_configuration.py index 0e00bee2c3..3423ec276f 100644 --- a/frontend/catalyst/_configuration.py +++ b/frontend/catalyst/_configuration.py @@ -1,6 +1,6 @@ -""" When catalyst is packaged into a python wheel - the contents of this file will be overridden with: - INSTALLED = True +"""When catalyst is packaged into a python wheel +the contents of this file will be overridden with: +INSTALLED = True """ INSTALLED = False diff --git a/frontend/catalyst/_version.py b/frontend/catalyst/_version.py index 63e967ecef..09d547c17d 100644 --- a/frontend/catalyst/_version.py +++ b/frontend/catalyst/_version.py @@ -13,7 +13,7 @@ # limitations under the License. """Version information. - Version number (major.minor.patch[-label]) +Version number (major.minor.patch[-label]) """ __version__ = "0.11.0-dev21" diff --git a/frontend/catalyst/jax_extras/__init__.py b/frontend/catalyst/jax_extras/__init__.py index 013374ce96..00e32761db 100644 --- a/frontend/catalyst/jax_extras/__init__.py +++ b/frontend/catalyst/jax_extras/__init__.py @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" Catalyst additions to the Jax library """ +"""Catalyst additions to the Jax library""" from catalyst.jax_extras.lowering import custom_lower_jaxpr_to_module, jaxpr_to_mlir from catalyst.jax_extras.patches import ( diff --git a/frontend/catalyst/jax_extras/lowering.py b/frontend/catalyst/jax_extras/lowering.py index 53a13c0806..a6e0e10275 100644 --- a/frontend/catalyst/jax_extras/lowering.py +++ b/frontend/catalyst/jax_extras/lowering.py @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" Jax extras module containing functions related to the StableHLO lowering """ +"""Jax extras module containing functions related to the StableHLO lowering""" from __future__ import annotations diff --git a/frontend/catalyst/jax_extras/patches.py b/frontend/catalyst/jax_extras/patches.py index a798a09e42..89aad81bc1 100644 --- a/frontend/catalyst/jax_extras/patches.py +++ b/frontend/catalyst/jax_extras/patches.py @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" Jax extras module containing Jax patches """ +"""Jax extras module containing Jax patches""" # pylint: disable=too-many-arguments diff --git a/frontend/catalyst/jax_extras/tracing.py b/frontend/catalyst/jax_extras/tracing.py index a0588b52cb..7580ca7c57 100644 --- a/frontend/catalyst/jax_extras/tracing.py +++ b/frontend/catalyst/jax_extras/tracing.py @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" Jax extras module containing functions related to the Python program tracing """ +"""Jax extras module containing functions related to the Python program tracing""" # pylint: disable=line-too-long diff --git a/frontend/catalyst/logging/__init__.py b/frontend/catalyst/logging/__init__.py index e4b726c585..4668e8ff56 100644 --- a/frontend/catalyst/logging/__init__.py +++ b/frontend/catalyst/logging/__init__.py @@ -13,7 +13,7 @@ # limitations under the License. """ -Wrapper for PennyLane logging module. +Wrapper for PennyLane logging module. """ from pennylane.logging import debug_logger, debug_logger_init diff --git a/frontend/catalyst/third_party/cuda/primitives/__init__.py b/frontend/catalyst/third_party/cuda/primitives/__init__.py index 5c00100308..136fb2c086 100644 --- a/frontend/catalyst/third_party/cuda/primitives/__init__.py +++ b/frontend/catalyst/third_party/cuda/primitives/__init__.py @@ -29,6 +29,7 @@ class AbsCudaQState(jax.core.AbstractValue): "Abstract CUDA-quantum State." + hash_value = hash("AbsCudaQState") def __eq__(self, other): @@ -40,11 +41,13 @@ def __hash__(self): class CudaQState(cudaq.State): "Concrete CUDA-quantum state." + aval = AbsCudaQState class AbsCudaQbit(jax.core.AbstractValue): "Abstract CUDA-quantum qbit." + hash_value = hash("AbsCudaQbit") def __eq__(self, other): @@ -56,11 +59,13 @@ def __hash__(self): class CudaQbit(cudaq._pycudaq.QuakeValue): "Concrete CUDA-quantum qbit." + aval = AbsCudaQbit class AbsCudaQReg(jax.core.AbstractValue): "Abstract CUDA-quantum quantum register." + hash_value = hash("AbsCudaQReg") def __eq__(self, other): @@ -72,11 +77,13 @@ def __hash__(self): class CudaQReg(cudaq._pycudaq.QuakeValue): "Concrete CUDA-quantum quantum register." + aval = AbsCudaQReg class AbsCudaValue(jax.core.AbstractValue): "Abstract CUDA-quantum value." + hash_value = hash("AbsCudaValue") def __eq__(self, other): @@ -88,11 +95,13 @@ def __hash__(self): class CudaValue(cudaq._pycudaq.QuakeValue): "Concrete CUDA-quantum value." + aval = AbsCudaValue class AbsCudaKernel(jax.core.AbstractValue): "Abstract CUDA-quantum kernel." + hash_value = hash("AbsCudaKernel") def __eq__(self, other): @@ -104,11 +113,13 @@ def __hash__(self): class CudaKernel(cudaq._pycudaq.QuakeValue): "Concrete CUDA-quantum kernel." + aval = AbsCudaKernel class AbsCudaSampleResult(jax.core.AbstractValue): "Abstract CUDA-quantum kernel." + hash_value = hash("AbsCudaSampleResult") def __eq__(self, other): @@ -120,6 +131,7 @@ def __hash__(self): class CudaSampleResult(cudaq.SampleResult): "Concrete CUDA-quantum kernel." + aval = AbsCudaSampleResult @@ -137,6 +149,7 @@ def __hash__(self): class CudaSpinOperator(cudaq.SpinOperator): "Concrete CUDA-quantum spin operator." + aval = AbsCudaSpinOperator @@ -154,6 +167,7 @@ def __hash__(self): class CudaQObserveResult(cudaq.ObserveResult): "Concrete CUDA-quantum observe result." + aval = AbsCudaQObserveResult diff --git a/frontend/test/async_tests/test_async.py b/frontend/test/async_tests/test_async.py index 9c784db1fb..d5ae4bb026 100644 --- a/frontend/test/async_tests/test_async.py +++ b/frontend/test/async_tests/test_async.py @@ -322,7 +322,7 @@ def circuit3(params, x): # TODO: add the following diff_methods once issue #419 is fixed: # ("parameter-shift", "auto"), ("adjoint", "auto")] @pytest.mark.parametrize("diff_methods", [("finite-diff", "fd")]) -@pytest.mark.parametrize("inp", [(1.0)]) +@pytest.mark.parametrize("inp", [1.0]) def test_gradient_exception(inp, diff_methods, backend): """Parameter shift and finite diff generate multiple QNode that are run async.""" diff --git a/frontend/test/lit/test_device_api.py b/frontend/test/lit/test_device_api.py index d5ef002adb..e18814f179 100644 --- a/frontend/test/lit/test_device_api.py +++ b/frontend/test/lit/test_device_api.py @@ -16,8 +16,7 @@ # pylint: disable=line-too-long -"""Test for the device API. -""" +"""Test for the device API.""" import os import pathlib import platform diff --git a/frontend/test/lit/test_mlir_decomposition.py b/frontend/test/lit/test_mlir_decomposition.py index 2493edc6b6..d441e161e7 100644 --- a/frontend/test/lit/test_mlir_decomposition.py +++ b/frontend/test/lit/test_mlir_decomposition.py @@ -17,7 +17,7 @@ We check the transform jax primitives for each pass is correctly injected during tracing, and these transform primitives are correctly lowered to the mlir before -running -apply-transform-sequence. +running -apply-transform-sequence. """ # RUN: %PYTHON %s | FileCheck %s diff --git a/frontend/test/lit/test_peephole_optimizations.py b/frontend/test/lit/test_peephole_optimizations.py index 69d607bb18..cab06e0fa1 100644 --- a/frontend/test/lit/test_peephole_optimizations.py +++ b/frontend/test/lit/test_peephole_optimizations.py @@ -17,7 +17,7 @@ We check the transform jax primitives for each pass is correctly injected during tracing, and these transform primitives are correctly lowered to the mlir before -running -apply-transform-sequence. +running -apply-transform-sequence. """ # RUN: %PYTHON %s | FileCheck %s diff --git a/frontend/test/lit/test_quantum_control.py b/frontend/test/lit/test_quantum_control.py index 027c677498..df8988332e 100644 --- a/frontend/test/lit/test_quantum_control.py +++ b/frontend/test/lit/test_quantum_control.py @@ -13,7 +13,7 @@ # limitations under the License. # RUN: %PYTHON %s | FileCheck %s -""" Test the lowering cases involving quantum control """ +"""Test the lowering cases involving quantum control""" import os import pathlib diff --git a/frontend/test/pytest/test_adjoint.py b/frontend/test/pytest/test_adjoint.py index 2d37c7f8e5..8ecad99440 100644 --- a/frontend/test/pytest/test_adjoint.py +++ b/frontend/test/pytest/test_adjoint.py @@ -11,8 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -"""Unit tests for the Catalyst adjoint function. -""" +"""Unit tests for the Catalyst adjoint function.""" from functools import partial diff --git a/frontend/test/pytest/test_braket_local_devices.py b/frontend/test/pytest/test_braket_local_devices.py index 8dd4ddd154..8b17ff6ed8 100644 --- a/frontend/test/pytest/test_braket_local_devices.py +++ b/frontend/test/pytest/test_braket_local_devices.py @@ -12,8 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Unit tests for `OpenQasmDevice` on "local" Amazon Braket devices -""" +"""Unit tests for `OpenQasmDevice` on "local" Amazon Braket devices""" import numpy as np import pennylane as qml import pytest diff --git a/frontend/test/pytest/test_braket_remote_devices.py b/frontend/test/pytest/test_braket_remote_devices.py index e8e66c4680..90b23615b4 100644 --- a/frontend/test/pytest/test_braket_remote_devices.py +++ b/frontend/test/pytest/test_braket_remote_devices.py @@ -12,8 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Unit tests for `OpenQasmDevice` on "remote" Amazon Braket devices -""" +"""Unit tests for `OpenQasmDevice` on "remote" Amazon Braket devices""" import numpy as np import pennylane as qml import pytest diff --git a/frontend/test/pytest/test_buffer_args.py b/frontend/test/pytest/test_buffer_args.py index 2dabc9ab43..64a396e4b0 100644 --- a/frontend/test/pytest/test_buffer_args.py +++ b/frontend/test/pytest/test_buffer_args.py @@ -116,7 +116,7 @@ def identity(x): assert isinstance(identity(1.0), jax.Array) - @pytest.mark.parametrize("dtype", [(jnp.float16)]) + @pytest.mark.parametrize("dtype", [jnp.float16]) def test_types_which_are_unhandled(self, dtype): """Test that there's a nice error message when a function returns an f16.""" diff --git a/frontend/test/pytest/test_c_template.py b/frontend/test/pytest/test_c_template.py index 1fdb7b556f..61c1a8d896 100644 --- a/frontend/test/pytest/test_c_template.py +++ b/frontend/test/pytest/test_c_template.py @@ -12,8 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Unit tests for contents of c_template -""" +"""Unit tests for contents of c_template""" import numpy as np from catalyst.utils.c_template import CType, CVariable diff --git a/frontend/test/pytest/test_capture_integration.py b/frontend/test/pytest/test_capture_integration.py index 5f090b50a0..3bc273a49e 100644 --- a/frontend/test/pytest/test_capture_integration.py +++ b/frontend/test/pytest/test_capture_integration.py @@ -11,8 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -"""Integration tests for the the PL capture in Catalyst. -""" +"""Integration tests for the the PL capture in Catalyst.""" import jax.numpy as jnp import pennylane as qml import pytest diff --git a/frontend/test/pytest/test_custom_devices.py b/frontend/test/pytest/test_custom_devices.py index 5807d3097f..eaff09e496 100644 --- a/frontend/test/pytest/test_custom_devices.py +++ b/frontend/test/pytest/test_custom_devices.py @@ -11,8 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -"""Unit test for custom device integration with Catalyst. -""" +"""Unit test for custom device integration with Catalyst.""" import platform import pennylane as qml diff --git a/frontend/test/pytest/test_device_api.py b/frontend/test/pytest/test_device_api.py index 8136d04492..a9b6a03c9a 100644 --- a/frontend/test/pytest/test_device_api.py +++ b/frontend/test/pytest/test_device_api.py @@ -11,8 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -"""Test for the device API. -""" +"""Test for the device API.""" import platform import pennylane as qml diff --git a/frontend/test/pytest/test_jvpvjp.py b/frontend/test/pytest/test_jvpvjp.py index 1e87a29702..5c9f406233 100644 --- a/frontend/test/pytest/test_jvpvjp.py +++ b/frontend/test/pytest/test_jvpvjp.py @@ -11,7 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" Test JVP/VJP operation lowering """ +"""Test JVP/VJP operation lowering""" from typing import TypeVar diff --git a/frontend/test/pytest/test_measurement_transforms.py b/frontend/test/pytest/test_measurement_transforms.py index 997f82a947..717d65b185 100644 --- a/frontend/test/pytest/test_measurement_transforms.py +++ b/frontend/test/pytest/test_measurement_transforms.py @@ -11,8 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -"""Test for the device preprocessing. -""" +"""Test for the device preprocessing.""" # pylint: disable=unused-argument import os diff --git a/frontend/test/pytest/test_preprocess.py b/frontend/test/pytest/test_preprocess.py index 6e59184d1c..c5e126b698 100644 --- a/frontend/test/pytest/test_preprocess.py +++ b/frontend/test/pytest/test_preprocess.py @@ -11,8 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -"""Test for the device preprocessing. -""" +"""Test for the device preprocessing.""" import platform from dataclasses import replace diff --git a/frontend/test/pytest/test_split_multiple_tapes.py b/frontend/test/pytest/test_split_multiple_tapes.py index 2f32625189..e916e68a4d 100644 --- a/frontend/test/pytest/test_split_multiple_tapes.py +++ b/frontend/test/pytest/test_split_multiple_tapes.py @@ -13,7 +13,7 @@ # limitations under the License. """ -This file performs the frontend pytest checking that multi-tape transforms retain +This file performs the frontend pytest checking that multi-tape transforms retain correct funcitonality after splitting each tape into a separate function in mlir. """ diff --git a/frontend/test/pytest/test_verification.py b/frontend/test/pytest/test_verification.py index 6d1a979bae..210f7d7534 100644 --- a/frontend/test/pytest/test_verification.py +++ b/frontend/test/pytest/test_verification.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -""" Test program verification routines """ +"""Test program verification routines""" import platform from copy import deepcopy diff --git a/frontend/test/test_oqc/oqc/test_oqc_device.py b/frontend/test/test_oqc/oqc/test_oqc_device.py index 04c293188f..11e54c27a3 100644 --- a/frontend/test/test_oqc/oqc/test_oqc_device.py +++ b/frontend/test/test_oqc/oqc/test_oqc_device.py @@ -11,8 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -"""Test for the OQC device. -""" +"""Test for the OQC device.""" # pylint: disable=unused-argument,import-outside-toplevel,unused-import import pennylane as qml diff --git a/frontend/test/test_oqd/oqd/test_oqd_device.py b/frontend/test/test_oqd/oqd/test_oqd_device.py index fb1b27a05d..aee40d20c4 100644 --- a/frontend/test/test_oqd/oqd/test_oqd_device.py +++ b/frontend/test/test_oqd/oqd/test_oqd_device.py @@ -12,8 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -"""Tests for the OQD device. -""" +"""Tests for the OQD device.""" import pennylane as qml import pytest From aff86d7c9b10b32474e484339850d9998737e862 Mon Sep 17 00:00:00 2001 From: JerryChen97 Date: Fri, 31 Jan 2025 19:03:31 -0500 Subject: [PATCH 05/18] =?UTF-8?q?=1B[200~change=20dep=20v=20PL=2015=20->?= =?UTF-8?q?=2019~?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .dep-versions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dep-versions b/.dep-versions index 890552f258..509b9f947d 100644 --- a/.dep-versions +++ b/.dep-versions @@ -8,7 +8,7 @@ enzyme=v0.0.149 # For a custom PL version, update the package version here and at # 'doc/requirements.txt -pennylane=0.41.0-dev15 +pennylane=0.41.0-dev19 # For a custom LQ/LK version, update the package version here and at # 'doc/requirements.txt' From c12db3e0527517f9a5243a56d773a90f25795d42 Mon Sep 17 00:00:00 2001 From: JerryChen97 Date: Fri, 31 Jan 2025 19:12:57 -0500 Subject: [PATCH 06/18] latest --- .dep-versions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dep-versions b/.dep-versions index 509b9f947d..c0d4802f14 100644 --- a/.dep-versions +++ b/.dep-versions @@ -8,7 +8,7 @@ enzyme=v0.0.149 # For a custom PL version, update the package version here and at # 'doc/requirements.txt -pennylane=0.41.0-dev19 +pennylane=latest # For a custom LQ/LK version, update the package version here and at # 'doc/requirements.txt' From 3da79fafb30245677a7c362920d07eaebf78a84f Mon Sep 17 00:00:00 2001 From: JerryChen97 Date: Fri, 31 Jan 2025 19:19:58 -0500 Subject: [PATCH 07/18] try last time --- .dep-versions | 2 +- doc/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.dep-versions b/.dep-versions index c0d4802f14..8d1a353c99 100644 --- a/.dep-versions +++ b/.dep-versions @@ -8,7 +8,7 @@ enzyme=v0.0.149 # For a custom PL version, update the package version here and at # 'doc/requirements.txt -pennylane=latest +pennylane=git@github.com:PennyLaneAI/pennylane.git # For a custom LQ/LK version, update the package version here and at # 'doc/requirements.txt' diff --git a/doc/requirements.txt b/doc/requirements.txt index fa03963f0a..541135675c 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -32,4 +32,4 @@ lxml_html_clean --extra-index-url https://test.pypi.org/simple/ pennylane-lightning-kokkos==0.40.0 pennylane-lightning==0.40.0 -pennylane==0.41.0-dev15 +git@github.com:PennyLaneAI/pennylane.git From ec72792bbc70cf2fd60cba243aa8e083447576c0 Mon Sep 17 00:00:00 2001 From: JerryChen97 Date: Fri, 31 Jan 2025 19:24:00 -0500 Subject: [PATCH 08/18] forgot @master ... --- doc/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 541135675c..5367a7efcb 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -32,4 +32,4 @@ lxml_html_clean --extra-index-url https://test.pypi.org/simple/ pennylane-lightning-kokkos==0.40.0 pennylane-lightning==0.40.0 -git@github.com:PennyLaneAI/pennylane.git +git@github.com:PennyLaneAI/pennylane.git@master#egg=pennylane From b9ba009282636189ee039224caa50f1b232a0e82 Mon Sep 17 00:00:00 2001 From: JerryChen97 Date: Fri, 31 Jan 2025 19:27:06 -0500 Subject: [PATCH 09/18] @ -> + --- doc/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 5367a7efcb..b9102138d1 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -32,4 +32,4 @@ lxml_html_clean --extra-index-url https://test.pypi.org/simple/ pennylane-lightning-kokkos==0.40.0 pennylane-lightning==0.40.0 -git@github.com:PennyLaneAI/pennylane.git@master#egg=pennylane +git+https://github.com/PennyLaneAI/pennylane.git@master#egg=pennylane From 995a5deed8eb1debd4c66d010644349e6c6ce88a Mon Sep 17 00:00:00 2001 From: JerryChen97 Date: Fri, 31 Jan 2025 19:29:40 -0500 Subject: [PATCH 10/18] dep version --- .dep-versions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dep-versions b/.dep-versions index 8d1a353c99..c275084e6b 100644 --- a/.dep-versions +++ b/.dep-versions @@ -8,7 +8,7 @@ enzyme=v0.0.149 # For a custom PL version, update the package version here and at # 'doc/requirements.txt -pennylane=git@github.com:PennyLaneAI/pennylane.git +pennylane=git+https://github.com/PennyLaneAI/pennylane.git@master#egg=pennylane # For a custom LQ/LK version, update the package version here and at # 'doc/requirements.txt' From 98d7eb452bce9028b65d54269f561bd9bb9e4bfe Mon Sep 17 00:00:00 2001 From: JerryChen97 Date: Fri, 31 Jan 2025 19:33:40 -0500 Subject: [PATCH 11/18] quote? --- .dep-versions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dep-versions b/.dep-versions index c275084e6b..75f2d1328a 100644 --- a/.dep-versions +++ b/.dep-versions @@ -8,7 +8,7 @@ enzyme=v0.0.149 # For a custom PL version, update the package version here and at # 'doc/requirements.txt -pennylane=git+https://github.com/PennyLaneAI/pennylane.git@master#egg=pennylane +pennylane="git+https://github.com/PennyLaneAI/pennylane.git@master#egg=pennylane" # For a custom LQ/LK version, update the package version here and at # 'doc/requirements.txt' From 3d38a08ce9d42407b59349ebb641e0f20278129a Mon Sep 17 00:00:00 2001 From: JerryChen97 Date: Fri, 31 Jan 2025 19:37:19 -0500 Subject: [PATCH 12/18] pennylane at --- .dep-versions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dep-versions b/.dep-versions index 75f2d1328a..6692ed62b6 100644 --- a/.dep-versions +++ b/.dep-versions @@ -8,7 +8,7 @@ enzyme=v0.0.149 # For a custom PL version, update the package version here and at # 'doc/requirements.txt -pennylane="git+https://github.com/PennyLaneAI/pennylane.git@master#egg=pennylane" +pennylane="pennylane @ git+https://github.com/PennyLaneAI/pennylane.git@master#egg=pennylane" # For a custom LQ/LK version, update the package version here and at # 'doc/requirements.txt' From c3117f688d255f5f08e7a932d0422c3946d44446 Mon Sep 17 00:00:00 2001 From: JerryChen97 Date: Fri, 31 Jan 2025 19:42:24 -0500 Subject: [PATCH 13/18] rm pl= --- .dep-versions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dep-versions b/.dep-versions index 6692ed62b6..129e087f2d 100644 --- a/.dep-versions +++ b/.dep-versions @@ -8,7 +8,7 @@ enzyme=v0.0.149 # For a custom PL version, update the package version here and at # 'doc/requirements.txt -pennylane="pennylane @ git+https://github.com/PennyLaneAI/pennylane.git@master#egg=pennylane" +"pennylane @ git+https://github.com/PennyLaneAI/pennylane.git@master#egg=pennylane" # For a custom LQ/LK version, update the package version here and at # 'doc/requirements.txt' From 70233a2b556a52f40b6ec4013ba847caa260beda Mon Sep 17 00:00:00 2001 From: Alex Preciado Date: Sat, 1 Feb 2025 02:54:47 -0500 Subject: [PATCH 14/18] Update .dep-versions --- .dep-versions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dep-versions b/.dep-versions index 129e087f2d..509b9f947d 100644 --- a/.dep-versions +++ b/.dep-versions @@ -8,7 +8,7 @@ enzyme=v0.0.149 # For a custom PL version, update the package version here and at # 'doc/requirements.txt -"pennylane @ git+https://github.com/PennyLaneAI/pennylane.git@master#egg=pennylane" +pennylane=0.41.0-dev19 # For a custom LQ/LK version, update the package version here and at # 'doc/requirements.txt' From 936654fe7212f3ac7bbb5cba4add7ea339decbe9 Mon Sep 17 00:00:00 2001 From: Alex Preciado Date: Sat, 1 Feb 2025 02:54:55 -0500 Subject: [PATCH 15/18] Update doc/requirements.txt --- doc/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index b9102138d1..94e99ccd77 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -32,4 +32,4 @@ lxml_html_clean --extra-index-url https://test.pypi.org/simple/ pennylane-lightning-kokkos==0.40.0 pennylane-lightning==0.40.0 -git+https://github.com/PennyLaneAI/pennylane.git@master#egg=pennylane +pennylane==0.41.0-dev19 From a9db9729ef5214d187619f02b62948d7b19f1bdc Mon Sep 17 00:00:00 2001 From: Alex Preciado Date: Sat, 1 Feb 2025 03:30:42 -0500 Subject: [PATCH 16/18] Update .dep-versions --- .dep-versions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.dep-versions b/.dep-versions index 509b9f947d..83cd3f0603 100644 --- a/.dep-versions +++ b/.dep-versions @@ -8,7 +8,7 @@ enzyme=v0.0.149 # For a custom PL version, update the package version here and at # 'doc/requirements.txt -pennylane=0.41.0-dev19 +pennylane=0.41.0-dev20 # For a custom LQ/LK version, update the package version here and at # 'doc/requirements.txt' From 5d98aa97f0f16c16000911710fea69133a65ae2f Mon Sep 17 00:00:00 2001 From: Alex Preciado Date: Sat, 1 Feb 2025 03:30:50 -0500 Subject: [PATCH 17/18] Update doc/requirements.txt --- doc/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/requirements.txt b/doc/requirements.txt index 94e99ccd77..38963f051f 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -32,4 +32,4 @@ lxml_html_clean --extra-index-url https://test.pypi.org/simple/ pennylane-lightning-kokkos==0.40.0 pennylane-lightning==0.40.0 -pennylane==0.41.0-dev19 +pennylane==0.41.0-dev20 From 693324028c826c69a02a054f3f9cc758a9a8b71a Mon Sep 17 00:00:00 2001 From: Alex Preciado Date: Sat, 1 Feb 2025 03:52:23 -0500 Subject: [PATCH 18/18] Trigger rebuild