In logic circuits, the Toffoli gate (also CCNOT gate), invented by Tommaso Toffoli, is a universal reversible logic gate, which means that any classical reversible circuit can be constructed from Toffoli gates. It is also known as the "controlledcontrollednot" gate, which describes its action. It has 3bit inputs and outputs; if the first two bits are both set to 1, it inverts the third bit, otherwise all bits stay the same.
An inputconsuming logic gate L is reversible if it meets the following conditions: L(x) = y is a gate where for any output y, there is a unique input x. The gate L is reversible if there is a gate L´(y) = x which maps y to x, for all y. From common logic gates, NOT is reversible, as can be seen from its truth table below:
Input  Output 

0  1 
1  0 
The common AND gate is not reversible, because the inputs 00, 01 and 10 are all mapped to the output 0.
Reversible gates have been studied since the 1960s. The original motivation was that reversible gates dissipate less heat (or, in principle, no heat).^{ [1] }
More recent motivation comes from quantum computing. In quantum mechanics the quantum state can evolve in two ways: by Schrödinger's equation (unitary transformations), or by their collapse. Logic operations for quantum computers, of which the Toffoli gate is an example, are unitary transformations and therefore evolve reversibly.^{ [2] }
Any reversible gate that consumes its inputs and allows all input computations must have no more input bits than output bits, by the pigeonhole principle. For one input bit, there are two possible reversible gates. One of them is NOT. The other is the identity gate, which maps its input to the output unchanged. For two input bits, the only nontrivial gate is the controlled NOT gate (hereafter CNOT), which XORs the first bit to the second bit and leaves the first bit unchanged.
Truth table  Permutation matrix form  


Unfortunately, there are reversible functions that cannot be computed using just those gates. In other words, the set consisting of NOT and XOR gates is not universal. To compute an arbitrary function using reversible gates, another gate is needed. One possibility is the Toffoli gate, proposed in 1980 by Toffoli.^{ [3] }
This gate has 3bit inputs and outputs. If the first two bits are set, it flips the third bit. The following is a table of the input and output bits:
Truth table  Permutation matrix form  


It can be also described as mapping bits {a, b, c} to {a, b, c XOR (a AND b)}. This can also be understood as a modulo operation on bit c: {a, b, c} → {a, b, (c + ab) mod 2}, often written as {a, b, c} → {a, b, c ⨁ ab}^{ [4] }
The Toffoli gate is universal; this means that for any Boolean function f(x_{1}, x_{2}, ..., x_{m}), there is a circuit consisting of Toffoli gates that takes x_{1}, x_{2}, ..., x_{m} and some extra bits set to 0 or 1 to outputs x_{1}, x_{2}, ..., x_{m}, f(x_{1}, x_{2}, ..., x_{m}), and some extra bits (called garbage). A NOT gate, for example, can be constructed from a Toffoli gate by setting the three input bits to {a, 1, 1}, making the third output bit (1 XOR (a AND 1)) = NOT a; (a AND b) is the third output bit from {a, b, 0}. Essentially, this means that one can use Toffoli gates to build systems that will perform any desired Boolean function computation in a reversible manner.
Any reversible gate can be implemented on a quantum computer, and hence the Toffoli gate is also a quantum operator. However, the Toffoli gate cannot be used for universal quantum computation, though it does mean that a quantum computer can implement all possible classical computations. The Toffoli gate has to be implemented along with some inherently quantum gate(s) in order to be universal for quantum computation. In fact, any singlequbit gate with real coefficients that can create a nontrivial quantum state suffices.^{ [11] } A Toffoli gate based on quantum mechanics was successfully realized in January 2009 at the University of Innsbruck, Austria.^{ [12] } While the implementation of an nqubit Toffoli with circuit model requires 2n CNOT gates,^{ [13] } the best known upper bound stands at 6n − 12 CNOT gates.^{ [14] } It has been suggested that trapped Ion Quantum computers may be able to implement an nqubit Toffoli gate directly.^{ [15] } The application of manybody interaction could be used for direct operation of the gate in trapped ions, Rydberg atoms and superconducting circuit implementations.^{ [16] }^{ [17] }^{ [18] }^{ [19] }^{ [20] }^{ [21] } Following the darkstate manifold, KhazaliMølmer C_{n}NOT gate^{ [17] } operates with only three pulses, departing from the circuit model paradigm. The iToffoli gate was implemented in a single step using three superconducting qubits with pairwise coupling. ^{ [22] }
A quantum computer is a computer that takes advantage of quantum mechanical phenomena.
In quantum computing, a qubit or quantum bit is a basic unit of quantum information—the quantum version of the classic binary bit physically realized with a twostate device. A qubit is a twostate quantummechanical system, one of the simplest quantum systems displaying the peculiarity of quantum mechanics. Examples include the spin of the electron in which the two levels can be taken as spin up and spin down; or the polarization of a single photon in which the two spin states can also be measured as horizontal and vertical linear polarization. In a classical system, a bit would have to be in one state or the other. However, quantum mechanics allows the qubit to be in a coherent superposition of multiple states simultaneously, a property that is fundamental to quantum mechanics and quantum computing.
In quantum information theory, a quantum circuit is a model for quantum computation, similar to classical circuits, in which a computation is a sequence of quantum gates, measurements, initializations of qubits to known values, and possibly other actions. The minimum set of actions that a circuit needs to be able to perform on the qubits to enable quantum computation is known as DiVincenzo's criteria.
In quantum computing and specifically the quantum circuit model of computation, a quantum logic gate is a basic quantum circuit operating on a small number of qubits. Quantum logic gates are the building blocks of quantum circuits, like classical logic gates are for conventional digital circuits.
Quantum error correction (QEC) is used in quantum computing to protect quantum information from errors due to decoherence and other quantum noise. Quantum error correction is theorised as essential to achieve fault tolerant quantum computing that can reduce the effects of noise on stored quantum information, faulty quantum gates, faulty quantum preparation, and faulty measurements. This would allow algorithms of greater circuit depth.
Reversible computing is any model of computation where the computational process, to some extent, is timereversible. In a model of computation that uses deterministic transitions from one state of the abstract machine to another, a necessary condition for reversibility is that the relation of the mapping from states to their successors must be onetoone. Reversible computing is a form of unconventional computing.
In computer science, the controlled NOT gate, controlledX gate, controlledbitflip gate, Feynman gate or controlled PauliX is a quantum logic gate that is an essential component in the construction of a gatebased quantum computer. It can be used to entangle and disentangle Bell states. Any quantum circuit can be simulated to an arbitrary degree of accuracy using a combination of CNOT gates and single qubit rotations. The gate is sometimes named after Richard Feynman who developed an early notation for quantum gate diagrams in 1986.
The oneway or measurementbased quantum computer (MBQC) is a method of quantum computing that first prepares an entangled resource state, usually a cluster state or graph state, then performs single qubit measurements on it. It is "oneway" because the resource state is destroyed by the measurements.
Norman H. Margolus is a CanadianAmerican physicist and computer scientist, known for his work on cellular automata and reversible computing. He is a research affiliate with the Computer Science and Artificial Intelligence Laboratory at the Massachusetts Institute of Technology.
In reversible computing, ancilla bits are extra bits being used to implement irreversible logical operations. In classical computation, any memory bit can be turned on or off at will, requiring no prior knowledge or extra complexity. However, this is not the case in quantum computing or classical reversible computing. In these models of computing, all operations on computer memory must be reversible, and toggling a bit on or off would lose the information about the initial value of that bit. For this reason, in a quantum algorithm there is no way to deterministically put bits in a specific prescribed state unless one is given access to bits whose original state is known in advance. Such bits, whose values are known a priori, are known as ancilla bits in a quantum or reversible computing task.
Linear optical quantum computing or linear optics quantum computation (LOQC), also photonic quantum computing (PQC), is a paradigm of quantum computation, allowing (under certain conditions, described below) universal quantum computation. LOQC uses photons as information carriers, mainly uses linear optical elements, or optical instruments (including reciprocal mirrors and waveplates) to process quantum information, and uses photon detectors and quantum memories to detect and store quantum information.
IBM Quantum Platform is an online platform allowing public and premium access to cloudbased quantum computing services provided by IBM. This includes access to a set of IBM's prototype quantum processors, a set of tutorials on quantum computation, and access to an interactive textbook. As of February 2021, there are over 20 devices on the service, six of which are freely available for the public. This service can be used to run algorithms and experiments, and explore tutorials and simulations around what might be possible with quantum computing.
In quantum computing, quantum supremacy or quantum advantage is the goal of demonstrating that a programmable quantum computer can solve a problem that no classical computer can solve in any feasible amount of time, irrespective of the usefulness of the problem. The term was coined by John Preskill in 2012, but the concept dates to Yuri Manin's 1980 and Richard Feynman's 1981 proposals of quantum computing.
In quantum computing, a qubit is a unit of information analogous to a bit in classical computing, but it is affected by quantum mechanical properties such as superposition and entanglement which allow qubits to be in some ways more powerful than classical bits for some tasks. Qubits are used in quantum circuits and quantum algorithms composed of quantum logic gates to solve computational problems, where they are used for input/output and intermediate computations.
Magic state distillation is a method for creating more accurate quantum states from multiple noisy ones, which is important for building fault tolerant quantum computers. It has also been linked to quantum contextuality, a concept thought to contribute to quantum computers' power.
The Eastin–Knill theorem is a nogo theorem that states: "No quantum error correcting code can have a continuous symmetry which acts transversely on physical qubits". In other words, no quantum error correcting code can transversely implement a universal gate set, where a transversal logical gate is one that can be implemented on a logical qubit by the independent action of separate physical gates on corresponding physical qubits.
Dmitri Maslov is a CanadianAmerican computer scientist known for his work on quantum circuit synthesis and optimization, quantum advantage, and benchmarking quantum computers. Currently, he is the Chief Software Architect at IBM Quantum. Maslov was formerly a program director for Quantum Information Science at the National Science Foundation. He was named a Fellow of the Institute of Electrical and Electronics Engineers in 2021 "for contributions to quantum circuit synthesis and optimization, and compiling for quantum computers."
Vivek Vijay Shende is an American mathematician known for his work on algebraic geometry, algebraic topology and quantum computing. He is a professor of Quantum Mathematics at Syddansk Universitet while on leave from University of California Berkeley.