# Time Complexity Analysis - DJ

We'll go through the mathematical proof to understand why the DJ algorithm works in the first place.

## We'll cover the following

## Initialization

Our qubits are initialized to the $|0\rangle$ state and we also have an extra qubit, **ancilla**, that is initialized to the $|1\rangle$ state using an $X$ gate. The current quantum state of our qubits can be represented as follows:

$|\psi_0\rangle = |00...0\rangle \otimes|1\rangle= |0\rangle^{\otimes n} \otimes|1\rangle$

Get hands-on with 1200+ tech skills courses.