PennyLane is a cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry. Train a quantum computer the same way as a neural network.
The tape transform single_qubit_fusion always performs valid transforms, not changing the action of the tape.
Actual behavior
For the following specific case, the transform reports wrong angles. Having tracked this down to optimization_utils.fuse_rot_angles already, I just report the minimal example here:
As we can see, although only the RY rotation angles should cancel out, the RZ rotation caused by the first angle of angles1 also disappeared.
As far as my experiments went, this bug seems to appear for a whole range of values, but I was not able to track down for which exactly. Tested examples include:
Expected behavior
The tape transform
single_qubit_fusion
always performs valid transforms, not changing the action of the tape.Actual behavior
For the following specific case, the transform reports wrong angles. Having tracked this down to
optimization_utils.fuse_rot_angles
already, I just report the minimal example here:As we can see, although only the
RY
rotation angles should cancel out, theRZ
rotation caused by the first angle ofangles1
also disappeared. As far as my experiments went, this bug seems to appear for a whole range of values, but I was not able to track down for which exactly. Tested examples include:Additional information
No response
Source code
No response
Tracebacks
No response
System information
Existing GitHub issues