Multi-Qubit Gates
Short Definition
Section titled “Short Definition”A multi-qubit gate is a joint operation on two or more qubits. An ideal -qubit unitary is a matrix
defined relative to an ordered tensor-product basis. Common families include:
- controlled gates such as CNOT and CZ;
- exchange gates such as SWAP and iSWAP;
- multiply controlled gates such as Toffoli;
- continuously parameterized interactions generated by two-qubit Hamiltonians.
Some multi-qubit primitives are measurements rather than unitaries. A parity measurement, for example, projects onto an even or odd subspace while ideally preserving coherence inside that subspace.
This page is the canonical home for common multi-qubit gates, their exact basis actions, entangling capability, and the distinction between logical, native, compiled, and measured operations. Operators on Composite Systems owns the tensor-product algebra, Bell States owns the resulting maximally entangled states, and Circuit Model owns wire order, composition, and resource accounting.
Fix the Ordered Basis
Section titled “Fix the Ordered Basis”For two qubits labeled and , this page uses
with computational basis order
The first bit labels and the second labels . A matrix, a circuit diagram, and a bitstring returned by software agree only after their ordering conventions are matched. Tensor Product Ordering is the convention anchor.
A gate acting independently on the factors has the form
A general joint gate need not factor this way. “Two-qubit gate” describes support, not entangling ability: SWAP acts jointly but never entangles a product input, while CNOT can entangle some product inputs but not others.
Controlled Unitaries
Section titled “Controlled Unitaries”Let be the control and the target. The controlled version of a one-qubit unitary is
In the stated basis, it has block form
The control is not measured. If it is in a superposition, the two control sectors evolve coherently and can become entangled with the target. Controlled Operations develops the semantic and evidence audit for projector-controlled blocks, open and multiple controls, multiplexed branches, branch-relative phases, and licensed access. Here the definition fixes the common gate families; Algorithmic Primitives owns oracle uses, and Gate Decomposition owns synthesis.
Global phases cannot be discarded before adding a control. If , then
so the phase becomes relative between the control sectors. Single-Qubit Gates gives the full phase analysis.
Controlled-NOT
Section titled “Controlled-NOT”The controlled-NOT gate, written CNOT, CX, or , acts as
where and is addition modulo two. Its matrix is
The first qubit controls the second. Reversing control and target gives a different matrix:
Entanglement from coherent control
Section titled “Entanglement from coherent control”On the product input ,
The output is maximally entangled. Yet CNOT does not entangle every product state: each computational-basis input remains a computational-basis product state.
CNOT is not a cloning gate
Section titled “CNOT is not a cloning gate”For an unknown state
CNOT with a blank target gives
This is generally entangled and is not
CNOT coherently copies a known computational-basis label. It does not clone an arbitrary quantum state.
Controlled-Z
Section titled “Controlled-Z”The controlled- gate applies a minus sign only to :
Equivalently,
Unlike the usual CNOT diagram, CZ is symmetric under exchanging the two qubits. Either qubit can be described as the control because the matrix depends only on the product .
CNOT and CZ have the same nonlocal content. Hadamard conjugation on the target gives
Thus they are locally equivalent. Which one is cheaper depends on the native interaction, calibration, connectivity, and surrounding circuit.
On , CZ produces
a maximally entangled two-qubit graph state.
SWAP exchanges the states assigned to two labeled subsystems:
Its matrix is
For arbitrary product states,
The output remains a product state, so SWAP has zero entangling capability. It is nevertheless not a product unitary ; it transfers the two unknown subsystem states jointly. This is the standard warning that nonlocal and entangling are not synonyms.
An ideal decomposition is
Read right to left as a matrix product. The corresponding circuit applies the same three gates from left to right because the first and last factors are identical. A compiler may choose a different decomposition when the hardware has a native exchange interaction or when qubit relabeling can replace a physical move.
iSWAP and Exchange Gates
Section titled “iSWAP and Exchange Gates”This page defines
while leaving and unchanged. Its matrix is
With this sign convention,
A Hamiltonian with the opposite sign generates the conjugate phase, often called or depending on notation. The matrix must accompany the name.
iSWAP is not merely SWAP times one global phase: the exchanged one-excitation states acquire , while the zero- and two-excitation states do not. It can entangle product inputs. For example,
which is maximally entangled.
Exchange-like interactions naturally produce continuous families such as
with angle and sign conventions that vary across platforms and software. Fractional exchange gates, including square-root variants, can be native entanglers even when a full SWAP is not the desired logical operation.
Toffoli Gate
Section titled “Toffoli Gate”The Toffoli gate is a controlled-controlled-NOT on three ordered qubits:
It flips the target only when both controls equal one. On computational-basis states it implements a reversible classical Boolean operation, but on superpositions it is a coherent quantum gate and can create entanglement. For example,
The second qubit factors as , while the first and third are entangled.
A Toffoli symbol in an algorithm does not imply a native three-body interaction. It is usually compiled into one- and two-qubit gates, possibly with clean or dirty ancillas. Exact gate counts depend on the basis set, connectivity, allowed relative phases, ancilla budget, and whether only a specific input subspace matters. A relative-phase Toffoli is not an exact Toffoli, even when it suffices inside a larger construction.
Common joint primitives separate into controlled, exchange, and measurement operations. SWAP is joint but product preserving; CNOT, CZ, iSWAP, and Toffoli can entangle suitable product inputs. In the parity circuit, two CNOTs write onto an ancilla without revealing which basis state occurred inside the even or odd sector.
Entangling Capability
Section titled “Entangling Capability”Capability is an existence statement
Section titled “Capability is an existence statement”A two-qubit unitary is entangling if there exists at least one product input
whose output is entangled. It need not entangle every product input.
For a pure two-qubit output
form the coefficient matrix
The state is product exactly when
This gives a quick gate test on a chosen input. It does not characterize the gate on all inputs.
| Operation | Product preserving for every input? | Can create entanglement? |
|---|---|---|
| yes | no | |
| SWAP | yes | no |
| CNOT | no | yes |
| CZ | no | yes |
| iSWAP | no | yes |
| Toffoli | no, across suitable three-qubit splits | yes |
Local equivalence
Section titled “Local equivalence”Two two-qubit unitaries have the same nonlocal content when they differ only by local pre- and post-rotations:
Local gates cannot create or destroy bipartite entanglement, so locally equivalent gates have the same optimal entangling capability. CNOT and CZ are the elementary example. iSWAP belongs to a different local-equivalence class even though it is also a perfect entangler.
SWAP supplies the important caveat: a gate may be nonproduct and operationally nonlocal while mapping every product state to another product state. Quantities based only on entanglement generated from product inputs assign SWAP zero even though it cannot be implemented as independent local unitaries.
Entangling power is a defined metric
Section titled “Entangling power is a defined metric”In the technical literature, entangling power often means an average
where is an entanglement measure and the integral uses a stated ensemble of product inputs. A numerical value is meaningless unless the measure, input distribution, and normalization are specified. “Can entangle,” “can create a maximally entangled state,” “has nonzero average entangling power,” and “is costly on a device” are four different claims.
Parity Measurements
Section titled “Parity Measurements”A two-qubit -parity measurement measures the observable
Its projectors are
The even subspace is spanned by and has eigenvalue . The odd subspace is spanned by and has eigenvalue .
An ancilla implementation initializes in , applies
then measures in the computational basis. For a basis input , the ancilla records
The ideal outcome-resolved state update is
where and .
Coarse parity is not two separate readouts
Section titled “Coarse parity is not two separate readouts”An ideal parity measurement reveals only even versus odd. It preserves coherence within the selected subspace. For example,
has even parity with certainty and is unchanged by an ideal nondemolition parity measurement.
Measuring and separately reveals whether the state was or and therefore destroys their coherence. Forgetting the two fine-grained records afterward does not undo that disturbance. The distinction is essential in stabilizer readout and measurement-induced entanglement.
A parity measurement is not a unitary gate on the data alone. It is an instrument with a classical outcome and a conditional state update. Hardware may realize it through an ancilla circuit, a shared resonator, a detector coupling, or another native joint measurement. Quantum Instruments owns the general formalism.
Pauli Group and Stabilizers treats signed Hermitian Pauli strings as algebraic checks and audits their common sectors and commutation signatures; this page retains outcome-resolved parity instruments and their elementary ancilla circuits. Syndrome Measurement owns signed stabilizer-check protocols, ordered circuit-fault propagation, repeated outcomes, and detector-record construction.
Native, Compiled, and Routed Gates
Section titled “Native, Compiled, and Routed Gates”A circuit symbol names a logical operation. Hardware evolves under a platform-specific Hamiltonian and control schedule. Common idealized interactions include
Local rotations and echoed segments can convert these interactions into CNOT-like, CZ-like, or exchange-like logical gates. The same CNOT symbol may therefore mean:
- a native calibrated instruction;
- a short composite pulse sequence;
- a CZ plus local Hadamards;
- an interaction gate plus several frame changes;
- a logical operation synthesized fault tolerantly.
Those implementations need not have the same duration, leakage, crosstalk, directionality, or error channel.
Connectivity also matters. If two logical qubits are not adjacent in the coupling graph, a compiler may route their states using SWAPs, teleportation-based primitives, movable carriers, or dynamic relabeling. Reporting only the abstract CNOT count can hide the dominant routing cost.
Resource claims need a contract
Section titled “Resource claims need a contract”When comparing decompositions, state:
- the exact target, including allowed global or relative phases;
- the native gate alphabet and continuous parameters;
- directed or undirected connectivity;
- whether parallel gates are allowed;
- ancilla number, initialization, and reset assumptions;
- whether measurement and feedforward are available;
- the error metric and approximation tolerance;
- whether counts are logical, compiled, scheduled, or physical.
“Toffoli costs six CNOTs” or “SWAP costs three CNOTs” is a statement inside one ideal gate model, not a hardware-independent law.
Common Mistakes
Section titled “Common Mistakes”- Comparing two-qubit matrices without fixing basis and tensor-factor order.
- Reversing CNOT control and target.
- Treating a coherent control wire as a classical if-statement.
- Saying CNOT clones an arbitrary qubit because it copies basis labels.
- Assuming every joint or nonlocal gate is entangling; SWAP is the counterexample.
- Treating iSWAP and SWAP as equal up to one global phase.
- Ignoring the sign convention in an exchange-generated iSWAP.
- Calling CZ directional even though its ideal matrix is symmetric.
- Replacing a parity measurement by separate one-qubit measurements and then discarding the extra records.
- Dropping a one-qubit gate phase before constructing its controlled version.
- Equating a logical gate symbol with one calibrated pulse.
- Quoting gate counts without connectivity, ancilla, phase, or tolerance assumptions.
Exercises
Section titled “Exercises”1. CNOT on a general state
Section titled “1. CNOT on a general state”Apply to
Solution
The control-zero amplitudes are unchanged. In the control-one sector, the target labels are exchanged:
This also shows why reversing control and target changes the coordinate matrix.
2. Coherent copying and no-cloning
Section titled “2. Coherent copying and no-cloning”Show that CNOT maps to a Bell state. Explain why the result is not two copies of .
Solution
Linearity and the two relevant basis-state mappings give
This is , whose one-qubit reduced states are maximally mixed. Two copies would be
a product state. CNOT copied the computational-basis branch label into correlations; it did not clone the superposition.
3. Convert CNOT to CZ
Section titled “3. Convert CNOT to CZ”Prove
using the controlled-unitary form rather than multiplying matrices.
Solution
Write
Conjugating the target by gives
The identity is the one-qubit basis change.
4. Decompose SWAP
Section titled “4. Decompose SWAP”Track bits through
and show that the sequence implements SWAP. Why does this not contradict the fact that each CNOT can entangle?
Solution
Starting from , the successive labels are
Thus the composite is SWAP on every computational-basis state and therefore, by linearity, on every input.
Entangling capability is not additive gate by gate. Intermediate states may be entangled and later disentangled. The exact three-gate product maps every product input to the exchanged product state.
5. Test iSWAP entanglement
Section titled “5. Test iSWAP entanglement”Use the coefficient-matrix criterion to show that is maximally entangled.
Solution
The output coefficient matrix is
Its determinant is
so the state is not product. For a normalized pure two-qubit state, the concurrence is
Therefore the output is maximally entangled. The conclusion depends on the matrix convention for iSWAP, although changing all signs by complex conjugation leaves this entanglement value unchanged.
6. Preserve parity coherence
Section titled “6. Preserve parity coherence”Compare an ideal parity measurement with separate and measurements on .
Solution
Both components of
have even parity. Hence
The ideal parity outcome is certainly even and the coherent Bell state is preserved.
Separate computational-basis measurements return or , each with probability . If those records are ignored, the state is
with no off-diagonal coherence. Coarse-graining classical records after a finer measurement is not equivalent to performing the coarse quantum measurement.
7. Toffoli as an entangler
Section titled “7. Toffoli as an entangler”Apply Toffoli to and compute the reduced state of the first qubit.
Solution
The output is
Tracing out and gives
The full state is pure while is mixed, so is entangled with . The second control remains a product factor.
Where to Go Next
Section titled “Where to Go Next”- Single-Qubit Gates fixes one-qubit matrices, rotation signs, phase conventions, and Euler synthesis.
- Circuit Model defines gate embedding, time order, dynamic circuits, and resource counts.
- Reversible Computation uses Toffoli and Fredkin as reversible classical primitives while tracking constants, garbage, and uncomputation; this page retains their gate actions, entangling behavior, and compilation caveats.
- Universal Gate Sets explains which local and entangling families are exactly or approximately universal.
- Gate Decomposition develops controlled-unitary constructions, Cartan/KAK synthesis, native local equivalence, Pauli rotations, and generic multiqubit reductions.
- Qubit Mapping and Routing explains how SWAPs, bridges, direction corrections, physical transport, and teleportation legalize multi-qubit interactions on constrained hardware.
- Pulse-Level Control binds native entangling semantics to calibrated concurrent controls, timing resources, crosstalk context, and executable pulse records.
- Operators on Composite Systems supplies local embeddings, product operators, and controlled block forms.
- Tensor Product Ordering prevents control-target and basis-index reversals.
- Bell States develops the maximally entangled outputs used in the examples.
- Quantum Teleportation combines an inverse Bell transform, two measurements, classical feed-forward, and Pauli corrections into an identity channel.
- Superdense Coding uses local Pauli encoding followed by the same inverse Bell transform to decode two classical bits.
- Local Unitary Equivalence treats state equivalence under independent subsystem rotations.
- Quantum Instruments gives the outcome-resolved framework for parity measurements.
- Quantum Gates Formula Card and Quantum Gates Reference Table provide compact lookup forms.
- Quantum Information Roadmap places multi-qubit gates before universality, algorithms, and error correction.
References
Section titled “References”- M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information, 10th anniversary ed., Cambridge University Press, 2010, doi:10.1017/CBO9780511976667.
- A. Barenco, C. H. Bennett, R. Cleve, D. P. DiVincenzo, N. Margolus, P. Shor, T. Sleator, J. A. Smolin, and H. Weinfurter, “Elementary gates for quantum computation,” Physical Review A 52, 3457–3467, 1995, doi:10.1103/PhysRevA.52.3457.
- T. Toffoli, “Reversible computing,” in Automata, Languages and Programming, Lecture Notes in Computer Science 85, Springer, 1980, doi:10.1007/3-540-10003-2_104.
- P. Zanardi, C. Zalka, and L. Faoro, “Entangling power of quantum evolutions,” Physical Review A 62, 030301(R), 2000, doi:10.1103/PhysRevA.62.030301.
- N. Schuch and J. Siewert, “Natural two-qubit gate for quantum computation using the XY interaction,” Physical Review A 67, 032301, 2003, doi:10.1103/PhysRevA.67.032301.
- Y. Makhlin, “Nonlocal properties of two-qubit gates and mixed states, and the optimization of quantum computations,” Quantum Information Processing 1, 243–252, 2002, doi:10.1023/A:1022144002391.
- D. Ristè, M. Dukalski, C. A. Watson, G. de Lange, M. J. Tiggelman, Ya. M. Blanter, K. W. Lehnert, R. N. Schouten, and L. DiCarlo, “Deterministic entanglement of superconducting qubits by parity measurement and feedback,” Nature 502, 350–354, 2013, doi:10.1038/nature12513.
- D. P. DiVincenzo, “The physical implementation of quantum computation,” Fortschritte der Physik 48, 771–783, 2000, doi:10.1002/1521-3978(200009)48:9/11%3C771::AID-PROP771%3E3.0.CO;2-E.
- J. Preskill, Lecture Notes for Physics 219/Computer Science 219: Quantum Computation, Chapter 5, California Institute of Technology, course materials.