diff --git a/.dep-versions b/.dep-versions index 27e8c1a3fc..5bf366b639 100644 --- a/.dep-versions +++ b/.dep-versions @@ -10,7 +10,7 @@ enzyme=v0.0.203 # For a custom PL version, update the package version here and at # 'doc/requirements.txt' -pennylane=0.44.0-dev44 +pennylane=0.44.0-dev48 # For a custom LQ/LK version, update the package version here and at # 'doc/requirements.txt' diff --git a/doc/releases/changelog-dev.md b/doc/releases/changelog-dev.md index b5bd6fcf44..afa5f07941 100644 --- a/doc/releases/changelog-dev.md +++ b/doc/releases/changelog-dev.md @@ -10,6 +10,11 @@ `catalyst.python_interface` namespace. [(#2199)](https://github.com/PennyLaneAI/catalyst/pull/2199) + * A new `catalyst.python_interface.inspection.mlir_specs` function has been added to facilitate + PennyLane's new pass-by-pass specs feature. This function returns information gathered by parsing + the xDSL generated by a given QJIT object, such as gate counts, measurements, or qubit allocations. + [(#2238)](https://github.com/PennyLaneAI/catalyst/pull/2238) + This functionality was originally developed as part of the PennyLane package, and has been migrated here. For earlier development notes to the feature, please refer to the [PennyLane release notes](https://docs.pennylane.ai/en/stable/development/release_notes.html#release-0-43-0). @@ -355,11 +360,6 @@

Internal changes ⚙️

-* A new `catalyst.python_interface.inspection.mlir_specs` method has been added to facilitate - PennyLane's new pass-by-pass specs feature. This function returns information gathered by parsing - the xDSL generated by a given QJIT object, such as gate counts, measurements, or qubit allocations. - [(#2238)](https://github.com/PennyLaneAI/catalyst/pull/2238) - * Resource tracking now writes out at device destruction time instead of qubit deallocation time. The written resources will be the total amount of resources collected throughout the lifetime of the execution. For executions that split work between multiple functions, diff --git a/doc/requirements.txt b/doc/requirements.txt index 4937e0d28f..fe60e0a4ae 100644 --- a/doc/requirements.txt +++ b/doc/requirements.txt @@ -33,4 +33,4 @@ lxml_html_clean --extra-index-url https://test.pypi.org/simple/ pennylane-lightning-kokkos==0.44.0-dev16 pennylane-lightning==0.44.0-dev16 -pennylane==0.44.0-dev44 +pennylane==0.44.0-dev48 diff --git a/frontend/test/pytest/python_interface/dialects/test_quantum_dialect.py b/frontend/test/pytest/python_interface/dialects/test_quantum_dialect.py index 50804ef462..ae08a07069 100644 --- a/frontend/test/pytest/python_interface/dialects/test_quantum_dialect.py +++ b/frontend/test/pytest/python_interface/dialects/test_quantum_dialect.py @@ -13,7 +13,6 @@ # limitations under the License. """Unit tests for the xDSL Quantum dialect.""" - import pytest # pylint: disable=wrong-import-position @@ -30,7 +29,7 @@ i1, ) from xdsl.dialects.test import TestOp -from xdsl.ir import AttributeCovT, OpResult +from xdsl.ir import AttributeCovT, Block, Operation, OpResult, Region from catalyst.python_interface.dialects import Quantum from catalyst.python_interface.dialects.quantum import ( @@ -115,7 +114,10 @@ def create_ssa_value(t: AttributeCovT) -> OpResult[AttributeCovT]: state = create_ssa_value(TensorType(ComplexType(Float64Type()), shape=(16,))) expected_ops_init_kwargs = { - "AdjointOp": {"qreg": qreg, "region": (CustomOp(gate_name="CNOT", in_qubits=(q0, q1)),)}, + "AdjointOp": { + "qreg": qreg, + "region": Region(Block((CustomOp(gate_name="CNOT", in_qubits=(q0, q1)),))), + }, "AllocOp": {"nqubits": 3}, "AllocQubitOp": {}, "ComputationalBasisOp": {"operands": (q0, None), "result_types": (obs,)}, @@ -203,7 +205,10 @@ def test_only_existing_operations_are_expected(): @pytest.mark.parametrize("op", all_ops) def test_operation_construction(op): """Test the constructors of operations in the Quantum dialect.""" - kwargs = expected_ops_init_kwargs[op.__name__] + kwargs = { + k: v.clone() if isinstance(v, (Operation, Region)) else v + for k, v in expected_ops_init_kwargs[op.__name__].items() + } _ = op(**kwargs) diff --git a/frontend/test/pytest/python_interface/inspection/test_mlir_graph.py b/frontend/test/pytest/python_interface/inspection/test_mlir_graph.py index 380fe6a9e5..e404099d07 100644 --- a/frontend/test/pytest/python_interface/inspection/test_mlir_graph.py +++ b/frontend/test/pytest/python_interface/inspection/test_mlir_graph.py @@ -14,6 +14,7 @@ """Unit test module for the MLIR graph generation in the Unified Compiler visualization module.""" from pathlib import Path +from subprocess import run import pytest @@ -22,6 +23,10 @@ xdsl = pytest.importorskip("xdsl") graphviz = pytest.importorskip("graphviz") +if run(["/usr/bin/which", "dot"], check=False).returncode != 0: + pytest.skip(reason="Graphviz isn't installed.") + + import pennylane as qml from catalyst.passes.xdsl_plugin import getXDSLPluginAbsolutePath