HOME

TheInfoList



OR:

In logic circuits, the Toffoli gate, also known as the CCNOT gate (“controlled-controlled-not”), invented by Tommaso Toffoli in 1980 is a CNOT gate with two control bits and one target bit. That is, the target bit (third bit) will be inverted if the first and second bits are both 1. It is a universal reversible logic gate, which means that any classical reversible circuit can be constructed from Toffoli gates. There is also a quantum-computing version where the bits are replaced by qubits.


Description

The
truth table A truth table is a mathematical table used in logic—specifically in connection with Boolean algebra, Boolean functions, and propositional calculus—which sets out the functional values of logical expressions on each of their functional arg ...
and
permutation matrix In mathematics, particularly in matrix theory, a permutation matrix is a square binary matrix that has exactly one entry of 1 in each row and each column with all other entries 0. An permutation matrix can represent a permutation of elements. ...
are as follows (the permutation can be written (7,8) in cycle notation):


Background

An input-consuming
logic gate A logic gate is a device that performs a Boolean function, a logical operation performed on one or more binary inputs that produces a single binary output. Depending on the context, the term may refer to an ideal logic gate, one that has, for ...
''L'' is reversible if it meets the following conditions: (1) ''L''(''x'') = ''y'' is a gate where for any output ''y'', there is a unique input ''x''; (2) The gate ''L'' is reversible if there is a gate ''L''´(''y'') = ''x'' which maps ''y'' to ''x'', for all ''y''. An example of a reversible logic gate is a NOT, which can be described from its truth table below: 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). More recent motivation comes from
quantum computing A quantum computer is a computer that exploits quantum mechanical phenomena. On small scales, physical matter exhibits properties of wave-particle duality, both particles and waves, and quantum computing takes advantage of this behavior using s ...
. In
quantum mechanics Quantum mechanics is the fundamental physical Scientific theory, theory that describes the behavior of matter and of light; its unusual characteristics typically occur at and below the scale of atoms. Reprinted, Addison-Wesley, 1989, It is ...
the quantum state can evolve in two ways: by the
Schrödinger equation The Schrödinger equation is a partial differential equation that governs the wave function of a non-relativistic quantum-mechanical system. Its discovery was a significant landmark in the development of quantum mechanics. It is named after E ...
( 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.


Hardware description

The classical Toffoli gate implemented in the hardware description language
Verilog Verilog, standardized as IEEE 1364, is a hardware description language (HDL) used to model electronic systems. It is most commonly used in the design and verification of digital circuits, with the highest level of abstraction being at the re ...
: module toffoli_gate ( input u1, input u2, input in, output v1, output v2, output out); always @(*) begin v1 = u1; v2 = u2; out = in ^ (u1 && u2); end endmodule


Universality and Toffoli gate

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 In mathematics, the pigeonhole principle states that if items are put into containers, with , then at least one container must contain more than one item. For example, of three gloves, at least two must be right-handed or at least two must be l ...
. 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 non-trivial gate (up to symmetry) is the controlled NOT gate (CNOT), which XORs the first bit to the second bit and leaves the first bit unchanged. Unfortunately, there are reversible functions that cannot be computed using just those gates. For example, AND cannot be achieved by those gates. In other words, the set consisting of NOT and XOR gates is not universal. To compute an arbitrary function using reversible gates, the Toffoli gate, proposed in 1980 by Toffoli, can indeed achieve the goal.Technical Report MIT/LCS/TM-151 (1980) and an adapted and condensed version: It can be also described as mapping bits to . This can also be understood as a
modulo operation In computing and mathematics, the modulo operation returns the remainder or signed remainder of a Division (mathematics), division, after one number is divided by another, the latter being called the ''modular arithmetic, modulus'' of the operatio ...
on bit ''c'': → , often written as → . The Toffoli gate is universal; this means that for any
Boolean function In mathematics, a Boolean function is a function whose arguments and result assume values from a two-element set (usually , or ). Alternative names are switching function, used especially in older computer science literature, and truth functi ...
''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 , making the third output bit (1 XOR (''a'' AND 1)) = NOT ''a''; (''a'' AND ''b'') is the third output bit from . Essentially, this means that one can use Toffoli gates to build systems that will perform any desired Boolean function computation in a reversible manner.


Related logic gates

* The Fredkin gate is a universal reversible 3-bit gate that swaps the last two bits if the first bit is 1; a controlled-swap operation. * The ''n''-bit Toffoli gate is a generalization of the Toffoli gate. It takes ''n'' bits ''x''1, ''x''2, ..., ''x''''n'' as inputs and outputs ''n'' bits. The first ''n'' − 1 output bits are just ''x''1, ..., ''x''''n''−1. The last output bit is (''x''1 AND ... AND ''x''''n''−1) XOR ''x''''n''. * The Toffoli gate can be realized by five two-
qubit 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 two-state device. A qubit is a two-state (or two-level) quantum-mechanical syste ...
quantum gate In quantum computing and specifically the quantum circuit model of computation, a quantum logic gate (or simply quantum gate) is a basic quantum circuit operating on a small number of qubits. Quantum logic gates are the building blocks of quantu ...
s, but it can be shown that it is not possible using fewer than five. * Another universal gate, the Deutsch gate, can be realized by five optical pulses with neutral atoms. The Deutsch gate is a universal gate for quantum computing. * The Margolus gate (named after Norman Margolus), also called simplified Toffoli, is very similar to a Toffoli gate but with a −1 in the diagonal: RCCX = diag(1, 1, 1, 1, 1, −1, ''X''). The Margolus gate is also universal for reversible circuits and acts very similar to a Toffoli gate, with the advantage that it can be constructed with about half of the CNOTs compared to the Toffoli gate. * The iToffoli gate was implemented in superconducting qubits with pair-wise coupling by simultaneously applying noncommuting operations.


Relation to quantum computing

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. Specifically any single-qubit gate with real coefficients that can create a nontrivial quantum state suffices. A Toffoli gate based on
quantum mechanics Quantum mechanics is the fundamental physical Scientific theory, theory that describes the behavior of matter and of light; its unusual characteristics typically occur at and below the scale of atoms. Reprinted, Addison-Wesley, 1989, It is ...
was successfully realized in January 2009 at the University of Innsbruck, Austria. While the implementation of an ''n''-qubit Toffoli with circuit model requires 2n CNOT gates, the best known upper bound stands at 6n-12 CNOT gates. It has been suggested that trapped Ion Quantum computers may be able to implement an ''n''-qubit Toffoli gate directly. The application of many-body interaction could be used for direct operation of the gate in trapped ions, Rydberg atoms, and superconducting circuit implementations. Following the dark-state manifold, Khazali-Mølmer Cn-NOT gate 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 pair-wise coupling.


See also

* Controlled NOT gate * Fredkin gate *
Reversible computing Reversible computing is any model of computation where every step of the process is time-reversible. This means that, given the output of a computation, it's possible to perfectly reconstruct the input. In systems that progress deterministica ...
*
Bijection In mathematics, a bijection, bijective function, or one-to-one correspondence is a function between two sets such that each element of the second set (the codomain) is the image of exactly one element of the first set (the domain). Equival ...
*
Quantum computing A quantum computer is a computer that exploits quantum mechanical phenomena. On small scales, physical matter exhibits properties of wave-particle duality, both particles and waves, and quantum computing takes advantage of this behavior using s ...
* Quantum logic gate * Quantum programming * Adiabatic logic


References


External links


CNOT and Toffoli Gates in Multi-Qubit Setting
at the Wolfram Demonstrations Project. {{DEFAULTSORT:Toffoli Gate Logic gates Quantum gates Reversible computing Italian inventions