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 other actions. The minimum set of actions that a circuit needs to be able to perform on the qubits to enable quantum computation is known as DiVincenzo's criteria. Circuits are written such that the horizontal axis is time, starting at the left hand side and ending at the right. Horizontal lines are qubits, doubled lines represent classical bits. The items that are connected by these lines are operations performed on the qubits, such as measurements or gates. These lines define the sequence of events, and are usually not physical cables. The graphical depiction of quantum circuit elements is described using a variant of the Penrose graphical notation. Richard Feynman used an early version of the quantum circuit notation in 1986.
Reversible classical logic gates Most elementary logic gates of a classical computer are not reversible. Thus, for instance, for an AND gate one cannot always recover the two input bits from the output bit; for example, if the output bit is 0, we cannot tell from this whether the input bits are 01 or 10 or 00. However, reversible gates in classical computers are easily constructed for bit strings of any length; moreover, these are actually of practical interest, since irreversible gates must always increase physical entropy. A reversible gate is a reversible function on n-bit data that returns n-bit data, where an n-bit data is a string of bits x1,x2, ...,xn of length n. The set of n-bit data is the space {0,1}n, which consists of 2n strings of 0's and 1's. More precisely: an n-bit reversible gate is a bijective mapping f from the set {0,1}n of n-bit data onto itself. An example of such a reversible gate f is a mapping that applies a fixed permutation to its inputs. For reasons of practical engineering, one typically studies gates only for small values of n, e.g. n=1, n=2 or n=3. These gates can be easily described by tables.
Quantum logic gates The quantum logic gates are reversible unitary transformations on at least one qubit. Multiple qubits taken together are referred to as quantum registers. To define quantum gates, we first need to specify the quantum replacement of an n-bit datum. The quantized version of classical n-bit space {0,1}n is the Hilbert space
H QB ( n ) = ℓ 2 ( { 0 , 1 } n ) . {\displaystyle H_{\operatorname {QB} (n)}=\ell ^{2}(\{0,1\}^{n}).}
This is by definition the space of complex-valued functions on {0,1}n and is naturally an inner product space. ℓ 2 {\displaystyle \ell ^{2}} means the function is a square-integrable function. This space can also be regarded as consisting of linear combinations, or superpositions, of classical bit strings. Note that HQB(n) is a vector space over the complex numbers of dimension 2n. The elements of this vector space are the possible state-vectors of n-qubit quantum registers. Using Dirac ket notation, if x1,x2, ...,xn is a classical bit string, then
| x 1 , x 2 , ⋯ , x n ⟩ {\displaystyle |x_{1},x_{2},\cdots ,x_{n}\rangle \quad }
is a special n-qubit register corresponding to the function which maps this classical bit string to 1 and maps all other bit strings to 0; these 2n special n-qubit registers are called computational basis states. All n-qubit registers are complex linear combinations of these computational basis states. Quantum logic gates, in contrast to classical logic gates, are always reversible. One requires a special kind of reversible function, namely a unitary mapping, that is, a linear transformation of a complex inner product space that preserves the Hermitian inner product. An n-qubit (reversible) quantum gate is a unitary mapping U from the space HQB(n) of n-qubit registers onto itself. Typically, we are only interested in gates for small values of n. A reversible n-bit classical logic gate gives rise to a reversible n-bit quantum gate as follows: to each reversible n-bit logic gate f corresponds a quantum gate Wf defined as follows:
W f ( | x 1 , x 2 , ⋯ , x n ⟩ ) = | f ( x 1 , x 2 , ⋯ , x n ) ⟩ . {\displaystyle W_{f}(|x_{1},x_{2},\cdots ,x_{n}\rangle )=|f(x_{1},x_{2},\cdots ,x_{n})\rangle .}
Note that Wf permutes the computational basis states. Of particular importance is the controlled NOT gate (also called CNOT gate) WCNOT defined on a quantized 2 qubit. Other examples of quantum logic gates derived from classical ones are the Toffoli gate and the Fredkin gate. However, the Hilbert-space structure of the qubits permits many quantum gates that are not induced by classical ones. For example, a relative phase shift is a 1 qubit gate given by multiplication by the phase shift operator:
… excerpt ends here. Continue reading the full article.

![Quantum circuit: Circuit that performs teleportation of a qubit.[1] This circuit consists of both quantum gates and measurements. Measurement is a quantum phenomenon that does not occur in classical circuits.](https://upload.wikimedia.org/wikipedia/commons/thumb/d/dc/Quantum_teleportation_circuit.svg/960px-Quantum_teleportation_circuit.svg.png?utm_source=en.wikipedia.org&utm_campaign=parser&utm_content=thumbnail)


