QuantumLibraries icon indicating copy to clipboard operation
QuantumLibraries copied to clipboard

phases of FixedPointReflectionPhases

Open vivienlonde opened this issue 3 years ago • 0 comments

Describe the bug FixedPointReflectionPhases returns phases to amplify the <0| _ |0> block of a StateOracle whereas the Q# documentation states that a StateOracle encodes information in its <1| _ |0> block: StateOracle documentation

To Reproduce Here is a minimal not working example and a proposed fix : testFPAA

Expected behavior The AboutTarget phases should be the opposite of their current value - see testFPAA.

Screenshots FPAA_diagnostics

Additional context

  • It's a consistency issue between FixedPointReflectionPhases and the StateOracle type. Since other functions of the AmplitudeAmplification libraries (such as StandardAmplitudeAmplification and ObliviousAmplitudeAmplification) also use the <1| _ | 0> convention, I suggest to keep this convention and change the AboutTarget phases of FixedPointReflectionPhases. Indeed changing everything to the <0| _ | 0> convention would be more work and would be confusing for e.g. StandardAmplitudeAmplification.

  • Note that in the current implementation of FixedPointReflectionPhases, ReflectionPhases are computed from RotationPhases (see here). To find the transformation on RotationPhases that corresponds to taking the opposite of AboutTarget ReflectionPhases, it may be useful to think of RotationPhases as a kind of partial sums of ReflectionPhases (and therefore ReflectionPhases are a kind of discrete derivative of RotationPhases). See here for exact formulas.

vivienlonde avatar Aug 25 '22 11:08 vivienlonde