GithubHelp home page GithubHelp logo

gknan / ibmq_code_epl_119_60002 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from markf94/ibmq_code_epl_119_60002

0.0 1.0 0.0 29 KB

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).

License: MIT License

Python 100.00%

ibmq_code_epl_119_60002's Introduction

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/60002

arXiv 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.

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!

ibmq_code_epl_119_60002's People

Contributors

desireevl avatar markf94 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.