Entangling Layers and Ansatz Design
Entangling layers create correlations between qubits that classical product states cannot represent, and their pattern shapes a circuit's power and trainability.
Why entanglement is the point
Without entangling gates, an n-qubit circuit is just n independent single-qubit rotations, and its state factorizes into a product of one-qubit states, which a classical computer simulates trivially. Entangling layers, built from two-qubit gates such as CNOT or CZ, correlate qubits so the joint state cannot be written as a product. This is the resource that makes a quantum model more than a stack of independent sinusoids.
Common connectivity patterns
- Linear chain: entangle neighbors 0-1, 1-2, and so on; shallow and hardware-friendly.
- Ring: linear chain plus a gate closing the loop back to qubit 0; adds one long-range link.
- All-to-all: entangle every pair; maximal correlation but many gates and heavy swap overhead on limited hardware.
- Brickwork: alternating layers of paired gates, a good compromise between reach and depth.
The hardware-efficient philosophy
A hardware-efficient ansatz picks entangling gates that match the device's native two-qubit connectivity, avoiding the costly swap networks that arise when the required interaction is not physically available. This minimizes depth and noise exposure but gives the circuit little problem-specific inductive bias, which can hurt trainability and generalization.
# Ring entangling layer (schematic)
def entangle_ring(n):
for q in range(n - 1):
qml.CNOT(wires=[q, q + 1])
qml.CNOT(wires=[n - 1, 0]) # close the ring
Entanglement and trainability
More entanglement is not always better. Excessive entanglement between the measured qubits and the rest of the register can hide gradient information and deepen barren plateaus. Some designs deliberately limit entanglement growth to preserve trainable gradients, and there is active study of the right amount of entanglement per layer for a given task.
Structured alternatives
Problem-inspired ansatze replace generic entangling patterns with ones derived from the problem's structure, such as fermionic excitation operators in chemistry or symmetry-preserving gates in physics tasks. These restrict expressivity to the relevant subspace, which both reduces the parameter count and improves the odds of avoiding plateaus. Ansatz design is where physics knowledge most directly improves a quantum model.