nLab controlled quantum gate




Quantum systems

quantum logic

quantum physics

quantum probability theoryobservables and states

quantum information

quantum computation

quantum algorithms:



In quantum information theory, a controlled quantum gate is a quantum gate whose operation on a given space of states is conditioned on the data in another space of “control states”.

The conceptual problem

The analogous situation for classical logic gates is without subtlety: Here the parameterization of a logic gate on (n in,n out)(n_{in}, n_{out})-bits by n ctrln_{ctrl} control bits is a choice of function

Bool n ctrlF Map(Bool n in,Bool n out) Bool^{n_{ctrl}} \xrightarrow{\;\;\; F_{\bullet} \;\;\;} Map \big( Bool^{n_{in}} ,\, Bool^{n_{out}} \big)

from the intended set of controls to the set of functions between the intended input/output; and by the internal hom-adjunction in the cartesian monoidal category of Sets this is in bijective correspondence with a single function out of the Cartesian product set of the control bits with the input bits:

Bool n ctrl+n in Bool n ctrl×Bool n in Bool n out (b ctrl,b in) F b ctrl(b in). \array{ Bool^{ n_{ctrl} + n_{in} } &\simeq& Bool^{ n_{ctrl} } \times Bool^{ n_{in} } &\xrightarrow{\;\;\;}& Bool^{ n_{out} } \\ && ( b_{ctrl}, b_in ) &\mapsto& F_{b_{ctrl}}\big( b_{in} \big) } \,.

This function would/could be called the “controlled logic gate”. Notice that the control bits in the above function are “discarded after use”, in that they cannot in general be recovered from the output of the above function.

The subtleties with generalizing this situation to quantum logic gates is:

  1. The control of quantum gates may be either by quantum data or by classical data, which is not quite the same.

    (In a quantum-controlled quantum logic gate, the control itself may be in a quantum superposition, while a classically-controlled quantum gate is effectively an indexed set of quantum gates, indexed by classical data.)

  2. A quantum-controlled quantum gate should, like any pure quantum logic gate, be unitary, in particular invertible, hence it “must not discard” its control qbits.

    This rules out the otherwise evident non-cartesian analog of the above classical situation (with the product operation replaced by the non-cartesian tensor product of finite-dimensional Hilbert spaces, typically, and hence with the internal hom now being the corresponding linear space of linear maps)):

    QBit n ctrlF Map(QBit n,QBit n)QBit n ctrlQBit nQBit n \frac{ QBit^{n_{ctrl}} \xrightarrow{\;\;\; F_\bullet \;\;\;} Map \big( QBit^{ n } ,\, QBit^{ n } \big) }{ QBit^{n_{ctrl}} \otimes QBit^{n} \xrightarrow{\phantom{----}} QBit^{ n } }

    While the linear map at the bottom always exists, it cannot be invertible (unless the control is trivial, with n ctrl=0n_{ctrl} = 0, or the state space is trivial, with n=0n = 0) and hence does not qualify as a quantum logic gate.

The traditional notion

A general and precise definition of controlled quantum gates is hard to find in traditional literature (cf. Gurevich & Blass (2021) §1).

What traditional texbooks state (e.g. Nielsen & Chuang (2000) §4.3) is that for

G:𝒦𝒦 G \;\colon\; \mathscr{K} \longrightarrow \mathscr{K}

a given quantum logic gate, its version controlled by a single qbit is its direct sum with the identity map, which may be thought of as the block-diagonal matrix-notation with diagonal blocks being GG and the identity function:

()QBit𝒦𝒦𝒦idG=[id 0 0 G]𝒦𝒦()QBit𝒦 \underset{ QBit }{ \underbrace{ (\mathbb{C} \oplus \mathbb{C}) } } \otimes \mathscr{K} \;\simeq\; \mathscr{K} \oplus \mathscr{K} \xrightarrow{ \; id \oplus G \,=\, \left[ \begin{array}{cc} id & 0 \\ 0 & G \end{array} \right] \; } \mathscr{K} \oplus \mathscr{K} \;\simeq\; \underset{ QBit }{ \underbrace{ (\mathbb{C} \oplus \mathbb{C}) } } \otimes \mathscr{K}

If we understand, as usual, that

QBit|0|1 QBit \;\;\simeq\;\; \mathbb{C}\cdot \vert 0 \rangle \;\oplus\; \mathbb{C}\cdot \vert 1 \rangle

then this gives a (invertible!) quantum gate on the tensor product space QBit𝒦QBit \otimes \mathscr{K}, with the property that

  1. |0|ψ|0G|ψ\vert 0 \rangle \,\otimes\, \vert \psi \rangle \;\;\mapsto\;\; \vert 0 \rangle \,\otimes\, \phantom{G}\vert \psi \rangle

  2. |1|ψ|0G|ψ\vert 1 \rangle \,\otimes\, \vert \psi \rangle \;\;\mapsto\;\; \vert 0 \rangle \,\otimes\, G\vert \psi \rangle

In words: “If the control Qbit is definitely set, then we operate with the GG, if it is definitely not set then we operate trivially, and in general we operate with the respective superposition of these two actions.

A basic example of this construction is the controlled quantum NOT gate.


The following is a more general definition along the lines of quantum circuits via dependent linear types.

Given a (finite) set BB of “control parameter values” (typically B=B = Bool = {0,1}\{0, 1\}), a BB-indexed set of quantum logic gates is a morphism

G b:B b G b b \begin{array}{rccc} & \mathscr{H}_\bullet & \xrightarrow{\;\;\; G_\bullet \;\;\;} & \mathscr{H}_\bullet \\ b \colon B \;\; \vdash \; & \mathscr{H}_b & \xrightarrow{\;\;\; G_b \;\;\;} & \mathscr{H}_b \end{array}

in a category LinType BLinType_B of BB-dependent linear types (typically: complex vector bundles over BB), which is fiber-wise a linear map G bG_b with given desired properties (invertible, unitary, …).

As such, we may call this the classically controlled quantum gate, whose classical control parameter is bBb \in B and whose quantum gate action for a given such parameter is G bG_b.

Typically the state spaces \mathscr{H}_\bullet are independent of b:Bb \colon B, say equal to some 𝒦,\mathscr{K}, and only the quantum gates operating on a fixed state space \mathscr{H} varies with the control parameter.

In this case, if we denote by

(p B) *𝟙, B \mathscr{B}_\bullet \;\coloneqq\; (p_B)^\ast \mathbb{1} \,,\;\;\; \mathscr{B} \;\coloneqq\; \Box_B \mathscr{B}_\bullet

the quantum state space(s) of the control parameter, then a classically BB-controlled quantum gate is equivalently a morphism in LinType BLinType_B between the external tensor products of \mathscr{B}_\bullet with 𝒦\mathscr{K}:

𝒦 𝒦 b:B 𝒦 G b 𝒦 \array{ & \mathscr{B}_\bullet \boxtimes \mathscr{K} & \xrightarrow{\phantom{----}} & \mathscr{B}_\bullet \boxtimes \mathscr{K} \\ b \colon B \;\; \vdash & \mathscr{K} & \xrightarrow{\phantom{--}G_b\phantom{--}} & \mathscr{K} }

On the other hand, the corresponding quantumly-controlled quantum gate is the image of this under the necessity-comonad (in terms of quantum modal logic, see here), hence under direct sum:

(1) BG : B b:B bb:BG bb:B b B \Box_B G_\bullet \;\colon\; \Box_B \mathscr{H}_\bullet \;\simeq\; \underset{b \colon B}{\bigoplus} \mathscr{H}_b \xrightarrow{ \;\;\; \underset{b \colon B}{\oplus} G_b \;\;\; } \underset{b \colon B}{\bigoplus} \mathscr{H}_b \;\simeq\; \Box_B \mathscr{H}_\bullet




Traditional textbook accounts of controlled quantum gates:

See also at:

Discussion in terms of quantum information theory via dagger-compact categories (cf. at quantum reader monad):

The above discussion and graphics follows:

Last revised on November 13, 2022 at 09:04:42. See the history of this page for a list of all contributions to it.