-
Notifications
You must be signed in to change notification settings - Fork 746
Open
Labels
bug 🐛Something isn't workingSomething isn't working
Description
Expected behavior
The pipeline of the QNode should not duplicate any expand transforms.
Actual behavior
When the pipeline is created, we automatically add the appropriate expand transform due to metric_tensor. However, when the pipeline is being called on the QNode, and we are processing it transform by transform, we end up adding another expand transform when processing metric_tensor.
Additional information
No response
Source code
pipeline = qml.transforms.merge_rotations + qml.metric_tensor
@pipeline
@qml.qnode(qml.device("default.qubit", wires=2))
def circuit():
return qml.expval(qml.Z(0))
print(circuit.compile_pipeline)Tracebacks
CompilePipeline(
[0] merge_rotations(),
[1] _expand_metric_tensor(), # DUPLICATE
[2] _expand_metric_tensor(device_wires=Wires([0, 1])),
[3] metric_tensor(device_wires=Wires([0, 1]))
)System information
PL v0.44Existing GitHub issues
- I have searched existing GitHub issues to make sure the issue does not already exist.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bug 🐛Something isn't workingSomething isn't working