For example, the reversible Toffoli gate can implement all Boolean functions, often at the cost of having to use ancilla bits.
The current notation for quantum gates was developed by many of the founders of quantum information science including Adriano Barenco, Charles Bennett, Richard Cleve, David P. DiVincenzo, Norman Margolus, Peter Shor, Tycho Sleator, John A. Smolin, and Harald Weinfurter,[2] building on notation introduced by Richard Feynman in 1986.
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.
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.
Control can be extended to gates with arbitrary number of qubits[2] and functions in programming languages.
[13]: 42–43 [14] Classical control is simply the inclusion, or omission, of gates in the instruction sequence for the quantum computer.
This is equivalent to tracing a horizontal circle (a line of constant latitude), or a rotation about the z-axis on the Bloch sphere by
To solve this problem, we only require that any quantum operation can be approximated by a sequence of gates from this finite set.
, thus showing that all reversible classical logic operations can be performed on a universal quantum computer.
[1]: 93 This feature is exclusive to quantum circuits, as there is no classical two-bit gate that is both reversible and universal.
[1]: 93 Universal two-qubit gates could be implemented to improve classical reversible circuits in fast low-power microprocessors.
) behaves like a NOP[23][24] and can be represented as bare wire in quantum circuits, or not shown at all.
This means that negative exponents of gates are unitary inverses of their positively exponentiated counterparts:
, the Hadamard transform puts the quantum register into a superposition with equal probability of being measured in any of its
Special care must be taken when applying gates to constituent qubits that make up entangled states.
For this reason it is believed to be intractable to simulate large entangled quantum systems using classical computers.
Storing the probability amplitudes as a list of floating point values is not tractable for large
For example, an algorithm for addition can be used for subtraction, if it is being "run in reverse", as its unitary inverse.
Unlike with the bits of classical computers, quantum states can have non-zero probability amplitudes in multiple measurable values simultaneously.
Measurement is then a probabilistic projection of the points at the surface of this complex sphere onto the basis vectors that span the space (and labels the outcomes).
The number of dimensions (defined by the basis vectors, and thus also the possible outcomes from measurement) is then often implied by the operands, for example as the required state space for solving a problem.
[34][35][36] That the phenomena appears to happen instantaneously as opposed to the time it would take to traverse the distance separating the qubits at the speed of light is called the EPR paradox, and it is an open question in physics how to resolve this.
The equality will hold no matter in which order measurement is performed (on the registers A or B), assuming that F has run to completion.
Even though the equalities holds, the probabilities for measuring the possible outcomes may change as a result of applying F, as may be the intent in a quantum search algorithm.
This effect of value-sharing via entanglement is used in Shor's algorithm, phase estimation and in quantum counting.
For the general case with a large number of qubits this direct approach to circuit synthesis is intractable.
[38][39] This puts a limit on how large functions can be brute-force factorized into primitive quantum gates.
Because of the gates unitary nature, all functions must be reversible and always be bijective mappings of input to output.
Entanglement swapping can then be used to realize distributed algorithms with quantum computers that are not directly connected.
Common quantum logic gates by name (including abbreviation), circuit form(s) and the corresponding unitary matrices
Example:
The qubit
is
measured
, and the result of this measurement is a
Boolean
value, which is consumed by the classical computer. If
measures to 1, then the classical computer tells the quantum computer to apply the U gate on
.
In circuit diagrams, single lines are
qubits
, and doubled lines are
bits
.
Circuit representation of Hadamard gate
Circuit representation of SWAP gate
Circuit representation of Toffoli gate
Both CNOT and
are universal two-qubit gates and can be transformed into each other.
Two gates
Y
and
X
in series. The order in which they appear on the wire is reversed when multiplying them together.
Two gates
and
in parallel is equivalent to the gate
.
The example given in the text. The Hadamard gate
only act on 1 qubit, but
is an entangled quantum state that spans 2 qubits. In our example,
.
Example:
The unitary inverse of the Hadamard-CNOT product. The three gates
,
and
are their own unitary inverses.
Circuit representation of measurement. The two lines on the right hand side represent a classical bit, and the single line on the left hand side represents a qubit.
For a single qubit, we have a unit sphere in
with the quantum state
such that
.
The state can be re-written as
,
or
and
.
Note:
is the probability of measuring
and
is the probability of measuring
.
The Bell state in the text is
where
and
.
Therefore, it can be described by the
plane
spanned by the
basis vectors
and
,
as in the picture. The
unit sphere
(in
)
that represent the possible
value-space
of the 2-qubit system intersects the plane and
lies on the unit spheres surface. Because
,
there is equal probability of measuring this state to
or
,
and because
there is zero probability of measuring it to
or
.
The effect of a unitary transform F on a register A that is in a superposition of
states and pairwise entangled with the register B. Here,
n
is 3 (each register has 3 qubits).
A quantum
full adder
, given by Feynman in 1986.
[
3
]
It consists of only
Toffoli
and
CNOT
gates. The gate that is surrounded by the dotted square in this picture can be omitted if
uncomputation
to restore the
B output
is not required.
The generated circuit, when
. The symbols
,
and
denotes
XOR
,
AND
and
NOT
respectively, and comes from the Boolean representation of Pauli-
X
with zero or more control qubits when applied to states that are in the computational basis.