# An introduction to Qiskit with quantum teleportation

--

This article concludes a three part series introducing you to quantum computing and qiskit. The first part, here, explained the basics required to understand the quantum teleportation algorithm. The second part, here, then looked at how the quantum teleportation algorithm works. This final part looks at how the algorithm can be implemented using Qiskit, IBM’s quantum software Python SDK. It is therefore a prerequisit to this that you understand how the teleportation circuit we are trying to implement (below) works.

The first thing we need to do is import all the modules we are going to be using. If you don’t have Qiskit installed, follow the instructions here to install it first.

Now to start creating our quantum circuit. We want to create a quantum circuit with three qubits (or quantum registers in Qiskit lingo) and three classical bits (or classical registers) so that we can measure our three quantum bits. One classical bit is required for each quantum bit you want to measure. This is done as below.

Here we define Alices qubits as a quantum register with two qubits and name ‘alice’, and another quantum register for Bob’s qubit and name ‘bob’. We then define the three classical bits as c1, c2 and c3 and create a quantum circuit for these bits. We are then ready to start applying gates to our registers.

We first need to define Alice’s state that we want to teleport. In this case I am just going to define the probabilities of Alice measuring |0> and |1> and create this state. These probabilities do not affect the rest of the code and can be changed at anytime.