Multi-Qubit Gates
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.
The examples below show how to read a joint matrix, distinguish exchanging states from creating entanglement, and measure a collective observable without resolving its individual components.
Helpful background. The circuit model fixes composition and wire order; single-qubit gates supplies the local rotations used in the decompositions.
Two-qubit gates in an ordered basis
Section titled “Two-qubit gates in an 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 explains how to translate between these conventions.
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 explains multiple controls and more general coherent branches.
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. Thus SWAP creates no entanglement from product inputs on and alone. It is nevertheless not a product unitary : it exchanges two unknown states. The qualification about inputs matters. If each qubit is initially entangled with a local ancilla, SWAP can create entanglement between the two laboratories; Exercise 2 shows how.
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,
Reversing the Hamiltonian sign produces : its off-diagonal entries become , while its two diagonal entries remain . This is not the literal matrix , which would also negate the diagonal entries. Always check the matrix convention.
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
Here and . Angle and sign conventions 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.
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 | Preserves every product input? | Can entangle a product input? |
|---|---|---|
| yes | no | |
| SWAP | yes | no |
| CNOT | no | yes |
| CZ | no | yes |
| iSWAP | no | yes |
| Toffoli | no, across suitable three-qubit splits | yes |
The table refers to product inputs on the displayed qubits, without additional local ancillas.
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 , for outcomes of nonzero probability. This circuit realizes the Lüders instrument. The two parity probabilities alone do not determine the state update: other instruments with the same outcome probabilities may disturb states inside each parity subspace.
The ancilla starts in . Its final bit reveals only parity. In the even sector, and leave the same ancilla state, so no information distinguishes their amplitudes. Separate data-qubit readouts distinguish those amplitudes and remove their coherence, even if only parity is later retained.
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 an instrument with a classical outcome and a conditional state update, rather than a unitary gate on the data alone. Hardware can realize it through an ancilla, a shared resonator or another joint detector coupling. The same distinction between a collective check and individual readouts underlies stabilizers and syndrome measurement.
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.
A decomposition count should specify its gate alphabet, connectivity, ancillas, measurement access and approximation tolerance. For example, the three-CNOT SWAP above is an exact construction in that ideal alphabet; it is not a lower bound on pulse count for a device with a direct exchange interaction. Gate decomposition and qubit routing develop these practical differences.
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. SWAP with local ancillas
Section titled “2. SWAP with local ancillas”Alice holds in a Bell state and Bob holds in another Bell state. The two laboratories are initially unentangled. What happens to their shared entanglement when SWAP exchanges and ?
Solution
In the fixed order , the initial state is
After SWAP on , it becomes
Now is Bell-paired with and with . Alice’s reduced state is , with entropy two bits, so the laboratories share two ebits. There is no contradiction with the product-input test on : that test does not allow the initially correlated local ancillas used here.
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
The labels here remain ordered . Qubit is fixed in , while is a Bell pair. Tracing out and gives
The full state is pure while is mixed, so is entangled with . The second control remains a product factor.
References
Section titled “References”- 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.
- 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.
- 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.
- M. A. Nielsen and I. L. Chuang, Quantum Computation and Quantum Information, 10th anniversary ed., Cambridge University Press, 2010, doi:10.1017/CBO9780511976667.
- J. Preskill, Lecture Notes for Physics 219/Computer Science 219: Quantum Computation, Chapter 5, California Institute of Technology, course materials.
- 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.
- 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.
- T. Toffoli, “Reversible computing,” in Automata, Languages and Programming, edited by J. W. de Bakker and J. van Leeuwen, Lecture Notes in Computer Science 85, Springer, 1980, pp. 632–644, 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.