# Phase kickback

In quantum computing, phase kickback refers to the fact that controlled operations have effects on their controls, in addition to on their targets, and that these effects correspond to phasing operations.
In classical computing, operations are deterministic and reversible. However, in quantum computing, operations have the ability to introduce phase changes to quantum states. This is the basis for complex interference patterns and quantum entanglement. When a controlled operation, such as a Controlled NOT (CNOT) gate, is applied to two qubits, the phase of the second (target) qubit is conditioned on the state of the first (control) qubit. Because the phase of the second qubit is being “kicked back” to the first qubit, this phenomenon was coined “phase kickback” in 1997 by Richard Cleve, Artur Ekert, Chiara Macchiavello, and Michele Mosca through a paper that solved the Deustch-Josza problem.
For example, when a controlled NOT gate's target qubit is in the state $1/{\sqrt {2}}(|0\rangle -|1\rangle )$, the effect of the controlled NOT gate is equivalent to the effect of applying a Pauli Z gate to the controlled NOT's control qubit. Phase kickback is one of the key effects that distinguishes quantum computation from classical computation. Phase kickback also provides a justification for why qubits would be disrupted by measurements: a measurement is an operation that flips a classical bit (the result) with the flip being controlled by a quantum bit (the qubit being measured). This creates kickback from the bit to the qubit, randomizing the qubit's phase.
Phase kickback occurs because the basis transformations that distinguish targets from controls are available as operations. For example, surrounding a controlled NOT gate with four Hadamard gates produces a compound operation whose effect is equivalent to a controlled NOT gate, but with the roles of its control qubit and target qubit exchanged. More abstractly, phase kickback occurs because the eigendecomposition of controlled operations makes no significant distinction between controls and targets. For example, the controlled Z gate is a symmetric operation that has the same effect if its target and control are switched, and a controlled NOT gate can be decomposed into a Hadamard gate on its target, then a controlled Z gate, then a second Hadamard gate on its target. This decomposition reveals that, at the core of the apparently-asymmetric controlled-NOT gate, there is a symmetric effect that does not distinguish between control and target.
Phase kickback can be used to measure an operator $P$ whose eigenvalues are +1 and -1. This is a common technique for measuring operators in quantum error correcting codes, such as the surface code. The procedure is as follows. Initialize a control qubit $c$ in the $|0\rangle$ state, then apply a Hadamard gate $H$ to $c$, then apply $P$ controlled by $c$, then apply another Hadamard gate $H$ to $c$, then measure $c$ in the computational basis. Phase kickback results in the +1 eigenstates of $P$ having no effect on $c$, while -1 eigenstates apply a Pauli $Z$ to $c$. The surrounding Hadamard gates turn the Pauli $Z$ (a phase flip) into a Pauli $X$ (a bit flip). So $c$ gets flipped from $|0\rangle$ to $|1\rangle$ when the state is in the -1 eigenstate of $P$. The measurement operation reveals whether $c$ is $|0\rangle$ or $|1\rangle$, which reveals whether the state was in the +1 or -1 eigenspace of $P$.

## Requirements

Phase kickback requires the following conditions to be met:
* The control qubit(s) must be in a superposition. Otherwise, applying a controlled operation will only affect the global phase, which has no physical meaning and cannot change the physical qubit state. If the control qubit(s) are not in superposition, the following will occur:
$|1\rangle |\psi \rangle \xrightarrow {Controlled-U} |1\rangle U|\psi \rangle =|1\rangle e^{i\phi }\cong |1\rangle |\psi \rangle$ This shows that if the control qubit is not in a superposition, phase kickback will not occur and the output of the controlled operation will be equal to the input.
* $|\psi \rangle$ must be an eigenvector of controlled operator $U$. When $|\psi \rangle$ is an eigenvector of $U$, $U|\psi \rangle =e^{i\phi }|\psi \rangle$. At point B of the above circuit, the system will then have state ${\frac {|0\rangle |\psi \rangle +|1\rangle e^{i\phi }|\psi \rangle }{\sqrt {2}}}={\frac {|0\rangle +e^{i\phi }|1\rangle }{\sqrt {2}}}|\psi \rangle$. Now, $e^{i\phi }$ will be associated with the first qubit when this state is factored out into individual states (assuming the system is not entangled). From this, it can be seen that when $|\psi \rangle$ is an eigenvector of $U$, the control qubit is able to change by being multiplied by the phase while the target qubit remains unchanged.
* Operator $U$ must be used in a controlled way. In many examples, the operator $U$ is controlled by $|0\rangle$ or $|1\rangle$, but in reality, it can be any function of the control qubit. The operator must be applied in a controlled way; otherwise, if $U$ is applied unconditionally, only the global phase of the state would be changed. This produces a similar effect as when the control qubits are not in superposition, where applying $U$ appears to have no effect on the state.

## Applications
### Quantum Fourier Transform

Quantum Fourier Transform is the quantum analogue of the classical discrete Fourier transform (DFT), as it takes quantum states represented as superpositions of basis states, and utilizes phase kickback to transform them into frequency-domain representation.
The phase kickback phenomenon occurs in the QFT algorithm when a controlled phase rotation gate is applied to a qubit in superposition – the Fourier transform will take the output of the phase kickback state back to the initial control qubit.

### Quantum Phase Estimation

Quantum phase estimation (QPE) is a quantum algorithm that exploits phase kickback to efficiently estimate the eigenvalues of unitary operators. It is a crucial part of many quantum algorithms, including Shor’s algorithm, for integer factorization.
To estimate the phase angle corresponding to the eigenvalue $|\psi \rangle$ of a unitary operator $U$, the algorithm must:
* Prepare the input state $|\psi \rangle$ and an ancillary qubit in the $|+\rangle$ state
* Apply phase kickback through controlled operations using operator $U$ to the ancillary qubit. Phase kickback transfers the phase information from the eigenstates of $U$ to the state of the ancillary qubit.
* Perform an inverse quantum Fourier transform on the ancillary qubit.
* Measure the ancillary qubit to determine the phase corresponding to the eigenvalue of $U$.
Phase kickback allows a quantum setup to estimate eigenvalues exponentially quicker than classical algorithms. This is essential for quantum algorithms such as Shor’s algorithm, where quantum phase estimation is used to factor large integers efficiently.

### Deustch-Josza Algorithm

The Deustch-Josza algorithm, and by association the Bernstein-Vazirani algorithm, determines whether an inputted function is constant (same value for all inputs) or balanced (half 0s and half 1s) using as few queries to the black box function as possible. Phase kickback is critical; when the oracle is applied to the superposition state, it introduces phase kickback depending on whether the function is constant or balanced. If the function is constant, the oracle flips the sign of the amplitude of all input states, leading to constructive interference among all states. This allows a high probability of measuring the all-zero state. The flipping of signs of the input states requires phase kickback. On the other hand, when the function is balanced, the oracle does not introduce any phase kickback and the interference pattern among the states already cancels out as it is. This leads to an equal probability of measuring any of the input states.

### Grover's Algorithm

Grover’s algorithm is a quantum algorithm for unstructured search that finds the unique input to a black box function given its output. Phase kickback occurs in Grover's algorithm during the application of the oracle, which is typically a controlled operator that flips the sign of the target qubit's state. When this controlled operation is applied to the target qubit, the sign is flipped, and the phase of the target qubit is transferred backwards to the control qubit. In other words, the oracle can highlight certain target states by modifying the phase of the corresponding control qubit. This has impactful applications as a problem-solving tool, demonstration of performance advantages in quantum computing, and quantum cryptography.
As seen, phase kickback is a crucial step in many famous, powerful quantum algorithms and applications. Its ability to transfer states backwards also enables other concepts such as quantum error correction and quantum teleportation.