This repository contains the code that accompanies the paper "Quantum Machine Learning With Canonical Variables" by J. Fuentes.
To run the code, the following libraries are required:
torch
numpy
matplotlib
scipy
pandas
seaborn
scikit-learn
botorch
gpytorch
- iontrap.py: The main engine, this file simulates the equations of motion within an ion trap.
- canonicalClassifier.py: This file implements a binary regressor for the canonical variables.
- canonicalRegressor.py: This file implements a regressor for the canonical variables.
- densityRegressor.py: This file implements a regressor for the square modulus of a Gaussian wave packet.
- controlPanel.ipynb: This Jupyter notebook helps to reproduce all the examples in the paper and demonstrates how the framework can be implemented for simulations.
The data
folder contains datasets used for training the models. Ensure that this folder is present in the same directory as the code files.
Make sure you have Python 3.8 installed. You can install the required dependencies using pip
. It is recommended to create a virtual environment to manage the dependencies:
# Create a virtual environment
python3.8 -m venv venv
# Activate the virtual environment
source venv/bin/activate # On Windows, use `venv\Scripts\activate`
# Install the required libraries
pip install torch numpy pandas seaborn matplotlib scipy scikit-learn botorch gpytorch
-
Clone the repository:
git clone https://github.com/fuentesigma/ionlearning.git cd ionlearning
-
Run the Jupyter notebook:
jupyter notebook controlPanel.ipynb
Follow the instructions in controlPanel.ipynb
to reproduce the experiments and simulations from the paper.