catalyst.passes.decompose_arbitrary_ppr

decompose_arbitrary_ppr(qnode)[source]

Specify that the MLIR compiler pass for decomposing arbitrary Pauli product rotations (PPR) operations will be applied. This will decompose into a collection of PPRs, PPMs and a single-qubit arbitrary PPR in the Z basis. For more details, see Figure 13(d) in arXiv:2211.15465.

Note

For improved integration with the PennyLane frontend, including inspectability with pennylane.specs(), please use pennylane.transforms.decompose_arbitrary_ppr().

The decompose_arbitrary_ppr compilation pass requires that to_ppr() be applied first.

Parameters:

qnode (QNode) – QNode to apply the pass to.

Returns:

QNode

Example

import pennylane as qml
import catalyst

p = [("my_pipe", ["quantum-compilation-stage"])]

@qml.qjit(pipelines=p, target="mlir")
@catalyst.passes.decompose_arbitrary_ppr
@catalyst.passes.to_ppr
@qml.qnode(qml.device("null.qubit", wires=3))
def circuit():
    qml.PauliRot(0.123, pauli_word="XXY", wires=[0, 1, 2])
    return qml.probs()
>>> print(circuit.mlir_opt)

Example MLIR excerpt (structure only):