
The Fredkin gate (also controlled-SWAP gate and conservative logic gate) is a computational circuit suitable for
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 ...
, invented by
Edward Fredkin
Edward Fredkin (October 2, 1934 – June 13, 2023) was an American computer scientist, physicist and businessman who was an early pioneer of digital physics.
Fredkin's primary contributions included work on reversible computing and cellular au ...
. It is ''universal'', which means that any logical or arithmetic operation can be constructed entirely of Fredkin gates. The Fredkin gate is a circuit or device with three inputs and three outputs that transmits the first bit unchanged and swaps the last two bits if, and only if, the first bit is 1.
Background
The Fredkin gate, conceptualized by Edward Fredkin and
Tommaso Toffoli at the
MIT Laboratory for Computer Science, was a pivotal advancement in the field of reversible computing and conservative logic. Developed within the framework of conservative logic, the gate is designed to align computing processes with fundamental physical principles such as the reversibility of dynamical laws and the conservation of energy. The technical rationale behind the Fredkin gate is rooted in addressing the inefficiencies of traditional computing, where irreversible operations typically result in significant energy dissipation.
In contrast to conventional logic gates, which often erase information and thus dissipate heat as per
Landauer's principle
Landauer's principle is a physical principle pertaining to a lower theoretical limit of energy consumption of computation. It holds that an irreversible change in information stored in a computer, such as merging two computational paths, dissipa ...
, the Fredkin gate maintains reversibility — a property that ensures no information is lost during the computation process. Each output state of the gate uniquely determines its input state, which not only preserves information but also aligns with energy conservation principles. This characteristic is particularly crucial as the demand for computational power grows, making energy efficiency a key consideration.
The invention of the Fredkin gate was motivated by the quest to minimize the energy footprint of computational operations. It allows for the construction of computing systems that are not only efficient in terms of processing speed and power consumption but also environmentally sustainable. By embodying principles of reversible computing, the Fredkin gate offers a practical solution to reducing the energy costs associated with digital computations, marking a significant shift towards more sustainable computing technologies.
Definition
The basic Fredkin gate is a
controlled swap gate (CSWAP gate) that
maps
A map is a symbolic depiction of interrelationships, commonly spatial, between things within a space. A map may be annotated with text and graphics. Like any graphic, a map may be fixed to paper or other durable media, or may be displayed on ...
three inputs onto three outputs . The ''C'' input is mapped directly to the ''C'' output. If ''C'' = 0, no swap is performed; maps to , and maps to . Otherwise, the two outputs are swapped so that maps to , and maps to . It is easy to see that this circuit is reversible, i.e., "undoes" itself when run backwards. A generalized ''n'' × ''n'' Fredkin gate passes its first ''n'' − 2 inputs unchanged to the corresponding outputs and swaps its last two outputs if and only if the first ''n'' − 2 inputs are all 1.
* Controlled-swap logic: The Fredkin gate, a three-bit controlled-SWAP gate, operates by conditionally swapping two target bits based on the state of a control bit. If the control bit is 1, the gate swaps the target bits; if 0, the bits pass through unchanged.
* Reversible computing: The gate is reversible, meaning that no information is lost during computation. This property aligns with principles of conservative logic, preserving data and reducing energy dissipation. This corresponds nicely to the
conservation of mass
In physics and chemistry, the law of conservation of mass or principle of mass conservation states that for any system closed to all transfers of matter the mass of the system must remain constant over time.
The law implies that mass can neith ...
in physics and helps to show that the model is not wasteful.
Truth functions with AND, OR, XOR, and NOT
The Fredkin gate can be defined using
truth function
In logic, a truth function is a function that accepts truth values as input and produces a unique truth value as output. In other words: the input and output of a truth function are all truth values; a truth function will always output exactly ...
s with
AND,
OR,
XOR
Exclusive or, exclusive disjunction, exclusive alternation, logical non-equivalence, or logical inequality is a logical operator whose negation is the logical biconditional. With two inputs, XOR is true if and only if the inputs differ (one ...
, and
NOT, as follows:
: ,
: ,
: ''C''
out = ''C''
in,
where .
Alternatively:
: ,
: ,
: ''C''
out = ''C''
in.
Completeness
One way to see that the Fredkin gate is universal is to observe that it can be used to implement AND, NOT and OR:
: If , then .
: If , then .
: If and , then .
Hardware description
We can encode the truth table in a hardware description language such as Verilog:
module fredkin_gate (
input u, input x1, input x2,
output v, output y1, output y2);
always @(*) begin
v = u;
y1 = (~u & x1) , (u & x2);
y2 = (u & x1) , (~u & x2);
end
endmodule
Example

Three-bit
full adder
An adder, or summer, is a digital circuit that performs addition of numbers. In many computers and other kinds of processors, adders are used in the arithmetic logic units (ALUs). They are also used in other parts of the processor, where they ar ...
(add with carry) using five Fredkin gates. The "garbage" output bit is if , and if .
Inputs on the left, including two constants, go through three gates to quickly determine the parity. The 0 and 1 bits swap places for each input bit that is set, resulting in parity bit on the 4th row and inverse of parity on 5th row.
Then the carry row and the inverse parity row swap if the parity bit is set and swap again if one of the or input bits are set (it doesn't matter which is used) and the resulting carry output appears on the 3rd row.
The and inputs are only used as gate controls so they appear unchanged in the output.
Applications
Quantum photonic chip implementation
Recent research has demonstrated the Fredkin gate on programmable silicon photonic chips. These chips use a network of Mach-Zehnder interferometers to route photons efficiently, creating a versatile and scalable platform that can handle multiple quantum gates. This approach allows for integrating Fredkin gates into large-scale quantum processors, paving the way for future quantum computing advancements.
Efficient controlled-SWAP operation
In a photonic setup, the Fredkin gate serves as an effective controlled-SWAP mechanism, enabling the conditional swap of target qubits. This is particularly valuable in generating high-fidelity
Greenberger-Horne-Zeilinger states, which are crucial for quantum communication and other protocols. The gate thus provides a powerful tool for quantum protocols that require efficient conditional operations.
Quantum state estimation
The Fredkin gate's controlled operations allow for estimating the overlap between quantum states without requiring resource-intensive quantum state tomography. This makes it particularly useful for quantum communication, measurement, and cryptography, where efficiency and accuracy are paramount.
Quantum Fredkin gate
On March 25, 2016, researchers from
Griffith University
Griffith University is a public university, public research university in South East Queensland on the Eastern states of Australia, east coast of Australia. The university was founded in 1971, but was not officially opened until 1975. Griffith ...
and the
University of Queensland
The University of Queensland is a Public university, public research university located primarily in Brisbane, the capital city of the Australian state of Queensland. Founded in 1909 by the Queensland parliament, UQ is one of the six sandstone ...
announced they had built a quantum Fredkin gate that uses the
quantum entanglement
Quantum entanglement is the phenomenon where the quantum state of each Subatomic particle, particle in a group cannot be described independently of the state of the others, even when the particles are separated by a large distance. The topic o ...
of
particles of light to swap
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 ...
s. The availability of quantum Fredkin gates may facilitate the construction of
quantum computer
A quantum computer is a computer that exploits quantum mechanical phenomena. On small scales, physical matter exhibits properties of both particles and waves, and quantum computing takes advantage of this behavior using specialized hardware. ...
s.
[A quantum Fredkin gate](_blank)
Raj B. Patel, Joseph Ho, Franck Ferreyrol, Timothy C. Ralph and Geoff J. Pryde, Science Advances, 25 March 2016, Vol. 2, no. 3, e1501531, DOI: 10.1126/sciadv.1501531
See also
*
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 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 ...
**
Quantum circuit
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 o ...
*
Quantum programming
Quantum programming refers to the process of designing and implementing algorithms that operate on quantum systems, typically using quantum circuits composed of quantum gates, measurements, and classical control logic. These circuits are devel ...
*
Toffoli gate
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 inver ...
, which is a ''controlled-controlled-NOT gate''.
References
Further reading
*
{{Authority control
Logic gates
Quantum gates
Reversible computing