...

/

Time Complexity Analysis - Grover

Time Complexity Analysis - Grover

Let’s learn why Grover's Algorithm runs in O(sqrt(N)) time.

This is going to be a geometric proof to show that the number of Grover iterations we must do to achieve a high probability of measuring the winner state is bounded by O(N)O(\sqrt{N}).

Equal superposition

We will carry forward what we’ve learned from the past lessons and start with the situation where some arbitrary state x|x\rangle could be measured from the superposition, and it lies in between w|w\rangle and E|E\rangle in the state space. The x|x'\rangle state is orthogonal to w|w\rangle and the angle between x|x'\rangle and E|E\rangle is Δ\Delta

Reflecting about the w|w\rangle state

The state x|x\rangle makes an angle θ\theta with the w|w\rangle, upon reflection about the w|w\rangle state, our new state x1|x_1\rangle would end up with the same angle but on the opposite side.

Reflecting about the E|E\rangle state

If we denote the angle between E|E\rangle and x|x\rangle as ϕ\phi then after this reflection, our new state x2|x_2\rangle would have an angle of 2θ+ϕ2\theta+\phi with E|E\rangle. Using all the information we have gathered so far, we need to focus on finding the angle between our final state and the original state.

Take a look at the upper half (first and second quadrants) of the diagram given below, the sum of the angles should be equal to π\pi radians.

2ϕ+2θ+2Δ=π2\phi + 2\theta + 2 \Delta = \pi

Let’s have a look at x2-|x_2\rangle because that’s essentially the same state (ignoring global phase, the 1-1 sign), which is now closer to w|w\rangle. Remember that this state is simply in the opposite direction. Geometrically, the angle between x2|x_2\rangle and x2-|x_2\rangle will be π\pi radians.

We already know from our previous step that:

π=2ϕ+2θ+2Δ\pi = 2\phi + 2\theta + 2 \Delta

We need to find the unknown angle between the original state and the final state after one Grover iteration. We can do this by summing up the angles between x2|x_2\rangle and x2-|x_2\rangle ...