
Quantum Computing Algorithms
A small summary and collection of formulas for the module "Quantum Computing Algorithms"
In the lecture "Foundations of Quantum Computing", we learned the basic concepts of quantum computing, but we left the actual algorithms for the follow-up course "Quantum Computing Algorithms". The key idea behind many quantum algorithms is the use of phase oracles and amplitude amplification, which I found quite interesting. Below is a summary of these concepts, how they are applied in Grover's algorithm and the Formula Sheet I wrote as exam preparation.
For a Boolean function , a bit-flip oracle acts as:
At first glance this does not look very interesting: it writes the output into the second register by flipping it if . But here's the trick: if we use , it acts as:
This is a phase oracle. The output no longer appears on the second qubit, but as a relative phase factor on the first qubit.
This is incredibly useful for quantum algorithms, as it allows us to manipulate the phase of quantum states based on function evaluations.
The reason why the above works is due to the property of the state. It is called phase kickback.
Remember the polar states are defined as:
They are eigenstates of the Pauli-X operator. It acts on them as follows:
This follows a general phenomenon in quantum mechanics: If a qubit is in an eigenstate of an operator, applying that operator only changes the state by a phase factor (the eigenvalue). If a control qubit is in a superposition and the target qubit is in an eigenstate of the operator being controlled, the eigenvalue is transferred back as a relative phase on the control qubit.
This is why using as the auxiliary register in lets us get applied to : the eigenvalue from the operation on has been "kicked back" to the input register.
Grover’s algorithm is a quantum search method. Imagine searching through possible items to find one marked item . Classically, we’d need queries to the function that checks whether . Grover’s algorithm reduces this to only queries by using the phase oracle idea.
In practice, Grover’s algorithm is also useful for SAT problems or any situation where we need to find such that .
The idea behind the algorithm is that we can use an oracle to mark the correct solution(s) with a negative phase. If we then reflect all amplitudes about their mean, the marked states will have their amplitudes amplified, while the others are suppressed. Repeating this process a few times will make measuring the correct state very likely. Classically, this would take queries, but Grover's algorithm can do it in queries.
First, we apply Hadamard gates to all qubits to create a uniform superposition:
This ensures equal amplitude for all possible states.
The oracle then flips the sign of the marked state using a phase oracle, where is the marked item:
This is equivalent to multiplying by and leaving all other states unchanged.
This may seem silly because to construct we would need to know and would have already solved our problem. In practice, we use a black-box phase oracle that can evaluate without revealing directly.
To reflect about the mean, we use the diffusion operator:
We can construct it using Hadamard gates:
If we put the previous two steps together, we can define the Grover iteration operator:
Each iteration amplifies the amplitude of while suppressing others.
It's helpful to see this as a rotation in a 2D subspace: one axis is the marked state , the other is the uniform superposition of all unmarked states.
Let be the angle between and . Initially, the amplitude of in is:
The state vector rotates by angle each iteration. After iterations, the overlap with the marked subspace is . Therefore, the success probability is
This oscillates, so it is crucial to choose the right number of iterations.
From the above formula, we can infer that the probability of measuring is maximized when:
where is the number of marked solutions.

Feel free to leave your opinion or questions in the comment section below.