Fredkin gate

From Wikipedia, the free encyclopedia

The Fredkin gate (also controlled-SWAP gate and conservative logic gate) is a computational circuit suitable for reversible computing, invented by Edward Fredkin. 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[edit]

The Fredkin gate[1], conceptualized by Edward Fredkin and Tommaso Toffoli at the MIT Laboratory for Computer Science, represents a pivotal advancement in the field of reversible computing. Developed within the framework of conservative logic, this 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[2], 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[edit]

The basic Fredkin gate[3] is a controlled swap gate (CSWAP gate) that maps three inputs (C, I1, I2) onto three outputs (C, O1, O2). The C input is mapped directly to the C output. If C = 0, no swap is performed; I1 maps to O1, and I2 maps to O2. Otherwise, the two outputs are swapped so that I1 maps to O2, and I2 maps to O1. 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.

The Fredkin gate is the reversible three-bit gate that swaps the last two bits if, and only if, the first bit is 1.

Truth table Permutation matrix form
Input Output
C I1 I2 C O1 O2
0 0 0 0 0 0
0 0 1 0 0 1
0 1 0 0 1 0
0 1 1 0 1 1
1 0 0 1 0 0
1 0 1 1 1 0
1 1 0 1 0 1
1 1 1 1 1 1

It has the useful property that the numbers of 0s and 1s are conserved throughout, which in the billiard-ball model means that the same number of balls are output as input. This corresponds nicely to the conservation of mass in physics and helps to show that the model is not wasteful.

Truth functions with AND, OR, XOR, and NOT[edit]

The Fredkin gate can be defined using truth functions with AND, OR, XOR, and NOT, as follows:

O1 = I1 XOR S,
O2 = I2 XOR S,
Cout = Cin,

where S = (I1 XOR I2) AND C.

Alternatively:

O1 = (NOT C AND I1) OR (C AND I2),
O2 = (C AND I1) OR (NOT C AND I2),
Cout = Cin.

Completeness[edit]

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 I2 = 0, then O2 = C AND I1.
If I2 = 1, then O1 = C OR I1.
If I1 = 0 and I2 = 1, then O2 = NOT C.

Example[edit]

Three-bit full adder (add with carry) using five Fredkin gates

Three-bit Full Adder

Three-bit full adder (add with carry) using five Fredkin gates. The "garbage" output bit g is (p NOR q) if r = 0, and (p NAND q) if r = 1.

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 p or q input bits are set (it doesn't matter which is used) and the resulting carry output appears on the 3rd row.

The p and q inputs are only used as gate controls so they appear unchanged in the output.

Quantum Computing[4][edit]

A quantum Fredkin gate uses the principles of quantum mechanics to control qubit states, extending the gate's applicability to quantum information processing. Here, the gate's controlled-swap operation is critical for algorithms that require conditional operations based on the state of a qubit.

In quantum circuits, the Fredkin gate is instrumental in entanglement and error correction protocols. Its ability to conditionally alter the state of qubits without collapsing their superpositions is vital for quantum computation's coherence and scalability.

Digital Logic Circuits

In classical computing, the Fredkin gate can simulate other logical operations such as AND, OR, and NOT through specific input configurations. This allows for the construction of complex logic circuits where reversibility can help reduce energy dissipation—a key consideration in energy-efficient computing designs.

Quantum Fredkin gate[edit]

On March 25, 2016, researchers from Griffith University and the University of Queensland announced they had built a quantum Fredkin gate that uses the quantum entanglement of particles of light to swap qubits. The availability of quantum Fredkin gates may facilitate the construction of quantum computers.[5][6]

See also[edit]

References[edit]

  1. ^ Fredkin, Edward; Toffoli, Tommaso (April 1982). "Conservative logic". International Journal of Theoretical Physics. 21 (3–4): 219–253. doi:10.1007/bf01857727. ISSN 0020-7748.
  2. ^ Landauer, R. (July 1961). "Irreversibility and Heat Generation in the Computing Process". IBM Journal of Research and Development. 5 (3): 183–191. doi:10.1147/rd.53.0183. ISSN 0018-8646.
  3. ^ Brown, Julian, The Quest for the Quantum Computer, New York : Touchstone, 2000.
  4. ^ Nielsen, Michael A.; Chuang, Isaac L. (2012-06-05). Quantum Computation and Quantum Information. Cambridge University Press. ISBN 978-1-107-00217-3.
  5. ^ "Quantum computing is now a big step closer thanks to a new breakthrough: The Fredkin gate".
  6. ^ A quantum Fredkin gate Raj B. Patel, Joseph Ho, Franck Ferreyrol, Timothy C. Ralph and Geoff J. Pryde, Science Advances, 25 Mar 2016, Vol. 2, no. 3, e1501531, DOI: 10.1126/sciadv.1501531

Further reading[edit]