Interested in learning how to program quantum computers? Then check out our Qiskit textbook Introduction to Quantum Computing with Qiskit.
Introduction
This guide will provide the basic steps needed to successfully implement quantum computing in to a software application that you are developing.
Step 1: Work out if your application requires quantum computing
Despite quantum computing often being touted as the next big revolution in computing there are many problems where a classical computer can actually outperform a quantum computer. One good example is basic arithmetic. A computer can do arithmetic on the order of nanoseconds due to the fact that they have dedicated logic in the form of ALUs. Quantum computers however have no such dedicated hardware and are quite slow in comparison. Their power does not lay in speed but in the fact that they can make use of quantum parallelisation.
In fact on specific quantum devices called annealing processors it is often better for the runtime to be as slow as possible since if the runtime is too fast the solution will be nonoptimal.
What types of problems can Quantum Computers solve?
Quantum computers tend to be able to solve problems that have a very high search space. For example, consider a database. Let's say you need to search a database for an entry. The worst case scenario for a classical computer is that it will have to go through the entire database to find the entry you wish to find. This corresponds to a computational complexity of O(N).
However with quantum computing it is possible to solve such problems more efficiently and with less computational complexity. For example a quantum algorithm called Grover’s search algorithm can solve the problem in O(√N) time.
See our Qiskit tutorial on Grover’s algorithm here: https://quantumcomputinguk.org/tutorials/grovers-algorithm-with-code
Step 2: Find the right quantum device
Now that we have worked out our application can benefit from quantum computing we now need to find the right device. The field of quantum computing is a burgeoning one and as such there have been many different advancements. As a result there have been many different quantum devices developed each with their own pros and cons. As such when developing an application it is important to know which device is best depending on the problem you wish to solve.
Gate based Quantum Computing
The most popular type of quantum device is the gate based quantum computer. This is a quantum computer where operations are done on qubits using quantum logic gates. These logic gates are much like the logic gates found in classical computers but are more complex.
Here are some examples:
Gate based quantum computers are general purpose and such can be used for any problem that requires quantum parallelisation. For example factoring numbers using Shor’s algorithm or efficient search using Grover’s search algorithm. Machine learning can also be done using variational quantum circuits.
There are many different hardware implementations of gate based quantum computing:
Superconducting quantum devices: The most popular hardware implementation that use noisy quantum circuits with a qubit count ranging between 5 and 53 qubits. They also tend to have to be cooled using refrigeration.
Trapped ion devices: These use trapped ions as qubits. These devices tend to have very high fidelity qubits with much higher coherence times but a lower qubit count compared to superconducting devices.
Photon based devices: These use photons as qubits. These devices tend to have a high fidelity and fast gate operations and do not require refrigeration.
The best way to get in to gate based quantum computing is through the IBM Quantum Experience as IBM have made their superconducting devices open access: https://quantum-computing.ibm.com/
To start programming gate based quantum devices the easiest way is to use Qiskit and Python. Qiskit is a library that allows you to create quantum circuits and run them on IBM’s quantum devices: https://qiskit.org/
Quantum Annealers
This type of quantum computer is designed specifically for solving optimisation problems. For example the Travelling Salesman problem which corresponds to finding the most optimal route around a city. On quantum annealers this is done by first initializing the qubits into superposition. After this the qubits and connections between them are slowly tuned such that at the end of runtime the configuration corresponds to the optimal solution of interest.
The easiest way to get in to quantum annealing is through D-Wave as they have made their annealers open access:
https://cloud.dwavesys.com/leap/signup/
Picking a device based upon qubit/gate error
Another issue to look at when picking a quantum device is the issue relating to qubit and gate errors. For example superconducting quantum devices are very prone to noise which can lead to errors. These errors come in 3 types (bit flips, phase flips, and readout errors). These can be corrected using quantum error correction/mitigation methods however these may require additional qubits and gates in the quantum circuits.
As such it is best to pick the best device based upon qubit error rates. For example one device may have low fidelity qubits that are prone to error while another may have very high fidelity qubits and as such a lower probability of errors occurring.
In qiskit qubit error rates for quantum devices can be found using the backend monitor: