Data Re-uploading Classifier - Pérez-Salinas et al. 2020
Overview
Reproduction of the data re-uploading paper - demonstrating that a single qubit can be a universal classifier when data is re-uploaded through multiple layers.
| Property | Value |
|---|---|
| Category | Research |
| Difficulty | Advanced |
| Framework | PennyLane |
| Qubits | 1 |
| Paper | Quantum 4, 226 (2020) |
Key Insight
A single qubit with L layers of data re-uploading can:
- Approximate any Boolean function on 2L bits
- Achieve universal classification
- Match deep neural network expressivity
This challenges the assumption that more qubits = more power.
The Data Re-uploading Idea
Traditional quantum classifiers encode data once, then apply parametrized gates:
CODE|0⟩ → S(x) → U(θ) → Measure
Data re-uploading interleaves data and parameters:
CODE|0⟩ → U(θ₁,x) → U(θ₂,x) → ... → U(θₗ,x) → Measure
Circuit Structure
Each layer applies:
CODEU(θ,x) = RZ(θ₁ + x₁w₁) RY(θ₂ + x₂w₂) RZ(θ₃)
For L layers on a single qubit:
CODE┌──────────────┐┌──────────────┐ ┌──────────────┐ q_0: ┤ U(θ₁,x) ├┤ U(θ₂,x) ├ ... ┤ U(θₗ,x) ├ → Z └──────────────┘└──────────────┘ └──────────────┘
Running the Circuit
PYTHONfrom circuit import run_circuit result = run_circuit( n_layers_list=[1, 2, 3, 4], n_train=50, n_test=20, n_epochs=30 ) for n_layers, data in result['layer_analysis'].items(): print(f"{n_layers} layers: {data['test_accuracy']:.1%} accuracy")
Expected Results
Circle Dataset (2D Classification)
| Layers | Parameters | Train Acc | Test Acc |
|---|---|---|---|
| 1 | 6 | ~60% | ~55% |
| 2 | 12 | ~75% | ~70% |
| 3 | 18 | ~85% | ~80% |
| 4 | 24 | ~90% | ~85% |
Universality Theorem
From the paper:
"A single-qubit quantum classifier with L layers can approximate any Boolean function f: {0,1}^{2L} → {0,1}"
Implementation Details
Feature Encoding
PYTHONangle = θ + x * w
Where:
- θ: Learnable bias
- x: Input feature (scaled to [0, 2π])
- w: Learnable weight
Training
- Gradient descent on cross-entropy loss
- Numerical gradients (or PennyLane autodiff)
- Typical learning rate: 0.1
Why It Works
- Non-linearity: Repeated rotations create highly non-linear decision boundaries
- Data mixing: Each layer mixes data with parameters differently
- Interference: Quantum interference creates complex classification patterns
Comparison with Classical
| Model | Parameters | Qubits | Expressivity |
|---|---|---|---|
| Single perceptron | 3 | 0 | Linear |
| Data re-upload (L=3) | 18 | 1 | Universal |
| Deep NN (3 layers) | 100+ | 0 | Universal |
Paper Citation
BIBTEX@article{perez2020data, title={Data re-uploading for a universal quantum classifier}, author={P{\'e}rez-Salinas, Adri{\'a}n and others}, journal={Quantum}, volume={4}, pages={226}, year={2020} }