Computing Library › Quantum Ml
Quantum Ml

Parameterized Quantum Circuits

A parameterized quantum circuit is a fixed gate structure with tunable rotation angles, forming the trainable core of nearly all near-term quantum machine learning.

The building block of variational QML

A parameterized quantum circuit (PQC), also called an ansatz, is a sequence of quantum gates in which some gates carry free real parameters, typically rotation angles. Fixing those parameters fixes a unitary; varying them sweeps a family of unitaries. A classical optimizer searches this family to minimize a loss, which is what makes PQCs trainable models rather than static algorithms.

Typical structure

Kronos motion — lego machine

A common layered ansatz alternates two kinds of block. A rotation block applies single-qubit gates such as RY(theta) and RZ(theta) to each qubit, contributing local trainable parameters. An entangling block applies two-qubit gates such as CNOT or CZ in a ring or all-to-all pattern, correlating qubits so the state cannot be factored into independent parts. Repeating the pair L times deepens the circuit and increases expressivity.

python
# Hardware-efficient ansatz, one layer (schematic)
def layer(theta):
    for q in range(n):
        qml.RY(theta[q, 0], wires=q)
        qml.RZ(theta[q, 1], wires=q)
    for q in range(n - 1):
        qml.CNOT(wires=[q, q + 1])   # linear entangling chain

Families of ansatz

The expressivity-trainability tension

Adding depth and parameters lets a PQC reach more unitaries, but past a point the circuit approximates a random (Haar) unitary, and its loss landscape flattens into a barren plateau with gradients that vanish exponentially in qubit number. Good ansatz design finds the least expressive circuit that still contains a solution, so that gradients remain measurable.

Counting the cost

Each training step estimates the loss and its gradient from many circuit runs. With the parameter-shift rule, a gradient needs two evaluations per parameter, and each evaluation needs many shots to beat measurement noise. Circuit depth also raises exposure to hardware noise, so shallow, well-structured ansatze are strongly preferred on current devices.