Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .dep-versions
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
10 changes: 5 additions & 5 deletions doc/releases/changelog-dev.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -355,11 +360,6 @@

<h3>Internal changes ⚙️</h3>

* 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,
Expand Down
2 changes: 1 addition & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.

"""Unit tests for the xDSL Quantum dialect."""

import pytest

# pylint: disable=wrong-import-position
Expand All @@ -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 (
Expand Down Expand Up @@ -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,)},
Expand Down Expand Up @@ -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)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down