A quantum autoencoder trains a parameterized circuit U(θ) to compress an n-qubit state family into fewer qubits by forcing the discarded "trash" qubits toward |0⟩. Here the training family is
|ψ(φ)⟩ = cos(φ)|00⟩ + sin(φ)|11⟩, φ sampled across the batch
The encoder U(θ) is a hardware-efficient ansatz: each layer applies Ry(θ) and Rz(θ) to both qubits, then a CNOT. Qubit 0 is kept as the latent qubit; qubit 1 is the trash qubit. The cost function is the mean probability the trash qubit is measured as |1⟩:
C(θ) = (1/N) Σᵢ P(trash=1 | U(θ)|ψ(φᵢ)⟩)
Gradients are computed with the genuine quantum parameter-shift rule — no backprop through the circuit, exactly how real hardware-differentiable VQCs are trained: ∂C/∂θⱼ = [C(θⱼ+π/2) − C(θⱼ−π/2)] / 2. Each training step re-simulates the full batch of states twice per parameter and takes a gradient-descent update.
- Right disk — trash-qubit Bloch-vector projection for every batch sample (dots), drawn as a side-view x–z great circle of the Bloch sphere; dot size/glow encode the depth (y) coordinate coming toward or away from you. They start scattered and should converge to the top pole (|0⟩) as training reduces the cost, meaning that qubit becomes discardable.
- Left disk — latent-qubit Bloch-vector projection for the single φ selected by the slider, showing the compressed information is preserved even as the trash qubit empties out.
- An optimal 1-CNOT solution exists for this family (the theoretical fidelity ceiling is 100%, reachable with even a single ansatz layer), but the random ansatz has to find it by gradient descent — exactly like a real barren-plateau-prone VQC training run.
- Drag the canvas to pan, scroll/pinch to zoom — the view is a camera over the 2D scene, not the physics.