Definition

What is a quantum logic gate?

A quantum logic gate is a basic quantum device that operates on a small number of quantum bits or qubits.

Quantum logic gates, or simply quantum gates, underpin complex quantum circuits. Each gate's purpose is conceptually identical to classical logic gates used to build complex digital circuits. While quantum gates support traditional Boolean operations, they also support computations done in superposition or simultaneously in multiple positions or states, enabling significantly more complex operations than traditional logic gates. In practice, quantum gates often solve complex algorithms in quantum computing.

A unitary matrix -- a square matrix of complex numbers -- represents the quantum gate. A 2nx2n unitary matrix represents a gate that operates on n qubits. Therefore, a quantum gate that operates on one qubit requires a 2x2 unitary matrix, a two-qubit quantum gate features a 4x4 matrix and so on.

In a straightforward example, a Pauli-X quantum logic gate operates on a matrix such as the following:

|0 , 1|
|1 , 0|

Each quantum gate acts upon quantum states represented by unit vectors. The gate multiplies the matrix elements, resulting in a linear combination of possible outcomes.

Although each quantum gate's underlying math remains steady, the imperfect hardware used in its construction introduces quantum decoherence and subsequent operational errors to the qubits. While quantum error correction techniques, including those introduced by IBM and Google, mitigate mistakes, they also limit a gate's operation.

How do quantum logic gates work?

Quantum gates manipulate one or two qubits to change the qubit's quantum state, employing superposition and entanglement to tackle multiple operations simultaneously. Linking several quantum gates creates sophisticated quantum logic circuits to process complex quantum algorithms.

The qubit

Traditional digital logic circuits use transistors to build predictable digital logic gates operating on electronic signals. Quantum logic gates are designed around qubits, usually nothing more than trapped ions or charged atoms. Each ion stores a single qubit expressed through two atomic states detailing the quantum properties of the ion -- usually its subatomic components. These unique quantum properties are called spin, and the atomic states are coherent and well protected from interference -- any noise or obstruction that affects the qubit's state and causes decoherence.

Qubits to gates

A single-qubit quantum logic gate is a mechanism -- microwaves and lasers are among the commonly used devices -- designed to affect the spin of trapped ions in known and predictable ways. The goal is to influence the ion qubit -- while maintaining its coherence -- to alter its logic state. For example, a short pulse of microwave radiation at a frequency precisely matching the resonant frequency of the ion qubit causes the qubit state to reverse. Similarly, superposition is applied to the qubit by adjusting the length of a microwave pulse.

Two-qubit quantum logic gates are more complicated because the two ion qubits often interact and repel one another. Yet quantum engineers use this repulsion to design interactions between the qubits. Typical two-qubit quantum logic gate mechanisms include lasers, powerful magnetic fields and specially shaped magnetic pulses.

Quantum logic gates have nothing to do with transistors or conventional electronic circuitry. They are large, often unwieldy, complex assemblies of physics equipment -- such as lasers, magnets or microwaves -- designed and constructed specifically to apply physical effects to atomic particles. Their sheer size makes quantum gates ill-suited for deployment outside of carefully controlled environments.

Gates and errors

Quantum logic gates are imperfect. Noise and other interference disrupt the quantum gate's operation; the resulting changes to the ion qubit deviate from the expected outcome. These errors drive quantum computer engineers to invest considerable effort in maintaining reliable gate operations using quantum control methods. For example, changing the shape of a magnetic pulse or the characteristics of a microwave pulse better shielding the ion qubit from environmental noise because a qubit is simply a charged atom with a known interaction between its subatomic parts.

While there are countless ways to build a quantum logic gate, each design resists interference differently, affecting the gate's reliability. Routine examination of quantum control methods against common noise sources lets designers create better and more reliable quantum gates -- and quantum computers.

Types of quantum logic gates

Just as digital logic introduced multiple logic gates -- AND, NAND, OR, NOR, NOT and so on -- there are also varied quantum logic gate designs. Each design typically handles one or two qubits, applying different effects to the qubits to produce distinct processing outcomes. Thus, multiple quantum logic gates combine into a quantum logic circuit, part of a quantum computer capable of managing incredibly sophisticated quantum algorithms.

Each type of quantum gate applies principles of superposition to process matrix information. Common gates readily support a 2x2, or one-qubit, matrix or a 4x4, or two-qubit, matrix. The most broadly used quantum gates include the following:

  • Pauli-X gate. Denoted X, a Pauli-X gate performs a bit reversal operation on a qubit, essentially changing a 0 to a 1 or a 1 to a 0.
  • Pauli-Y gate. Denoted Y, a Pauli-Y gate performs a bit reversal operation and a phase reversal operation on a qubit.
  • Pauli-Z gate. Denoted Z, a Pauli-Z gate performs a phase reversal operation on a qubit and adds a 180-degree phase shift.
  • Hadamard gate. Denoted H, a Hadamard gate transforms the qubit from its current state to an equal superposition of the two possible states. In effect, it performs a bit reversal but reverses the state to any measure between the two possible states.
  • Phase gate. Denoted P or S, a phase gate operates on one qubit and applies a phase shift of π/2 to the qubit's state.
  • π/8 or T gate. Denoted T, a T gate operates on one qubit and applies a phase shift of π/4 to the qubit's state.
  • Controlled NOT (CNOT) gate. CNOT operates on two qubits, a data qubit and a control qubit, to provide a conditional NOT gate. The state of the data qubit depends on the state of the control qubit, so the CNOT gate performs a NOT operation on the data qubit when the control qubit is in one state. Otherwise, the CNOT gate does nothing and passes the data qubit through without changes.
  • Controlled Z (CZ) gate. CZ operates on two qubits -- data and control -- to apply a phase shift to the data qubit based on the state of the control qubit. If the control qubit is in one state, the CZ gate does nothing and passes the data qubit without changes. However, suppose the control qubit is in another state. In that case, the CZ gate applies a Z operation to the data qubit, causing a phase shift and interference in its quantum state, an essential concept of quantum computing.
  • SWAP gate. The SWAP gate operates on two data qubits to exchange their states. Swapping is a fundamental element of quantum algorithms and quantum information processing.
  • Toffoli (CCNOT or TOFF) gate. The Toffoli gate operates on three qubits -- a data qubit and two control qubits -- to perform a NOT operation on the data qubit based on the state of the two control qubits. The Toffoli gate does not change the data qubit if both control qubits are in one state. However, if both control qubits are in another state, the Toffoli gate performs a NOT operation on the data qubit.

Quantum logic gates -- a basic example

Consider the basic operation of a Hadamard gate, which is vital in applying superposition to qubits. Conceptually, superposition represents a coin flipping through the air: It is either heads or tails, both heads and tails, plus anything in between -- provided it continues to flip.

When a Hadamard gate puts qubits into superposition, those qubits have equal likelihood to be measured as a 0, 1 or something in between, depending on the state of the qubit input.

  • The Hadamard gate input receives a data qubit in a 0 or 1 state, or something in between. In quantum logic, this is usually denoted |0> or |1>.
  • The Hadamard gate uses a transformation to apply superposition to the qubit, which simultaneously becomes both 0 and 1 or any combination of something between those states.
  • The output of the Hadamard gate is a qubit that is a combination of |0> or |1> with equal probabilities.

Hadamard gates are fundamental building blocks for many quantum algorithms, the creation of entangled states and the examination of multiple possibilities in parallel.

Further applications of quantum logic gates

Although quantum logic gates are the basis for quantum computing, the gates are useful in other areas of quantum research and design, including the following:

  • Quantum error correction. Errors occur in quantum logic gates and quantum computing due to the fragile nature of charged atoms and their delicate interactions with the physical world. Just as error-correcting codes fix rare errors in digital circuits, quantum logic gates implement error correction to maintain the integrity of quantum information.
  • Quantum simulation. Quantum logic gates apply physical effects to charged atoms and simulate the behaviors of quantum systems, furthering research into complex quantum phenomena, as well as the study and interactions of molecules. This aids in the development of safer, more effective materials such as chemical or pharmaceutical products.
  • Quantum devices. Since a quantum logic gate is basically the application of energy to a charged atom, gates are useful in the research and deployment of quantum devices from quantum sensors to quantum communication devices.
  • Quantum entanglement. Quantum entanglement occurs when two quantum particles share a common quantum state -- even across great distances. Quantum logic gates create and maintain entangled states critical for quantum devices and technologies.
  • Quantum teleportation. Entanglement extends to quantum teleportation, or the transfer of quantum states across sometimes long distances, affecting both quantum communication and quantum security.
This was last updated in April 2025

Continue Reading About What is a quantum logic gate?

Dig Deeper on IT applications, infrastructure and operations