Related Preprints:
- Variational Quantum Approximate Support Vector Machine With Inference Transfer https://arxiv.org/abs/2206.14507
- Qiskit 0.25.4
- Terra 0.17.2
- Aer 0.8.2
- Ignis 0.6.0
- Aqua 0.9.1
- IBM Q Provider 0.12.3
- Python 3.9.2 (default, Mar 3 2021, 20:02:32) [GCC 7.3.0]
- OS Linux
- CPUs 8
- Memory (Gb) 15.561397552490234
- Mon Nov 01 09:49:13 2021 KST
Create new conda enviroment with the command.
conda env create --name `YOUR_ENV_NAME` --file environment.yaml
If you have created new environment already, install proper packages
pip install -r run_requirements.txt
After setting environments, run ibmq_device_run.ipynb
.
Please check lines with # TODO:
for they are configuration controllers.
The experiement result will be stored at default directory ibmq_device_run_results
.
I_HAVE_ACCESS
: Boolean. Set toTrue
if have vaild IBMQ access.DATA_TYPE
: Str. Either 'balanced' or 'unbalanced'DEVICE
: Str. Either 'montreal' or 'toronto'TEST_SIZE
: Int. Size of test dataset. Choose suitable value in terms of experiment time.MAXITER
: Int. Maximum number of iteration. default = 2**10LAST_AVG
: Int. Number of last samples to average. default = 2**4DIR_NAME
: Str. Directory to save results. default = 'ibmq_device_run_results'provider
: Your IBMQ provider.layout
: Mapping between virtual and physical qubits.
The hardware-noise-robustness of QASVM heavily depends on layout
.
- (yi - i1 - i0 - xi - a - xj - j0 - j1 - yj) connection
- (i1 - i0 - xi - a - xj - j0 - j1) + (i0 - yi) + (j0 - yj) connection
- (yi - i0 - i1 - xi - a - xj - j1 - j0 - yj) connection
- (i0 - i1 - xi - a - xj - j1 - j0) + (i1 - yi) + (j1 - yj) connection
from classifiers.quantum import Qasvm_Mapping_4x2
layout = Qasvm_Mapping_4x2(backend, a=3, i0=8, i1=11, xi=5, yi=14, j0=1, j1=4, xj=2, yj=7)
layout = Qasvm_Mapping_4x2(backend, a=16, i0=11, i1=8, xi=14, yi=5, j0=22, j1=25, xj=19, yj=24)
layout = Qasvm_Mapping_4x2(backend, a=3, i0=9, i1=11, xi=5, yi=8, j0=0, j1=4, xj=2, yj=1)
layout = Qasvm_Mapping_4x2(backend, a=13, i0=10, i1=7, xi=12, yi=6, j0=11, j1=8, xj=14, yj=9)
If dataset is unbalanced, QASVM performs better than uniform weight STC.
Below figures summarize classification result on quantum processor ibmq_montreal
Number of optimization parameter can be lower than training dataset size