Coding a Bell State

Let’s create a Bell State, our first real quantum algorithm.

In this lesson, we finally run our first useful quantum algorithm using quantum computing frameworks and libraries. Specifically, we’ll be seeing how one can create entangled qubits and read the output we get when we measure the qubits.

Recall from earlier chapters that the Bell States represent maximally entangled qubits. Maximally entangled qubits are intertwined in such a way that measuring one immediately collapses the wavefunction of the entangled counterpart. We already know the circuit for creating a Bell State too. For a two-level quantum system, simply put one qubit in superposition with a Hadamard gate HH and then use it as the control qubit in applying the CNOTCNOT gate where the second qubit is the target qubit. This will create the maximally entangled Bell State:

ψ=00+112|\psi\rangle=\frac{|00\rangle+|11\rangle}{\sqrt{2}}

When this state is measured, we either get the system in state 00|00\rangle or 11|11\rangle.

Get hands-on with 1200+ tech skills courses.