Closed fdmalone closed 1 month ago
Fixes #966
Related #978 (added ReflectionUsingPrepare auto doc.)
MultiControlPauli
supports cvs
so it shouldn't be very hard to add support for cvs
to ReflectionUsingPrepare
since we only need to control the MultiControlPauli
and the prepare / prepare^{\dagger} simply passes through. Do you want to do this right as part of this PR itself?
@tanujkhattar Is there a simple way to allow for multiple controls on the reflection (just updating control_val -> control_vals?) I wasn't sure of the significance of the control register which looks to be used for phasing if specified rather than just adding performing the control.
Yeah I'll do it now.
Basically, we could always just allocate a new qubit for a "phase target" and do MultiControlPauli(controls=reflection_controls + selection_controls, target=phase_target)
. The optimization to save an allocation when the control qubit is specified is really just a convenience method.
SGTM
MultiControlPauli
supportscvs
so it shouldn't be very hard to add support forcvs
toReflectionUsingPrepare
since we only need to control theMultiControlPauli
and the prepare / prepare^{\dagger} simply passes through. Do you want to do this right as part of this PR itself?
ehhh, this is getting complicated because ReflectionUsingPrepare is a SpecializedSingleQubitControlledGate. I wasn't following this too closely, is it much work to adapt this or should we merge and follow up?
An alternative could be adding an And gate + an ancilla and feed this into the reflection to keep things singly-controlled. WDYT @tanujkhattar
I think it's fine doing it as a follow up. We can merge this address the multi control in a follow up
Pulled from #998 and builds on #1002, removes the Reflection bloq (which was actually incorrect) in favour of ReflectionUsingPrepare. There's an open issue in that, some reflections in the chemistry bloqs are multiply controlled, but ReflectionUsingPrepare only allows a single control.
I added an intermediate identity prepare oracle as input for ReflectionUsingPrepare, which will also be needed for the $|G\rangle$ state (bloq) for block encodings.