Skip to content

[BUG] pyzx>=0.10 breaks ZX related transforms in pennylane==0.44Β #9185

@andrijapau

Description

@andrijapau

Expected behavior

PennyLane should be compatible with all versions of pyzx as per the documentation,

"The `pyzx` package is required. You can install it with `pip install pyzx`."

Actual behavior

Due to some breaking changes introduced recently in pyzx==0.10.0, any transform from the zx module will error out - unable to be used.

Additional information

These transforms work fine with pyzx<0.10.

Source code

import pennylane as qml
import pennylane.transforms.zx as zx

dev = qml.device("default.qubit")

@zx.reduce_non_clifford
@qml.qnode(dev)
def circuit(x, y):
    qml.T(0)
    qml.Hadamard(0)
    qml.Hadamard(0)
    qml.CNOT([0, 1])
    qml.T(0)
    qml.RX(x, 1)
    qml.RX(y, 1)
    return qml.state()

print(qml.draw(circuit)(3.2, -2.2))

Tracebacks

IndexError: list index out of range

System information

PL v0.44

Existing GitHub issues

  • I have searched existing GitHub issues to make sure the issue does not already exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions