Parameterized Quantum Circuits
A parameterized quantum circuit (PQC) — also called a variational ansatz — is a quantum circuit whose gate angles are continuous free parameters . Rather than being fixed at design time, those angles are adjusted by a classical optimizer to minimize a cost function evaluated by running the circuit on a quantum device (or simulator).
This hybrid classical-quantum loop is the backbone of the Variational Quantum Eigensolver (VQE), the Quantum Approximate Optimization Algorithm (QAOA), and many Quantum Neural Networks (QNNs).
Anatomy of an ansatz
A typical hardware-efficient ansatz repeats a pattern of single-qubit rotations followed by entangling gates for layers:
where is the -rotation and is a fixed entangling layer (often a chain of CNOTs). For qubits and layers the circuit has free parameters.
The Ry gate
The single-qubit -rotation by angle is
It maps , so at it acts as an gate; at it prepares an equal superposition with real, positive amplitudes.
Why Ry?
Unlike , an rotation moves amplitude between and with real coefficients, which keeps the state on the great-circle of the Bloch sphere. This makes gradients easier to estimate and the landscape more amenable to classical optimizers.
Building a trainable model
For a 2-qubit, single-layer ansatz the circuit looks like:
Choosing and gives concrete amplitudes we can compute:
- After the rotations: on qubit 0, and on qubit 1.
- The CNOT then flips qubit 1 conditional on qubit 0, creating entanglement between the two qubits.
The parameter-shift rule
Because depends on rotation angles, the gradient of any expectation value can be computed analytically on hardware:
This parameter-shift rule (Mitarai et al., 2018; Schuld et al., 2019) requires exactly two circuit evaluations per parameter and works on real quantum hardware — no finite-difference approximation is needed.
Try it
Build the 2-qubit single-layer ansatz: apply to qubit 0, to qubit 1, then entangle them with a CNOT. The grader checks the exact statevector produced by your circuit.
Sign in on the full site to ask questions and join the discussion.