Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/markf94/ibmq_code_epl_119_60002
Code that was used to generate the results for the publication 'Implementing a distance-based classifier with a quantum interference circuit' by Schuld, Fingerhuth and Petruccione (2017).
https://github.com/markf94/ibmq_code_epl_119_60002
Last synced: 5 days ago
JSON representation
Code that was used to generate the results for the publication 'Implementing a distance-based classifier with a quantum interference circuit' by Schuld, Fingerhuth and Petruccione (2017).
- Host: GitHub
- URL: https://github.com/markf94/ibmq_code_epl_119_60002
- Owner: markf94
- License: mit
- Created: 2017-12-18T22:55:48.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-31T11:50:01.000Z (about 6 years ago)
- Last Synced: 2023-06-03T11:50:15.773Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 28.3 KB
- Stars: 16
- Watchers: 6
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# What is this?
This repo contains the code that was used to generate the results for the publication
'Implementing a distance-based classifier with a quantum interference circuit' by Schuld, Fingerhuth and Petruccione (2017).
The article was published in Europhysics Letters on December 1st 2017 and is an Editor's Choice article.Article DOI:
https://doi.org/10.1209/0295-5075/119/60002arXiv link:
https://arxiv.org/pdf/1703.10793.pdf# How to make use of this repository?
Update Nov. 2018: I've rewritten the old QASM code in Python 3.7 and the newest Qiskit.
The file `qiskit_distance_based_classifier.py` contains the `DistanceBasedClassifier` class which performs the classification
of the two Iris flower datapoints `x'` and `x''` that were used in the original publication.You can run the code with the following command:
```
$ python3 qiskit_distance_based_classifier.py
```The printed information should be self-explanatory. Note, that the simulation is performed with the new IBM Aer QASM simulator.
For everyone who wants to dive deeper, the subdirectory `old_qasm_files` contains the old files written in quantum assembly language (QASM), which is the OG programming language used by the online interface
of the IBM Quantum Experience. In order to execute these files you have several options:a) make an account with the IBM Quantum Experience, start a new Experiment and then simply copy & paste the code from one of the two QASM files into the QASM Editor in the IBM online interface. Then you can either simulate or run the defined quantum circuit on the actual chip.
b) import the QASM file into Qiskit by using the `qiskit.wrapper._wrapper.load_qasm_file` method from Qiskit. For documentation [see here](https://qiskit.org/documentation/_autodoc/qiskit.wrapper._wrapper.html?highlight=load%20qasm#qiskit.wrapper._wrapper.load_qasm_file).
NOTE: These QASM files were specifically written for the ibmqx2 bowtie chip with 5 qubits.
The `old_qasm_files` directory contains the following two files:
- `x0_class0_classification.qasm` Classification of the input vector x' as discussed in the EPL publication.
- `x1_class0_classification.qasm` Classification of the input vector x'' as discussed in the EPL publication.
--------------------------------------------------------------------------------------------------
If you happen to use this code please cite our paper:
Schuld, M., Fingerhuth, M., & Petruccione, F. (2017). Implementing a distance-based classifier with a quantum interference circuit. EPL (Europhysics Letters), 119(6), 60002.
bibTex:
```
@article{schuld2017implementing,
title={Implementing a distance-based classifier with a quantum interference circuit},
author={Schuld, Maria and Fingerhuth, Mark and Petruccione, Francesco},
journal={EPL (Europhysics Letters)},
volume={119},
number={6},
pages={60002},
year={2017},
publisher={IOP Publishing}
}
```*The code is published open-source under a standard MIT License. Feel free to download, modify, use and multiply!*