
In
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 ...
and specifically the
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 ...
model of computation
In computer science, and more specifically in computability theory and computational complexity theory, a model of computation is a model which describes how an output of a mathematical function is computed given an input. A model describes how ...
, a quantum logic gate (or simply quantum gate) is a basic quantum circuit operating on a small number of
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. Quantum logic gates are the building blocks of quantum circuits, like classical
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 ...
s are for conventional digital circuits.
Unlike many classical logic gates, quantum logic gates are
reversible. It is possible to perform classical computing using only reversible gates. For example, the reversible
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 ...
can implement all
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 ...
s, often at the cost of having to use
ancilla bit
Ancilla bits are extra bits (units of information) used in computing paradigms that require reversible operations, such as classical reversible computing and quantum computing. Unlike classical computing where bits can be freely set to 0 or 1, rev ...
s. The Toffoli gate has a direct quantum equivalent, showing that quantum circuits can perform all operations performed by classical circuits.
Quantum gates are
unitary operators
In functional analysis, a unitary operator is a surjective bounded operator on a Hilbert space that preserves the inner product.
Non-trivial examples include rotations, reflections, and the Fourier operator.
Unitary operators generalize unita ...
, and are described as
unitary matrices relative to some
orthonormal
In linear algebra, two vectors in an inner product space are orthonormal if they are orthogonal unit vectors. A unit vector means that the vector has a length of 1, which is also known as normalized. Orthogonal means that the vectors are all perpe ...
basis. Usually the ''computational basis'' is used, which unless comparing it with something, just means that for a ''d''-level quantum system (such as a
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 ...
, a
quantum register
In quantum computing, a quantum register is a system comprising multiple qubits. It is the quantum analogue of the classical processor register. Quantum computers perform calculations by manipulating qubits within a quantum register.
Definitio ...
, or
qutrit
A qutrit (or quantum trit) is a unit of quantum information that is realized by a 3-level quantum system, that may be in a superposition of three mutually orthogonal quantum states.
The qutrit is analogous to the classical radix-3 trit, just a ...
s and
qudit
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 system, ...
s) the
orthonormal basis
In mathematics, particularly linear algebra, an orthonormal basis for an inner product space V with finite Dimension (linear algebra), dimension is a Basis (linear algebra), basis for V whose vectors are orthonormal, that is, they are all unit vec ...
vector
Vector most often refers to:
* Euclidean vector, a quantity with a magnitude and a direction
* Disease vector, an agent that carries and transmits an infectious pathogen into another living organism
Vector may also refer to:
Mathematics a ...
s are labeled or use
binary notation
A binary number is a number expressed in the base-2 numeral system or binary numeral system, a method for representing numbers that uses only two symbols for the natural numbers: typically "0" (zero) and "1" (one). A ''binary number'' may also ...
.
History
The current notation for quantum gates was developed by many of the founders of
quantum information science
Quantum information science is a field that combines the principles of quantum mechanics with information theory to study the processing, analysis, and transmission of information. It covers both theoretical and experimental aspects of quantum phys ...
including Adriano Barenco,
Charles Bennett,
Richard Cleve
Richard Erwin Cleve is a Canadian professor of computer science at the David R. Cheriton School of Computer Science at the University of Waterloo, where he holds the Institute for Quantum Computing Chair in quantum computing, and an associate me ...
,
David P. DiVincenzo,
Norman Margolus
Norman H. Margolus (born 1955) is a Canadian-American 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 Laborator ...
,
Peter Shor
Peter Williston Shor (born August 14, 1959) is an American theoretical computer scientist known for his work on quantum computation, in particular for devising Shor's algorithm, a quantum algorithm for factoring exponentially faster than the ...
, Tycho Sleator,
John A. Smolin, and Harald Weinfurter,
building on notation introduced by
Richard Feynman
Richard Phillips Feynman (; May 11, 1918 – February 15, 1988) was an American theoretical physicist. He is best known for his work in the path integral formulation of quantum mechanics, the theory of quantum electrodynamics, the physics of t ...
in 1986.
Representation

Quantum logic gates are represented by
unitary matrices. A gate that acts on
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 (a
register
Register or registration may refer to:
Arts, entertainment, and media
Music
* Register (music), the relative "height" or range of a note, melody, part, instrument, etc.
* ''Register'', a 2017 album by Travis Miller
* Registration (organ), ...
) is represented by a
unitary matrix, and the
set
Set, The Set, SET or SETS may refer to:
Science, technology, and mathematics Mathematics
*Set (mathematics), a collection of elements
*Category of sets, the category whose objects and morphisms are sets and total functions, respectively
Electro ...
of all such gates with the group operation of
matrix multiplication
In mathematics, specifically in linear algebra, matrix multiplication is a binary operation that produces a matrix (mathematics), matrix from two matrices. For matrix multiplication, the number of columns in the first matrix must be equal to the n ...
is the
unitary group
Unitary may refer to:
Mathematics
* Unitary divisor
* Unitary element
* Unitary group
* Unitary matrix
* Unitary morphism
* Unitary operator
* Unitary transformation
* Unitary representation
* Unitarity (physics)
* ''E''-unitary inverse semi ...
U(2
''n'').
The
quantum state
In quantum physics, a quantum state is a mathematical entity that embodies the knowledge of a quantum system. Quantum mechanics specifies the construction, evolution, and measurement of a quantum state. The result is a prediction for the system ...
s that the gates act upon are
unit vector
In mathematics, a unit vector in a normed vector space is a Vector (mathematics and physics), vector (often a vector (geometry), spatial vector) of Norm (mathematics), length 1. A unit vector is often denoted by a lowercase letter with a circumfle ...
s in
complex
Complex commonly refers to:
* Complexity, the behaviour of a system whose components interact in multiple ways so possible interactions are difficult to describe
** Complex system, a system composed of many components which may interact with each ...
dimensions, with the
complex Euclidean norm (the
2-norm
In mathematics, a norm is a function from a real or complex vector space to the non-negative real numbers that behaves in certain ways like the distance from the origin: it commutes with scaling, obeys a form of the triangle inequality, and ze ...
). The
basis vectors
In mathematics, a set of elements of a vector space is called a basis (: bases) if every element of can be written in a unique way as a finite linear combination of elements of . The coefficients of this linear combination are referred to as ...
(sometimes called ''
eigenstate
In quantum physics, a quantum state is a mathematical entity that embodies the knowledge of a quantum system. Quantum mechanics specifies the construction, evolution, and measurement of a quantum state. The result is a prediction for the system re ...
s'') are the possible outcomes if the state of the qubits is
measured, and a quantum state is a
linear combination
In mathematics, a linear combination or superposition is an Expression (mathematics), expression constructed from a Set (mathematics), set of terms by multiplying each term by a constant and adding the results (e.g. a linear combination of ''x'' a ...
of these outcomes. The most common quantum gates operate on
vector space
In mathematics and physics, a vector space (also called a linear space) is a set (mathematics), set whose elements, often called vector (mathematics and physics), ''vectors'', can be added together and multiplied ("scaled") by numbers called sc ...
s of one or two qubits, just like the common
classical logic gates operate on one or two
bit
The bit is the most basic unit of information in computing and digital communication. The name is a portmanteau of binary digit. The bit represents a logical state with one of two possible values. These values are most commonly represented as ...
s.
Even though the quantum logic gates belong to
continuous symmetry groups, real
hardware is inexact and thus limited in precision. The application of gates typically introduces errors, and the
quantum states' fidelities decrease over time. If
error correction
In information theory and coding theory with applications in computer science and telecommunications, error detection and correction (EDAC) or error control are techniques that enable reliable delivery of digital data over unreliable communi ...
is used, the usable gates are further restricted to a finite set. Later in this article, this is ignored as the focus is on the ideal quantum gates' properties.
Quantum states are typically represented by "kets", from a notation known as
bra–ket.
The vector representation of a single
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 ...
is
:
Here,
and
are the complex
probability amplitude
In quantum mechanics, a probability amplitude is a complex number used for describing the behaviour of systems. The square of the modulus of this quantity at a point in space represents a probability density at that point.
Probability amplitu ...
s of the qubit. These values determine the probability of measuring a 0 or a 1, when measuring the state of the qubit. See
measurement
Measurement is the quantification of attributes of an object or event, which can be used to compare with other objects or events.
In other words, measurement is a process of determining how large or small a physical quantity is as compared to ...
below for details.
The value zero is represented by the ket and the value one is represented by the ket
The
tensor product
In mathematics, the tensor product V \otimes W of two vector spaces V and W (over the same field) is a vector space to which is associated a bilinear map V\times W \rightarrow V\otimes W that maps a pair (v,w),\ v\in V, w\in W to an element of ...
(or
Kronecker product
In mathematics, the Kronecker product, sometimes denoted by ⊗, is an operation on two matrices of arbitrary size resulting in a block matrix. It is a specialization of the tensor product (which is denoted by the same symbol) from vector ...
) is used to combine quantum states. The combined state for a
qubit register is the tensor product of the constituent qubits. The tensor product is denoted by the symbol
The vector representation of two qubits is:
:
The action of the gate on a specific quantum state is found by
multiplying
Multiplication is one of the four elementary mathematical operations of arithmetic, with the other ones being addition, subtraction, and division. The result of a multiplication operation is called a '' product''. Multiplication is often de ...
the vector
, which represents the state by the matrix
representing the gate. The result is a new quantum state
:
Relation to the time evolution operator
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 ...
describes how quantum systems that are not
observed evolve over time, and is
When the system is in a stable environment, so it has a constant
Hamiltonian
Hamiltonian may refer to:
* Hamiltonian mechanics, a function that represents the total energy of a system
* Hamiltonian (quantum mechanics), an operator corresponding to the total energy of that system
** Dyall Hamiltonian, a modified Hamiltonian ...
, the solution to this equation is
If the time
is always the same it may be omitted for simplicity, and the way quantum states evolve can be described as
just as in the above section.
That is, a quantum gate is how a quantum system that is not observed evolves over some specific time, or equivalently, a gate is the unitary
time evolution
Time evolution is the change of state brought about by the passage of time, applicable to systems with internal state (also called ''stateful systems''). In this formulation, ''time'' is not required to be a continuous parameter, but may be discr ...
operator
acting on a quantum state for a specific duration.
Notable examples
There exists an
uncountably infinite
In mathematics, an uncountable set, informally, is an infinite set that contains too many elements to be countable. The uncountability of a set is closely related to its cardinal number: a set is uncountable if its cardinal number is larger tha ...
number of gates. Some of them have been named by various authors,
and below follow some of those most often used in the literature.
Identity gate
The identity gate is the
identity matrix
In linear algebra, the identity matrix of size n is the n\times n square matrix with ones on the main diagonal and zeros elsewhere. It has unique properties, for example when the identity matrix represents a geometric transformation, the obje ...
, usually written as ''I'', and is defined for a single qubit as
:
where ''I'' is basis independent and does not modify the quantum state. The identity gate is most useful when describing mathematically the result of various gate operations or when discussing multi-qubit circuits.
Pauli gates (''X'',''Y'',''Z'')
The Pauli gates
are the three
Pauli matrices
In mathematical physics and mathematics, the Pauli matrices are a set of three complex matrices that are traceless, Hermitian, involutory and unitary. Usually indicated by the Greek letter sigma (), they are occasionally denoted by tau () ...
and act on a single qubit. The Pauli ''X'', ''Y'' and ''Z'' equate, respectively, to a rotation around the ''x'', ''y'' and ''z'' axes of the
Bloch sphere
In quantum mechanics and computing, the Bloch sphere is a geometrical representation of the pure state space of a two-level quantum mechanical system ( qubit), named after the physicist Felix Bloch.
Mathematically each quantum mechanical syst ...
by
radians.
The Pauli-''X'' gate is the quantum equivalent of the
NOT gate
Not or NOT may also refer to:
Language
* Not, the general declarative form of "no", indicating a negation of a related statement that usually precedes
* ... Not!, a grammatical construction used as a contradiction, popularized in the early 1990 ...
for classical computers with respect to the standard basis which distinguishes the ''z'' axis on the
Bloch sphere
In quantum mechanics and computing, the Bloch sphere is a geometrical representation of the pure state space of a two-level quantum mechanical system ( qubit), named after the physicist Felix Bloch.
Mathematically each quantum mechanical syst ...
. It is sometimes called a bit-flip as it maps
to
and
to
. Similarly, the Pauli-''Y'' maps
to
and
to . Pauli ''Z'' leaves the basis state
unchanged and maps
to Due to this nature, Pauli ''Z'' is sometimes called phase-flip.
These matrices are usually represented as
:
:
:
The Pauli matrices are
involutory, meaning that the square of a Pauli matrix is the
identity matrix
In linear algebra, the identity matrix of size n is the n\times n square matrix with ones on the main diagonal and zeros elsewhere. It has unique properties, for example when the identity matrix represents a geometric transformation, the obje ...
.
:
The Pauli matrices also
anti-commute
In mathematics, anticommutativity is a specific property of some non-commutative mathematical operations. Swapping the position of two arguments of an antisymmetric operation yields a result which is the ''inverse'' of the result with unswapped ...
, for example
The
matrix exponential
In mathematics, the matrix exponential is a matrix function on square matrix, square matrices analogous to the ordinary exponential function. It is used to solve systems of linear differential equations. In the theory of Lie groups, the matrix exp ...
of a Pauli matrix
is a
rotation operator, often written as
Controlled gates
Controlled gates act on 2 or more qubits, where one or more qubits act as a control for some operation.
For example, the
controlled NOT gate
In computer science, the controlled NOT gate (also C-NOT or CNOT), controlled-''X'' gate, controlled-bit-flip gate, Feynman gate or controlled Pauli-X is a quantum logic gate that is an essential component in the construction of a gate-based qu ...
(or CNOT or CX) acts on 2 qubits, and performs the NOT operation on the second qubit only when the first qubit is and otherwise leaves it unchanged. With respect to the basis it is represented by the
Hermitian {{Short description, none
Numerous things are named after the French mathematician Charles Hermite (1822–1901):
Hermite
* Cubic Hermite spline, a type of third-degree spline
* Gauss–Hermite quadrature, an extension of Gaussian quadrature me ...
unitary
Unitary may refer to:
Mathematics
* Unitary divisor
* Unitary element
* Unitary group
* Unitary matrix
* Unitary morphism
* Unitary operator
* Unitary transformation
* Unitary representation
* Unitarity (physics)
* ''E''-unitary inverse semigr ...
matrix:
:
The CNOT (or controlled Pauli-''X'') gate can be described as the gate that maps the basis states
, where
is
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 ...
.
The CNOT can be expressed in the
Pauli basis as:
:
Being a Hermitian unitary operator, CNOT
has the property that
and
, and is
involutory.
More generally if ''U'' is a gate that operates on a single qubit with matrix representation
:
then the ''controlled-U gate'' is a gate that operates on two qubits in such a way that the first qubit serves as a control. It maps the basis states as follows.
:
:
:
:
The matrix representing the controlled ''U'' is
:
When ''U'' is one of the Pauli operators, ''X'',''Y'', ''Z'', the respective terms "controlled-''X''", "controlled-''Y''", or "controlled-''Z''" are sometimes used. Sometimes this is shortened to just C''X'', C''Y'' and C''Z''.
In general, any single qubit
unitary gate can be expressed as
, where ''H'' is a
Hermitian matrix
In mathematics, a Hermitian matrix (or self-adjoint matrix) is a complex square matrix that is equal to its own conjugate transpose—that is, the element in the -th row and -th column is equal to the complex conjugate of the element in the ...
, and then the controlled ''U'' is
Control can be extended to gates with arbitrary number of qubits
and functions in programming languages.
Functions can be conditioned on superposition states.
Classical control

Gates can also be controlled by classical logic. A quantum computer is controlled by a
classical computer, and behaves like a
coprocessor
A coprocessor is a computer processor used to supplement the functions of the primary processor (the CPU). Operations performed by the coprocessor may be floating-point arithmetic, graphics, signal processing, string processing, cryptography or ...
that receives instructions from the classical computer about what gates to execute on which qubits.
Classical control is simply the inclusion, or omission, of gates in the instruction sequence for the quantum computer.
Phase shift gates
The phase shift is a family of single-qubit gates that map the basis states
and
. The probability of measuring a
or
is unchanged after applying this gate, however it modifies the phase of the quantum state. This is equivalent to tracing a horizontal circle (a line of constant latitude), or a rotation about the z-axis on the
Bloch sphere
In quantum mechanics and computing, the Bloch sphere is a geometrical representation of the pure state space of a two-level quantum mechanical system ( qubit), named after the physicist Felix Bloch.
Mathematically each quantum mechanical syst ...
by
radians. The phase shift gate is represented by the matrix:
:
where
is the ''phase shift'' with the
period
Period may refer to:
Common uses
* Period (punctuation)
* Era, a length or span of time
*Menstruation, commonly referred to as a "period"
Arts, entertainment, and media
* Period (music), a concept in musical composition
* Periodic sentence (o ...
. Some common examples are the ''T'' gate where
(historically known as the
gate), the phase gate (also known as the S gate, written as ''S'', though ''S'' is sometimes used for SWAP gates) where
and the
Pauli-''Z'' gate where
The phase shift gates are related to each other as follows:
:
:
: