-
Notifications
You must be signed in to change notification settings - Fork 617
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] StatePrep adjoint does not properly uncompute state #5099
Comments
Hi @anthonysmaldone, thanks for bringing this up! A few quick things to note:
|
small follow-up: as indicated in its docs, |
**Context:** Fixes this [bug](#5099) by adding a global phase to `qml.MottonenStatePreparation`. **Description of the Change:** **Benefits:** **Possible Drawbacks:** **Related GitHub Issues:** --------- Co-authored-by: Matthew Silverman <[email protected]>
Can we close this issue now? |
yep! fixed in #5166 |
Expected behavior
I expected that when I apply
StatePrep
to the ground state to prepare some arbitrary state, thatqml.adjoint(qml.StatePrep))
will return me back to ground state with a phase angle of 0.Actual behavior
The adjoint of
StatePrep
is off by a global.Additional information
I need to perform the adjoint of StatePrep while being controlled by an ancilla qubit, so the global phase offset manifests into a problem. Manually adding a phase gate that corrects the phase with respect to the number of negative amplitudes in original state works, but leaves the circuit un-batchable.
Functional example that does not allow batching:
Source code
Tracebacks
System information
Existing GitHub issues
The text was updated successfully, but these errors were encountered: