← Back

Phase kickback: the hidden mechanism behind many quantum algorithms

A visual and mathematical introduction to phase kickback, the mechanism that turns quantum phases into useful information for many algorithms.

Phase KickbackDeutsch-Jozsa
Your first quantum application

Some concepts in quantum computing seem much stranger than they really are because we often first encounter them inside fairly complex algorithms. Phase kickback is one of them, and I have to admit that when I first came across it, I found it difficult to understand, at least at first.

The essential idea behind phase kickback is this: under certain conditions, a phase associated with an operation on a target qubit appears as a relative phase on the control qubit. We cannot observe that phase directly by measuring, but we can later transform that phase information into differences in probability that we can measure. In a way, by manipulating phases, we are manipulating the information represented by the qubits.

That may still sound unintuitive. Let’s take it apart as we would a piece of software we do not quite understand: first we isolate the smallest mechanism, observe what goes in and what comes out, and only then return to the complete system.

To follow what comes next, you will need some familiarity with the linear algebra of quantum computing and its basic concepts. For that, I recommend Robert S. Sutor’s book Dancing with Qubits.

Is it essential to understand phase kickback to be a Quantum Software Engineer?

As you may have seen in this article (and in others I have published so far), quantum computing is full of mathematical concepts (Dirac notation, eigenstates, global and relative phases, complex numbers, and so on), as well as purely quantum concepts such as phase kickback, entanglement, and others.

You may be wondering whether you really need to know all of this in detail to implement quantum algorithms.

In my opinion, a Quantum Software Engineer does not need to be an expert in all of these topics, but should have at least a basic understanding of them. It is like a classical software developer not knowing what a byte is or how information is stored on a hard drive, to give a simple example.

If your experience is anything like mine, you start out wanting to program a quantum solution and, little by little, follow the thread, discovering a world that I doubt anyone could ever fully understand in all its richness and depth. One concept leads to another, and the thread seems endless. For me, that is precisely what makes quantum computing increasingly interesting and rewarding.

Before we begin: a phase is not yet a result

A quantum state can be multiplied by a complex number with magnitude one without directly changing the probabilities of a measurement in the computational basis. For example:

∣ψ⟩↦eiϕ∣ψ⟩|\psi\rangle \mapsto e^{i\phi}|\psi\rangle

If the entire state vector is multiplied by the same factor, we call it a global phase. That phase does not change observable probabilities.

The interesting part appears with relative phases. Consider these two states:

∣+⟩=∣0⟩+∣1⟩2|+\rangle = \frac{|0\rangle+|1\rangle}{\sqrt{2}} ∣−⟩=∣0⟩−∣1⟩2|-\rangle = \frac{|0\rangle-|1\rangle}{\sqrt{2}}

If we measure either of them directly in the computational basis, we get 0 and 1 with equal probability. However, they are not the same state. The minus sign introduces a relative phase between the two amplitudes. A Hadamard gate lets us reveal the difference:

H∣+⟩=∣0⟩H|+\rangle=|0\rangle H∣−⟩=∣1⟩H|-\rangle=|1\rangle

This detail is fundamental. In a quantum algorithm, we do not need to “measure a phase” directly. We can make that phase participate in later interference and ultimately change probabilities that we can observe.

The simplest circuit

Let’s take two qubits. The first will be the control and the second the target. We prepare the control in a superposition:

∣+⟩=∣0⟩+∣1⟩2|+\rangle = \frac{|0\rangle+|1\rangle}{\sqrt{2}}

Now prepare the target in the state ∣1⟩|1\rangle. The joint state is then:

∣+⟩∣1⟩=12(∣0⟩∣1⟩+∣1⟩∣1⟩)|+\rangle|1\rangle= \frac{1}{\sqrt{2}}(|0\rangle|1\rangle+|1\rangle|1\rangle)

Now we apply a CNOT gate controlled by the first qubit. We know that X|1\rangle=|0\rangle, so the result would be an entangled state. But phase kickback is much clearer if we choose an eigenstate of the operator we are controlling as the target.

For X, one of its eigenstates is ∣−⟩|-\rangle:

X∣−⟩=−∣−⟩X|-\rangle=-|-\rangle

That minus sign is what matters. So instead, prepare:

∣+⟩∣−⟩|+\rangle|-\rangle

Before applying the CNOT, we can write this as:

12(∣0⟩∣−⟩+∣1⟩∣−⟩)\frac{1}{\sqrt{2}} \left(|0\rangle|-\rangle+|1\rangle|-\rangle\right)

The controlled operation does not apply X when the control is ∣0⟩|0\rangle, but it does when the control is ∣1⟩|1\rangle:

12(∣0⟩∣−⟩+∣1⟩X∣−⟩)\frac{1}{\sqrt{2}} \left(|0\rangle|-\rangle+|1\rangle X|-\rangle\right)

Since ∣−⟩|-\rangle is an eigenstate of X with eigenvalue −1-1:

12(∣0⟩∣−⟩−∣1⟩∣−⟩)\frac{1}{\sqrt{2}} \left(|0\rangle|-\rangle-|1\rangle|-\rangle\right)

We can factor out the second qubit:

∣0⟩−∣1⟩2⊗∣−⟩=∣−⟩∣−⟩\frac{|0\rangle-|1\rangle}{\sqrt{2}}\otimes|-\rangle = |-\rangle|-\rangle

And that is the whole mechanism. Applying X to the target qubit introduced a factor of −1-1, but when we rewrite the state, we see that this relative phase is now associated with the control qubit. It may seem mysterious, but it follows from quantum mechanics. The target also remains in its eigenstate.

Hence the name phase kickback: we can think of the phase as “kicking back” from the operation applied to the target to the control. It is a useful image, although mathematically no particle or information is traveling backward in time. We are simply rewriting the joint state after a controlled operation.

The general case

The example above is not unique to the X gate. Suppose we have a unitary operation UU and an eigenstate ∣u⟩|u\rangle such that:

U∣u⟩=eiϕ∣u⟩U|u\rangle=e^{i\phi}|u\rangle

If the control qubit is in a general superposition:

α∣0⟩+β∣1⟩\alpha|0\rangle+\beta|1\rangle

then, before the controlled operation, we have:

(α∣0⟩+β∣1⟩)∣u⟩(\alpha|0\rangle+\beta|1\rangle)|u\rangle

When we apply the controlled version of UU:

α∣0⟩∣u⟩+β∣1⟩U∣u⟩\alpha|0\rangle|u\rangle+ \beta|1\rangle U|u\rangle

Using the eigenstate property:

α∣0⟩∣u⟩+βeiϕ∣1⟩∣u⟩\alpha|0\rangle|u\rangle+ \beta e^{i\phi}|1\rangle|u\rangle

we can write this as:

(α∣0⟩+βeiϕ∣1⟩)∣u⟩(\alpha|0\rangle+\beta e^{i\phi}|1\rangle)|u\rangle

The phase eiϕe^{i\phi} associated with the eigenvalue of UU now appears as a relative phase on the control. This is phase kickback in its most general form.

And notice an important detail: the target state ∣u⟩|u\rangle is still the same. The interesting information is now encoded in the relative phase of the control, and that is the key to the whole idea.

If you come from software development, think of encoded information

For a software developer, it may be useful to set aside physical intuition for a moment and think in terms of representations of information.

In programming, we are used to the same data changing representation so that a later operation can use it. An integer can be converted into a string, a set of bits can be interpreted as a mask, and a data structure can be serialized before being sent over a network. The information does not disappear: its representation changes.

With all due caveats, something similar happens here. A phase by itself is not a classical bit that we can read. The circuit encodes it as a relative phase, and then we use other gates to turn that difference into amplitudes and, ultimately, into observable probabilities that yield the result we are looking for.

This way of thinking helps avoid a common misconception: a quantum algorithm is not useful simply because it “has many possibilities in superposition.” What matters is how it transforms and makes its amplitudes interfere so that the information we are looking for becomes accessible through a measurement.

Deutsch-Jozsa: phase as a messenger

Phase kickback appears in many well-known quantum algorithms, and Deutsch-Jozsa is no exception. Its oracle is usually expressed as an operation of the form:

Uf∣x⟩∣y⟩=∣x⟩∣y⊕f(x)⟩U_f|x\rangle|y\rangle=|x\rangle|y\oplus f(x)\rangle

If the second register is prepared in ∣−⟩|-\rangle, the oracle’s action can be written as:

Uf∣x⟩∣−⟩=(−1)f(x)∣x⟩∣−⟩U_f|x\rangle|-\rangle=(-1)^{f(x)}|x\rangle|-\rangle

The value of f(x)f(x) no longer needs to be stored as a 0 or a 1 in the second register. Instead, it appears as a phase (−1)f(x)(-1)^{f(x)} associated with the state ∣x⟩|x\rangle.

The Hadamard gates then make these amplitudes interfere. The algorithm uses the pattern of phases introduced by the oracle to distinguish, under the problem’s promise, between a constant function and a balanced one.

So when we see the second qubit prepared in ∣−⟩|-\rangle, it is not there because of some strange convention. It is deliberately prepared to turn the function evaluation into phase information.

Phase Estimation (QPE): taking the idea much further

Quantum Phase Estimation (QPE) makes this mechanism the centerpiece of the algorithm.

We start with a unitary operator and one of its eigenstates:

U∣u⟩=e2πiθ∣u⟩U|u\rangle=e^{2\pi i\theta}|u\rangle

The goal is to estimate θ\theta.

QPE uses several control qubits, on which controlled operations involving powers of UU are applied, such as UU, U2U^2, U4U^4, and so on. Thanks to phase kickback, these operations encode different powers of the phase in the control register:

e2πiθ,e2πi2θ,e2πi4θ,…e^{2\pi i\theta},\quad e^{2\pi i2\theta},\quad e^{2\pi i4\theta},\ldots

Next, the inverse quantum Fourier transform comes into play. It rearranges that phase information so that it can be recovered by measuring the control register.

This makes it clearer why phase kickback is more than a mathematical curiosity. It is a mechanism for encoding information about an operation’s eigenvalues in a register that we can process later.

Phase estimation is, in turn, an important conceptual component of other quantum algorithms. Understanding this mechanism helps us avoid treating them as an almost magical sequence of gates.

What to remember

If I had to reduce phase kickback to a single expression, it would be this:

U∣u⟩=eiϕ∣u⟩⟹CU:(α∣0⟩+β∣1⟩)∣u⟩↦(α∣0⟩+βeiϕ∣1⟩)∣u⟩U|u\rangle=e^{i\phi}|u\rangle \quad\Longrightarrow\quad CU: (\alpha|0\rangle+\beta|1\rangle)|u\rangle \mapsto (\alpha|0\rangle+\beta e^{i\phi}|1\rangle)|u\rangle

But learning the formula is not enough. What matters is understanding what it is telling us.

We have a controlled operation; the target is an eigenstate of that operation; when UU acts, that state only acquires its eigenvalue as a phase factor; and, because the operation is applied only in the branch where the control is ∣1⟩|1\rangle, that phase becomes relative between the control qubit’s branches.

Afterward, we can make it interfere and turn it into something measurable.

For someone used to programming, perhaps this is the most useful takeaway: in quantum computing, an essential part of an algorithm’s work is to choose where and how to encode information so that it can be recovered later. Sometimes it will be in computational basis states; at other times, in amplitudes; and in algorithms like the ones we have seen, it will be temporarily hidden in a phase.

Phase kickback stops seeming so mysterious when we look at it this way. It is not a property artificially added to the circuit. It follows directly from the algebra of controlled operations and eigenstates. Once you recognize it, you start seeing it behind many quantum circuits that previously seemed much harder to interpret.