Quantum computing refers to using the principles of quantum mechanics to manipulate information and perform computations. Algorithms designed for quantum computers take advantage of the fact that quantum-mechanical systems may exist in a superposition of states to solve certain problems up to exponentially faster than classical computers. Once quantum computing becomes scalable, it will have enormous practical implications in a wide variety of fields including cryptography, computational chemistry, mathematics, and computer science. For example, quantum algorithms would be able to efficiently factor products of large prime numbers, thus breaking RSA encryption, which is widely used to protect online data. Quantum computers would also be superior at modeling quantum systems like the interactions of molecules.
The famous physicist Richard Feynman was one of the first to recognize the enormous potential of quantum computing. In the early 1980s, he observed that a classical computer would require states to describe a set of spin- particles such as electrons, while a quantum computer requires only states. Quantum computers thus have the ability to perform some computations using exponentially fewer states than classical computers. This violates a well-known hypothesis in computing theory sometimes called the Strong Church-Turing thesis, which roughly asserts that if a computation can be performed efficiently by any means then a classical computer can also perform it efficiently.
An early barrier to the development and viability of quantum computing was the no-cloning theorem discovered in 1982 by William Wootters, Wojciech Zurek, and Dennis Dieks, which states that it is impossible to create a guaranteed identical copy of any quantum system. This prevents use of classical error correction techniques for quantum algorithms, since such techniques rely on making backup copies of states as templates to fix errors. Without error correction, thermal fluctuations and other sources of noise cause quantum systems to decohere and lose information. In 1995, however, Peter Shor and Andrew Steane discovered a method of quantum error correction that circumvents this problem.
Since 1994, a number of quantum algorithms (described below) that demonstrate dramatic speedup over classical algorithms have been discovered. The first experimental implementations of these algorithms began around 1998 and have continued into the twenty-first century. Most quantum computers invented so far have only been able to manipulate a small number of quantum states, on the order of tens at once. Since 2006, however, there has been an explosion in different types of quantum computing technology. Particularly well-publicized have been the commercially available quantum devices developed by the British Columbia-based company D-Wave Systems, which in 2015 claimed to have developed a quantum computer capable of manipulating over one thousand quantum states simultaneously . These devices, however, are not computationally universal (they cannot execute generic quantum algorithms) but rather solve a particular kind of optimization problem called quantum annealing, of which only a particular subset can be solved more efficiently than classically. Popular implementations of more universal quantum computers currently under study include solid-state quantum computers involving nitrogen impurities in diamond, semiconductor quantum dot-based computers that isolate electron spins via electric fields, superconducting quantum computers, trapped ion quantum computers, and more.
Classical computers represent information in terms of bits, which can take one of two states: "0" or "1". Algorithms execute by manipulating bits with gates, which alter the states of the bits. Physically, a bit may be implemented by a switch between one of two voltage levels in a device, and a gate is a particular piece of circuitry.
Classically, some common gates are the NOT gate and the AND gate. The NOT gate acts on one bit to map "0" to "1" and vice versa. The AND gate takes two bits as input, mapping them to "1" if both input bits are "1" and otherwise mapping them to "0".
The NAND (not-AND) gate takes two bits and , acts on them with AND, and acts on the result with NOT. Write down the outputs of the NAND gate for all possible choices of input bits and .
The below table gives the output of the NAND gate for all possible choices of input bits and :
To see how these results were generated, consider the two input bits and . The AND gate maps to . The NOT gate then maps to , as displayed in the table. The process for computing NAND for the other choices of input bits is similar.
The NAND gate is computationally universal. This means that any function on any number of bits can be constructed using only NAND gates operating on two bits at once. However, the action of the NAND gate is not reversible, because it takes two inputs to one output and the outputs are not unique. Since any reversible gate can be implemented on a quantum computer, it is often convenient to work with reversible gates in quantum computing. The NAND gate can be simulated by a reversible gate that takes three bits as input called the Toffoli gate. The Toffoli gate maps to . When , the Toffoli gate maps to . Since quantum computers can implement the Toffoli gate, quantum computers are classically computationally universal, although the Toffoli gate alone is not sufficient to implement any function on quantum states.
Quantum computers, like classical computers, rely on gates acting on states in a two-state system. A simple physical prototype for this two-state system is the electron, which can have a spin pointing up or down. As a convention in quantum mechanics, these states are typically written as and . Unlike classical computers, quantum computers are not confined to manipulate solely these two states. Superpositions of states, such as , are also possible. Because superposition is a quantum property, these two-state systems are called quantum bits or more commonly qubits.
States of qubits can also be represented as two-dimensional vectors, e.g.
This is important because it is easy to mathematically represent gates as matrices acting on qubits by multiplying the corresponding vectors.
An arbitrary state of a qubit can be written as a linear combination of and with complex coefficients, that is
For a classical computer to describe an arbitrary quantum state requires two complex numbers; similarly, to model arbitrary quantum states on a classical computer requires complex numbers and therefore a minimum of bits. A quantum computer requires only qubits to describe states, by definition. Modeling quantum systems such as those useful for chemistry on a classical computer thus will require time growing exponentially with the number of states that one wants to model, while modeling the same system on a quantum computer only requires time growing linearly with . For this basic example, the difference in computation time is commonly denoted by saying the classical computer takes time while the quantum computer takes time. This is an example of big O notation, which roughly communicates how the computation time grows with an increasing number of inputs .
An important gate in quantum computing is the Hadamard gate. This gate, denoted by , has the representations both in matrix form and state notation as below:
Show that the Hadamard gate rotates both of the states and into an equal superposition of the two.
Acting directly on the vector representation of each state with the matrix representation of the Hadamard gate,
Both are equal superpositions of and as claimed.
In general, the Hadamard gate maps qubits all in the same state to an equal superposition of every possible state of the qubits. This makes the Hadamard gate an essential component of quantum algorithms such as those described below.
Quantum algorithms are often (though not always) inherently probabilistic in that they are guaranteed to obtain the correct answer only a certain percentage of the time. However, they can be iterated repeatedly to obtain greater confidence in a predicted answer. The benefit of quantum algorithms is their enormous increase in computational efficiency for certain problems. Below are summarized some of the major quantum algorithms in terms of historical significance and practical importance.
Grover's algorithm is designed to solve the unstructured search problem. This problem can be expressed formally as follows: given a function that maps -digit binary values to either or such that one unique binary value is mapped to , find . More simply, the problem asks to identify the unique input corresponding to a given output of any function, i.e. to invert that function.
The implementation of Grover's algorithm is relatively simple. First, apply the Hadamard gate to a set of qubits to achieve a uniform superposition of states, where . Next, a certain gate is constructed that rotates the uniform superposition towards the state corresponding to . After applications of this gate, measuring the state will yield with high probability. This is an improvement on the steps that a random classical algorithm would take in the best-case scenario to find .
Applications of Grover's algorithm include finding the minimum of an unsorted list of integers, determining whether or not a graph is connected, and pattern matching strings within a text .
In Grover's algorithm, a gate is constructed that rotates the uniform superposition of states towards , where
Show that is in fact a rotation matrix.
Since is between and , let , which is true for some . Then one must only show that for the same . This is true as long as both quantities satisfy the identity . Checking this directly,
Therefore, for this . The matrix can then be written as
which is a rotation matrix as claimed.
Simon's algorithm solves the problem of period-finding, i.e. calculating the period of a function that satisfies for all . This was an important subproblem in Shor's algorithm, and offered an exponential speedup: Simon's algorithm runs in on a quantum computer and on a classical computer.
The process by which Simon's algorithm works is as follows: beginning with a uniform superposition of states over qubits, compute the function on the superposition, measure the answer, and apply the Hadamard gate to the resulting qubit states. If the period is represented as a vector that is bits in length, measuring the state after applying the Hadamard gate yields a vector orthogonal to with high probability. After iterations of this process, one obtains vectors orthogonal to . Since lives in an -dimensional vector space, this is sufficient to identify the period .
Shor's algorithm is important in that it solves the difficult problem of integer factorization. Classically, the best existing algorithm for this problem is called the general number field sieve, which runs in , where represents a complicated polynomial. Shor's algorithm demonstrates a remarkable speedup to .
Shor's algorithm first takes advantage of the well-known Euclidean algorithm for computing the greatest common divisor (GCD), and then uses Simon's algorithm to obtain the exponential speedup. Given an integer , one can pick a random number and compute . If is a factor of the problem is solved; otherwise, must equal one. Suppose is the order of , that is, is the smallest positive integer such that . Then as long as is even and is not a multiple of (which occurs with high probability), both and are factors of .
The problem is thus solved as long as one can find the corresponding to a given . To compute , consider the function . Since:
the problem of computing is thus reduced to period-finding for this function . Applying Simon's algorithm solves the problem.
 D-Wave Systems Breaks the 1000 Qubit Quantum Computing Barrier. June 22, 2015. Accessed January 19, 2016. http://www.dwavesys.com/press-releases/d-wave-systems-breaks-1000-qubit-quantum-computing-barrier.
 Bone, Simon and Matias Castro. A Brief History of Quantum Computing. Surveys and Presentations in Information Systems Engineering, Volume 4, 1997. Accessed January 19, 2016. http://www.doc.ic.ac.uk/~nd/surprise_97/journal/vol4/spb3/#1.1%20Quantum%20computer%20basics.
 Montanaro, Ashley. Quantum algorithms: an overview. npj Quantum Information 2, 15023 (2016). Accessed January 19, 2016. http://www.nature.com/articles/npjqi201523.