This is a demo on how to use Quantum Support Vector Machines, as implemented by using Qiskit, to perform classification on the Iris dataset.
Based on ideas from https://github.com/Qiskit/qiskit-machine-learning/blob/main/docs/tutorials/03_quantum_kernel.ipynb.
The software development and experiments were done on a Linux x86-64 workstation with Ubuntu 20.04.
Instructions on how to build a similar conda environment (which should work on number of different platforms, like macOS or Windows) or recreate exact replica on the conda environment (this would only work on Linux x86-64) are in the following sections (this assumes conda and pip are already installed and configured).
Run the following command, which would create and activate a new conda environment called qsvm
(the name could be changed as desired) with the required packages:
conda create -n qsvm python=3.8 -y
conda activate qsvm
Install the required packages:
pip install qiskit==0.34.2
pip install qiskit-machine-learning==0.3.1
conda install -c conda-forge pandas -y
conda install jupyter notebook -y
conda install -c conda-forge matplotlib-base -y
Start a Jupyter notebook or Jupyter Lab instance and access the notebook from it.
To build an exact replica of the conda software environment on a Linux x86-64 machine run the following command, which would create a new conda environment called qsvm
(the name could be changed as desired) with the required packages:
conda create --name qsvm --file spec-file.txt
Activate the conda environment, once it's installed, start a Jupyter notebook or Jupyter Lab instance and access the notebook from it.
conda activate qsvm