Computing Library › Quantum Ml
Quantum Ml

Hybrid Quantum-Classical Training

Near-term quantum machine learning runs a quantum circuit for evaluation and a classical optimizer for parameter updates, looping between the two.

The variational loop

Almost every near-term QML method is hybrid. The quantum processor is used only for what it does natively: preparing a state from parameters and measuring an observable. A classical computer holds the parameters, computes the loss from measurement results, decides the next update, and sends new parameters back. This division keeps the quantum part shallow and delegates the well-understood work of optimization to classical hardware.

The cycle in steps

Kronos motion — classical vs quantum

Choice of optimizer

Because each loss and gradient evaluation is noisy and expensive, optimizer choice matters more than in classical deep learning. Gradient-based methods such as Adam work when gradients are reliable. Simultaneous perturbation stochastic approximation (SPSA) estimates a full gradient with only two circuit evaluations regardless of parameter count, which is attractive under heavy shot noise. Quantum-aware methods use the quantum Fisher information for natural-gradient steps.

python
# Hybrid training loop (schematic)
theta = init_params()
for step in range(n_steps):
    loss = evaluate_on_qpu(theta, batch)     # quantum forward pass
    grad = parameter_shift_grad(theta, batch) # quantum gradient
    theta = classical_optimizer.update(theta, grad)  # classical update

Where the cost lives

The bottleneck is the number of circuit executions. Each gradient step with the parameter-shift rule needs two evaluations per parameter, and each evaluation needs enough shots to beat measurement noise, so the shot budget scales with parameters times steps times shots per estimate. Communication latency between classical and quantum hardware adds overhead. Reducing parameters, using local cost functions, and warm-starting all cut this bill.

Why hybrid, for now

Hybrid training exists because current devices are noisy and small. It lets shallow circuits do useful work while classical resources absorb the optimization burden. If fault-tolerant hardware arrives, some fully quantum routines may replace the loop, but for the near term the hybrid pattern is the practical foundation of the field.