# Multi-qubit gates

In *Chapter 1*, *New Ways to Think about Bits*, the classical AND gate has two input bits but only one output bit. When you deal with qubits, this never happens. In quantum computing, each qubit’s wire goes from the beginning to the very end of its circuit. This rule stems from the reversibility requirement that we described in *Chapter 3*, *Math for Qubits and **Quantum Gates*.

With a quantum gate, the number of outputs must equal the number of inputs. When two qubits pass through such a gate, the two qubits are affected. This chapter explores gates that deal with two or more qubits. In this section, we’ll describe several commonly used multi-qubit gates. Each of these gates is a building block in the construction of quantum computing algorithms.

## CNOT and flipped CNOT gates

A **controlled NOT** (**CNOT**) gate involves two qubits. We call one qubit the **control qubit** and the other the **target qubit**. The control qubit controls whether the target qubit’s...