Skip to content

Latest commit

 

History

History
124 lines (99 loc) · 3.88 KB

README.md

File metadata and controls

124 lines (99 loc) · 3.88 KB

QNN Barren Plateaus and Effective Dimension

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

Requirements

For CONDA users

Install these packages:

  • ipykernel, jupyter, jupyterlab,
  • matplotlib, numpy, pandas
  • qiskit, qiskit-machine-learning, qiskit-ibm-runtime
  • scikit-learn
  • torch, torchvision, torchsummary
  • python-dotenv

Onboarding - Setup Project

We assume that you have the above requirements. Follow the instructions belows to install this python project.

Clone this repository

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.

Install python dependencies

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.

Development - Launch the Notebook

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

Built in jupyter notebook and jupyter lab

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

Visual Studio Code

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