This Jupyter Notebook project practices the experiment as given in the research design section in the project "BP Mitigation Strategy vs QNN Capacity to Learn" (see Jacob Cybulski's projects).
- Table of contents
- VQA-Notes Introduction
- Requirements
- Onboarding - Setup Project
- Development - Launch the Notebook
- Python 3.10.4
- pip 22.0.4 for package management
- pipenv for virtual environment and package management
- Optional: Pyenv for python version control
Install these packages:
- ipykernel, jupyter, jupyterlab,
- matplotlib, numpy, pandas
- qiskit, qiskit-machine-learning, qiskit-ibm-runtime
- scikit-learn
- torch, torchvision, torchsummary
- python-dotenv
We assume that you have the above requirements. Follow the instructions belows to install this python project.
Make sure that you have access to this repository, and your computer have the credentials associate with GitHub.
From your desired folder, for example, /Documets/Code
, open a terminal and run:
git clone https://github.com/NNCT2904/VQA-Capacity-Notes.git
This command will download this repository to your computer as a folder named VQA-Capacity-Notes
.
You can install python 3.10.4 and set it as global python with pyenv
:
# Install python 3.10.4
pyenv install 3.10.4
# Set 3.10.4 as global
pyenv global 3.10.4
After cloning the repository, we need to install nessessary packages to run this notebook.
We are using pipenv
as a virtual environment manager, and to install packages.
Inside the project folder, open a terminal and run:
# This command will activate the virtual enviroment for this project.
pipenv shell
# This command install the packages listed in the Pipfile.
pipenv install
Yes, I am not using Conda, their way of environment management confuses me.
Remember to use the correct python version and activate the environment first!
Run this command if you are not in the correct python version:
pyenv global 3.10.4
Run this command if you are not in the python environment:
# Inside the repository
pipenv shell
Create an .env
file in the root folder to store IBMQ api key
TOKEN=paste your token here
HUB=your hub
GROUP=your group
PROJECT=your project
BACKEND=your backend
For example (not real token!):
TOKEN=455cb6696
HUB=ibm-q-research
GROUP=deakin-uni-1
PROJECT=qnn-barren-plate
BACKEND=ibm_perth
This repository also install the package jupyter
and jupyterlab
. The notebook should launch with this command:
jupyter notebook
Or launch the Jupyter Lab with this command:
jupyter lab
You need to install the vscode-jupyter extension. After opening the notebook with VSCode, you need to select the correct kernel. The name of the kernel shuld match with the environment name. To check the environment name, run the command:
pipenv --venv