Open soranjh opened 3 months ago
I've implemented qml.PrepSelPrep
as a template, and set up some tests inspired by the tests for qml.Select
. It appears to be working correctly except for the differentiability tests.
I'd like some clarification. The function should be differentiable with respect to the LCU elements. In your example the LCU is built from qml.dot
which returns a type pennylane.ops.op_math.sum.Sum
, but autograd raises a type error saying that this type cannot be differentiated. Should qml.PrepSelPrep
take some other type as input? or am I misunderstanding the requirement?
@willjmax Thanks for working on this. Could you please open your PR and ask the question there. Please tag me as reviewer so I can see the PR as soon as it is open.
See PR #5756
Thanks.
Feature details
⚠️ This issue is part of an internal assignment and not meant for external contributors.
A linear combination of unitaries (LCU) can be block-encoded using Prepare and Select operators. Adding an operation to PennyLane that implements this algorithm will facilitate block-encoding LCU operators. The operation can be used in a quantum circuit as
Implementation
This demo provides details to construct the block encoding circuit.
The
qml.PrepSelPrep
operation should be implemented as a template and added to the subroutines module.Requirements
The
qml.PrepSelPrep
operation should correctly block-encode an LCU operation with positive and negative coefficients. Supporting imaginary coefficients is desired but not mandatory.The differentiability of the workflow should be tested with respect to the LCU elements with autograd and JAX. Optionally, the template should work with
jax.jit
.