Computing Library › Quantum Ml
Quantum Ml

Variational Quantum Classifiers

A variational quantum classifier encodes data into a circuit, applies trainable gates, and measures an observable whose expectation is optimized to predict labels.

Anatomy of the model

A variational quantum classifier (VQC) has three stages. First a data-encoding block maps input x into a state. Second a parameterized circuit with trainable angles theta transforms it. Third a measurement of some observable, often a single-qubit Pauli-Z, yields an expectation value in the range minus one to one, which is mapped to a class prediction. The parameters theta are tuned by a classical optimizer to minimize a loss over labeled data.

The training loop

Kronos motion — data assimilation
python
# One prediction from a variational classifier (schematic)
def predict(x, theta):
    encode(x)                 # feature map
    variational_layers(theta) # trainable ansatz
    return expval(PauliZ(0))  # in [-1, 1] -> map to class label

Design choices that decide success

The encoding sets which functions of x are even reachable; through the Fourier picture, repeating the encoding raises the frequency content the model can fit. The ansatz sets expressivity and trainability, which trade off: an ansatz expressive enough to approximate any unitary tends to induce a barren plateau with exponentially small gradients.

Relation to neural networks

VQCs are often called quantum neural networks, and the analogy is loose but useful: encoding resembles an input layer, variational blocks resemble hidden layers, and measurement resembles a readout. Unlike deep nets, the model is linear in the state and its gradients come from a hardware-native rule rather than backpropagation, so the optimization dynamics differ substantially.

Practical caution

On classical benchmark data, VQCs have not shown a consistent advantage over well-tuned classical models. They remain valuable as a research testbed and as candidates for quantum-native data, where the input already lives in a quantum state and no expensive encoding is required.