Building Quantum Circuits

Let's see how to build proper quantum circuits using the gates we've learned so far.

We'll cover the following

Equal superposition state

An important part of most quantum circuits is the equal superposition state. It gives us the power to represent an exponential number of states with respect to the number of qubits we have at our disposal.

How can we create a superposition state representing our whole qubit system? You might recall that the Hadamard gate HH is used to put one qubit in an equal superposition state. This is the key concept here. If we have five qubits at our disposal, applying the Hadamard gate HH on each qubit will enable us to generate a superposition of 252^5 states. Let’s take a look at a simple example using only two qubits:

H200=H0H0H^{\otimes2}|00\rangle = H|0\rangle \otimes H|0\rangle

H200=(120+121)(120+121)H^{\otimes2}|00\rangle = (\frac{1}{\sqrt{2}}|0\rangle + \frac{1}{\sqrt{2}}|1\rangle) \otimes (\frac{1}{\sqrt{2}}|0\rangle + \frac{1}{\sqrt{2}}|1\rangle)

H200=12(00+01+10+11)H^{\otimes2}|00\rangle = \frac{1}2(|00\rangle + |01\rangle + |10\rangle + |11\rangle)

As you can see, the state of our system has an equal chance of 25% to yield either of the states in the superposition upon measurement. Let’s have a look at the circuit diagram.

Get hands-on with 1200+ tech skills courses.