Quantum Circuit Lab / quantum machine learning
Lesson 13 · quantum machine learning

Architecture of a Hybrid Quantum–Classical CNN

Design an honest hybrid image classifier that combines classical convolutional features with a small trainable quantum layer.

Capstone24 min readsoftware engineering · quantum computing

A realistic architecture

image
  ↓
small classical CNN
  ↓  (project to 4–8 features)
angle-encoded quantum circuit
  ↓  (measure Z expectations)
classical linear head
  ↓
class probabilities

Keep the classical network responsible for high-dimensional visual work. Let the quantum layer consume a compact feature vector and return a few expectation values. The quantum circuit is a constrained feature transformation, not a replacement for every convolution.

Sketch the quantum layer

def quantum_layer(features, weights):
    for wire, value in enumerate(features):
        ry(value, wire)
    for layer in weights:
        for wire in range(n_qubits):
            rz(layer[wire, 0], wire)
            ry(layer[wire, 1], wire)
        for wire in range(n_qubits - 1):
            cnot(wire, wire + 1)
    return [expectation(Z, wire) for wire in range(n_qubits)]

The classical network learns a projection into the quantum layer’s input range. The gradient estimator may make the quantum side much more expensive, so track execution count as well as loss.

Design the experiment first

  • Compare against a classical CNN with the same feature bottleneck.
  • Keep qubits, depth, shots, optimiser, and training steps visible.
  • Run multiple seeds and report mean and spread.
  • Track circuit evaluations and wall-clock time.
Capstone challenge: publish the circuit diagram, feature dimensions, training curves, classical ablation, and execution budget together.

Use the quantum circuit lab to inspect the gates, then revisit the full roadmap whenever a term needs a refresher.