This repository contains the code and report for the Quantum Machine Learning (QML) project, focused on solving the Parity Problem using various quantum circuits and classical neural networks. The project was developed as part of the QML course at the University of Athens.
The parity problem involves determining whether the number of ones in a binary string is even or odd. In this project, we consider two versions of the problem: one with 3 inputs and another with 5 inputs.
- Training Data: Binary strings with corresponding parity labels, with added noise to simulate real-world scenarios. Files:
classA_train.dat,classB_train.dat - Test Data: Binary strings with corresponding parity labels used to evaluate the classifier. Files:
classA_test.dat,classB_test.dat
- Design: Utilizes 3 qubits with angle embedding and basic entangler layers.
- Cost Function: Mean Squared Error (MSE)
- Optimization Method: Nesterov Momentum Optimizer
- Design: Alternative ansatz circuit with different gate arrangements.
- Cost Function: Mean Squared Error (MSE)
- Optimization Method: Nesterov Momentum Optimizer
- Design: Utilizes data re-uploading technique with multiple re-uploading layers.
- Cost Function: Mean Squared Error (MSE)
- Optimization Method: Adam Optimizer
The classifiers' performance is evaluated based on accuracy on both training and test datasets. Various optimizers were tested, including Adam, Gradient Descent, Nesterov Momentum, and RMSProp.
A more complex version of the parity problem was tackled using a quantum circuit with 5 qubits and data re-uploading technique.
A classical neural network was trained on the same dataset to benchmark the performance of the quantum classifiers.
- Code Notebooks:
qml_classifier_a_model.ipynb: Circuit (a) implementation and resultsqml_classifier_b_experiments_circuits.ipynb: Circuit (a), (b), (c) implementation and resultsqml_classifier_b_best_model.ipynb: Circuit (c) implementation and results, optimizers survey code and resultsqml_classifier_c.ipynb: Circuit for Parity-5 implementation and results
- PennyLane Variational Classifier Tutorial: link
- PennyLane Data Re-uploading Classifier Tutorial: link
- B.Sc. Thesis: link
Konstantinos Nikoletos



