You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The main culprit is that pyzx is working with exact fractions whereas pennylane works with float numbers.
In many cases, a proper translation in qml.transforms.to_zx is provided, but some are missing and causing problems.
adjoint ops are not properly translated
def qfunc():
qml.T(0)
qml.adjoint(qml.T(0))
import pyzx as zx
g = qml.transforms.to_zx(qfunc)()
zx.draw(g)
We see the first bare T gate is properly translated to a Z_pi/4 spider, but its adjoint is not.
This makes retrieving the PL circuit impossible:
>>> qml.transforms.from_zx(g)
(..)
AttributeError: 'float' object has no attribute 'denominator'
This is a problem because decompositions of e.g. Toffoli gates contain adjoint T and S gates.
The text was updated successfully, but these errors were encountered:
The main culprit is that pyzx is working with exact fractions whereas pennylane works with float numbers.
In many cases, a proper translation in qml.transforms.to_zx is provided, but some are missing and causing problems.
adjoint ops are not properly translated
We see the first bare T gate is properly translated to a Z_pi/4 spider, but its adjoint is not.
This makes retrieving the PL circuit impossible:
This is a problem because decompositions of e.g. Toffoli gates contain adjoint T and S gates.
The text was updated successfully, but these errors were encountered: