2.2.3 Controlled Gates

One-qubit gates are not enough for any useful quantum computation. In this subsection, we introduce an important class of multiple-qubit gates, namely the controlled gates.

The most frequently used among them is the CNOT operator C defined in Example 2.1.7. Here, we look at it in a different way. Let q1,q2 be qubit variables. Then C[q1,q2] is a two-qubit gate with q1 as the control qubit and q2 as the target qubit. It acts as follows:

C[q1,q2]|i1,i2=|i1,i1i2

si379_e

for i1,i2 ∈{0,1}, where ⊕ is addition modulo 2; that is, if q1 is set to |1〉, then q2 is flipped, otherwise q2 is left unchanged. As a simple generalization of ...

Get Foundations of Quantum Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.