Quantum Computing explained!

Written by arun.cthomas3 | Published 2017/09/05
Tech Story Tags: science | quantum-computing | quantum-mechanics | artificial-intelligence | explained

TLDRvia the TL;DR App

It may seem bit complex but the main point that we need to keep in mind is that the single qubit at any time can be in a super position of |0> and |1> and it can be expressed as

a|0> + b|1>

where a and b are amplitude (proportional to probabilities) of qubit being measured to 0 and 1 respectively and a² + b² =1

So a qubit can be in super position of two states, and once it is measured it will return one of the two states based on the probabilities of each state. So measuring a qubit itself has an effect on the the system, so measurement of a qubit is similar to a gate which affect the state of the qubit.

If we consider more than one, say two, qubit things become more interesting, the basic state will be 00, 01, 10, 11 but the qubits can be in super position of all for states at the same time. So this should be represented as

a|00> + b|01> + c|10> + d|11>

In order to represent two qubits we need 4 probabilities/amplitude (a, b, c, d), if we have three qubits we will need 8. So if we have n qubits, we will need 2^n numbers to represent the the overall state of that quantum system. So with small increase in the number of qubits we will be able to generate systems which can represent enormous states and this is dissimilar to classical computers.

Even if the amount of information required to describe the super position grows exponentially with number of qubits we will not be able to access all this information because of the fundamental limits of quantum measurement. Spin of an electron in superposition can be in all directions but when we measure, it is in one direction either up or down. Also we will not be able to predict the out come, it is probabilistic based on the probability associated with state (Eg: half times up and half times down). That means in order to use full potential of quantum computer we need develop quantum algorithms which explore the existence of huge amount of information stored in super position of qubits and at the end of the computation, leave the system in one of the base states which we can detect with certainty.

In a quantum computer, it is possible to have two qubits with opposite values, but the value of individual qubits is unknown until we measure. This is possible because of quantum entanglement. Say we have two electron qubit which have zero state, then we put the first electron/qubit into superposition by applying a electromagnetic wave, with a certain frequency which is proportional to the energy difference between zero and one state. Now, when we try to adjust the second electron/qubit by applying electromagnetic wave of frequency which was required when first electron/qubitis in zero state, the first electron/qubit in super position will have an effect in the spin of second qubit and second one will also move to a superposition (not a stable state). So the state of these two qubits will be entangled and if we measure first one and get up-spin then the other will give down-spin and vice versa. This entanglement will be persevered at any long distance. Until we measure them the two qubits can only be considered as a single system with probable values. This is impossible in a classical computer, to have two bits with no value but the opposite values.

So the increase in the number of qubits will exponentially increase the number of possible entangled states. One key point to notice is that the quantum entanglement can be very fragile (Quantum decoherence) and any system that utilises this should have a very minimum external interference.

The building blocks of quantum circuits (model for quantum computation) is quantum logic gate. They are like logic gates of classical computing world but unlike many classical logic gates, quantum logic gates are reversible. This is because quantum mechanics require a quantum system to never lose information over time and it must always possible to reconstruct the past.

Can you think of any classic gates which will make to the quantum world?

AND gate will not make it since both 1 AND 0, 0 AND 1 gives output as 0.

Yes, NOT can make it to quantum world

NOT 0 = 1, NOT 1 =0

This is reversible if output is zero then input is one, if output is one, input is zero. This gate is known by the name Pauli-X gate in the quantum world. It maps |0> to|1> and |1> to|0>

Hadamard gate also acts on a single qubit and creates a superposition.

The swap gate swaps two qubits. That is |10> to|01> and so on.

Controlled gates act on 2 or more qubits, where one or more qubits act as a control for some operation. For example, the controlled NOT gate (or CNOT) acts on 2 qubits, and performs the NOT operation on the second qubit only when the first qubit is|1>, and otherwise leaves it unchanged.

CNOT Gate:

In case of CNOT gate also, we can see that each output is distinct and there is no ambiguity and states can be restored.

In an electron spin based quantum computer the CNOT gate can be implemented easily. Since the control bit and target bit are close-together and control bits spin have some effect on target bit, and it can decide whether we can flip the target with certain electromagnetic wave.

CNOT gate can also be used to produced entangled state of Control and Target. If we apply Hadamard gate to control first and then apply CNOT gate, both control and target will be in superposition and entangled together. The CNOT gate is generally used in quantum computing to generate entangled states.

CNOT together with arbitrary qubit rotation can implement any logic functions in quantum computers.

There are other quantum gates also available that you can find here.

Measurement of a qubit can also change the state of the system and functions very similar to gates but it is not an actual quantum gate.

For a quantum computer to work we should be able to change properties of arbitrary qubits and we should be able to run quantum logic gates on one or more qubits by making interaction between them.

Now we need to make use of all these logic to create some useful algorithms. There is no point in using a quantum computer to perform computationally simple operations, since classical computers can do this at a cheaper rate. Because of the fact that the infrastructure itself is complex and the quantum computers can handle large number of states at the same time, the effective use of quantum computers are confined to specific areas like finding the prime factors, search large amount of data, etc. which are computationally intensive.

Quantum algorithm is a step-by-step procedure, where each of the steps can be performed on a quantum computer and this will involve quantum properties like, superposition and entanglement. There are different algorithms already available and more are in the pipeline.

Shor’s algorithm for integer factorisation is one of the most famous one because of its implication in cryptography.

Grover’s algorithm is also well known and used for searching an unstructured database or an unordered list.

There are other interesting algorithms available that you can find here.

Let’s explore a small variant of Grover’s algorithm, the quantum algorithm for searching.

First, consider a list of N phone numbers and name from which we need to find name of a specific number

Unlike normal quantum algorithms that provides an exponential increase in speed, Grover’s Algorithm only provides a quadratic increase in speed. The complexity will be a function of square root of number of possible elements, N. This is much more efficient when compared with classical algorithms which may have complexity N. Grover’s Algorithm work using Amplitude amplification.

For our example we will consider only four numbers, which can be represented using 2 qubits and we need to find the name associated with 10

a|00> + b|01> + c|10> + d|11>

where a,b,c and d are the amplitudes and a=b=c=d.

this is the first step in Grover’s Algorithm is to put the qubit in super position.

Second step is to apply an oracle function which flips the amplitude of item we are looking for in opposite direction. In this case c becomes -c. Now a=b=d and c is different and negative.

Third step is to apply an amplification function which amplifies the difference between each amplitude and those of the equal superposition states. Since the value of -c is having much difference from other amplitude the value of c rapidly increases compared to a,b or d.

Now if we measure the qubits the 3rd state will be returned with maximum probability (Step 2 and 3 can be applied again to increase probability). So using this technique we are able solve the search by loading all the available values into the qubit all at once. The more number of qubits available the higher there problem domain sizes we can work with.

All well and good but what about the hardware to run all this.

Current implementation of quantum computers are based on semi-conductors. The qubits generated from these semi-conductors should be kept away from any external interference. Other wise the quantum mechanical properties of these qubits will be lost. So the temperature of these quantum computers are kept very near to absolute zero and the set up for this along with calculations at microscopic levels can make quantum computers extremely expensive. Precise microwave/electromagnetic waves can be used to modify the states of qubites. It is often the case that a classical computer is used along with a quantum computer to help with processing.

IBM Q is an industry-first initiative to build commercially available universal quantum computers for business and science. IBM Q Experience allows us to run quantum algorithms either using online composer or using its python library for free. The number of qubits in these systems are relatively small but will increase rapidly for sure.

D-Wave Systems is another major player in this space with their flag ship 2000 qubit D-Wave 2000Q quantum computer. D-Wave products are widely used by companies like Google to run Quantum Artificial Intelligence Lab and NASA for their research.

The D-Wave machine uses Quantum annealing to perform its operations. This is great for optimising solutions to problems by quickly searching over a space and finding the global minimum which becomes the solution. This approach might be faster for certain problem domains but a system using quantum annealing will find it difficult to run certain algorithms like the famous Shor’s algorithm.

On the other hand Universal quantum computing offered by IBM will serve broader problem domains and allow us to design much more complex algorithms. But designing those algorithms with Universal quantum computing can be complex and it comes with its own challenges in system design and consistency.

Quantum mechanics is a field of science which is inherently astounding, and computing capabilities offered by it is just the tip of the iceberg. It has wide range applicability in biology (it can explain mutation by superposition), computer hardware (to explain properties of semiconductor chips), and it can even explain how the expectation or thoughts of human can affect the future as explained by the Global Consciousness Project, which experimentally proved that “When human consciousness becomes coherent, the behavior of random systems may change“. Yes_,_ It is true that there is strange relation between human mind and quantum physics. Further more, it can be used for Quantum teleportation which was reported by Chinese scientists that they had transmitted the quantum state of a photon on Earth to another photon on a satellite in low Earth orbit. Quantum mechanics posses the potential to change every thing that we know and do in the classical way.

I hope you understand something…

“If you think you understand quantum mechanics, you don’t understand quantum mechanics.” Richard Feynman

Thanks for your time.

Edited By : Ashok Jeevan


Published by HackerNoon on 2017/09/05