Skip to content

work / quantum-machine-learning-thesis · 2022-08

Machine Learning in the Realm of Quantum (B.Sc. Thesis)

[quantum-ml][pennylane][quanvolution][cvqnn][mnist]

Abstract

Undergraduate thesis (CSE499, North South University, supervised by Dr. Mahdy Rahman Chowdhury): a state-of-the-art review of quantum machine learning plus head-to-head MNIST experiments — a 4-qubit quanvolutional network and a continuous-variable photonic QNN against classical baselines.

§1Problem

Classical ML hits scaling walls that quantum computing may sidestep — but which QML models actually work today, how do you get classical data into a quantum circuit, and where do hybrid models genuinely help? The literature was fragmented and the honest baselines were missing.

§2Approach

Built and trained two first-generation hybrid models in PennyLane + Keras on MNIST: a quanvolutional network (2×2 patches angle-encoded into 4 qubits via RY rotations, random variational layer, Pauli-Z readout as feature channels) and a continuous-variable QNN on a photonic simulator (squeezers, interferometers, displacement, Kerr gates; 4 quantum layers, 56 quantum parameters) — each against an equivalized classical network, comparing accuracy and convergence speed.

§3Impact

Quanvolution reached 92% test accuracy vs 96% classical (and converged to optimum loss faster); the CV-QNN reached 72% vs 88%. An honest, measured picture of the NISQ era — and the foundation for this site: the same parameter-shift mathematics now trains live in the hero and teaches visitors in /learn. The full thesis is distilled at /research/quantum-machine-learning-thesis.

draw here — 8×8 input

ch0 · φ=0.00

ch1 · φ=0.79

ch2 · φ=1.57

ch3 · φ=2.36

each 2×2 patch → RY encodings on 2 qubits, entangled by CNOT → four ⟨Z⟩ readout channels. The same statevector engine that trains the hero.

Fig. 1 — interactive quanvolution: a 2×2 quantum filter sweeping your drawing
what am I looking at?

A quanvolution slides a small quantum circuit across an image the way a CNN slides a filter: each 2×2 patch's pixels become rotation angles, a CNOT entangles the qubits, and measured ⟨Z⟩ values form quantum feature maps. From my undergraduate thesis. Interactive lesson.

Quanvolutional circuit: a 2×2 image patch is angle-encoded into four qubits via RY rotations, passed through a random variational layer, and measured in Pauli-Z to produce four feature channels x₁ x₂ x₃ x₄ 2×2 patch |0⟩ |0⟩ |0⟩ |0⟩ RY(x₁) RY(x₂) RY(x₃) RY(x₄) angle encoding U(θ) random layer variational circuit ⟨Z⟩ ⟨Z⟩ ⟨Z⟩ ⟨Z⟩ c₁ c₂ c₃ c₄ feature channels
Fig. 2 — the quanvolutional circuit: 2×2 patches angle-encoded via RY into 4 qubits, a random variational layer, Pauli-Z readout as feature channels
Training-loss sketch: the quanvolutional network converges to optimum loss in fewer epochs than the equivalized classical CNN; final test accuracies were 92% quanvolutional versus 96% classical loss epochs reaches optimum sooner quanvolutional — 92% test acc. classical CNN — 96% test acc. curve shapes illustrative; accuracies measured in the thesis — full plots in the repo notebooks
Fig. 3 — convergence sketch: quanvolution reached optimum loss in fewer epochs; final test accuracy 92% vs the 96% classical baseline

Keywords: Python, PennyLane, TensorFlow/Keras, Strawberry Fields, Jupyter

[github]

@misc{ammar2022quantummachinelearningthesis,
  author = {Ammar, Md. Abu},
  title  = {Machine Learning in the Realm of Quantum (B.Sc. Thesis)},
  year   = {2022},
  url    = {https://github.com/abuammarsami/CSE499.06-QML-},
  note   = {Research project}
}