{
"info": {
"author": "",
"author_email": "",
"bugtrack_url": null,
"classifiers": [
"Development Status :: 4 - Beta",
"Environment :: Console",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Scientific/Engineering :: Physics"
],
"description": "Data Cybernetics qiskit-qml\n############################\n\n.. image:: https://img.shields.io/travis/com/carstenblank/dc-qiskit-qml/master.svg?style=for-the-badge\n :alt: Travis\n :target: https://travis-ci.com/carstenblank/dc-qiskit-qml\n\n.. image:: https://img.shields.io/codecov/c/github/carstenblank/dc-qiskit-qml/master.svg?style=for-the-badge\n :alt: Codecov coverage\n :target: https://codecov.io/gh/carstenblank/dc-qiskit-qml\n\n.. image:: https://img.shields.io/codacy/grade/820b74d1739b4d31b6395bfd8469b3bb.svg?style=for-the-badge\n :alt: Codacy grade\n :target: https://www.codacy.com/app/carstenblank/dc-qiskit-qml?utm_source=github.com&utm_medium=referral&utm_content=carstenblank/dc-qiskit-qml&utm_campaign=Badge_Grade\n\n.. image:: https://img.shields.io/readthedocs/dc-qiskit-qml.svg?style=for-the-badge\n :alt: Read the Docs\n :target: https://dc-qiskit-qml.readthedocs.io\n\n.. image:: https://img.shields.io/pypi/v/dc-qiskit-qml.svg?style=for-the-badge\n :alt: PyPI\n :target: https://pypi.org/project/dc-qiskit-qml\n\n.. image:: https://img.shields.io/pypi/pyversions/dc-qiskit-qml.svg?style=for-the-badge\n :alt: PyPI - Python Version\n :target: https://pypi.org/project/dc-qiskit-qml\n\n.. header-start-inclusion-marker-do-not-remove\n\n`qiskit `_ is an open-source compilation framework capable of targeting various\ntypes of hardware and a high-performance quantum computer simulator with emulation capabilities and various\ncompiler plug-ins.\n\nThis library implements so far one quantum machine learning classifier which has been introduced by F.Petruccione,\nM. Schuld and M. Fingerhuth (http://stacks.iop.org/0295-5075/119/i=6/a=60002). Athough this is the only classifier\nimplemented so far, this library is to be used as a repository for more classifiers using qiskit as a background\nframework.\n\n\nFeatures\n========\n\n* Distance & Majority based Hadamard-gate classifier\n\n * Generic real valued vector space input data (slow)\n\n * Binary valued vector space input data (faster)\n\n * Feature map pre-processing for non-linear classification\n\n.. header-end-inclusion-marker-do-not-remove\n\n.. installation-start-inclusion-marker-do-not-remove\n\nInstallation\n============\n\nThis library requires Python version 3.5 and above, as well as qiskit.\nInstallation of this library, as well as all dependencies, can be done using pip:\n\n.. code-block:: bash\n\n $ python -m pip install dc_qiskit_aqml\n\nTo test that the algorithms are working correctly you can run\n\n.. code-block:: bash\n\n $ make test\n\n.. installation-end-inclusion-marker-do-not-remove\n\n.. gettingstarted-start-inclusion-marker-do-not-remove\n\nGetting started\n===============\n\nYou can check out the classifier as follows\n\n.. code-block:: python\n\n import numpy as np\n from sklearn.datasets import load_iris\n from sklearn.preprocessing import StandardScaler, Normalizer\n from sklearn.model_selection import train_test_split\n from sklearn.pipeline import Pipeline\n\n import qiskit\n\n from dc_qiskit_qml.feature_maps import NormedAmplitudeEncoding\n from dc_qiskit_qml.distance_based.hadamard import QmlHadamardNeighborClassifier\n from dc_qiskit_qml.distance_based.hadamard.state import QmlGenericStateCircuitBuilder\n from dc_qiskit_qml.distance_based.hadamard.state.sparsevector import M\u00f6tt\u00f6nenStatePreparation\n\n X, y = load_iris(True)\n # Only the first two features and only get two labels\n # This is a toy example!\n X = np.asarray([x[0:2] for x, yy in zip(X, y) if yy != 2])\n y = np.asarray([yy for x, yy in zip(X, y) if yy != 2])\n\n preprocessing_pipeline = Pipeline([\n ('scaler', StandardScaler()),\n ('l2norm', Normalizer(norm='l2', copy=True))\n ])\n X = preprocessing_pipeline.fit_transform(X, y)\n\n X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.10)\n\n # Using the generic wave function (state vector) routine using the 'M\u00f6tt\u00f6nen'\n # state preparation algorithm\n initial_state_builder = QmlGenericStateCircuitBuilder(M\u00f6tt\u00f6nenStatePreparation())\n\n # The normed amplitude encoding ensures that the data is normalized\n # This is a somewhat unnecessary step as above we do that already\n feature_map = NormedAmplitudeEncoding()\n\n execution_backend: BaseBackend = qiskit.Aer.get_backend('qasm_simulator')\n qml = QmlHadamardNeighborClassifier(backend=execution_backend,\n shots=8192,\n classifier_circuit_factory=initial_state_builder,\n feature_map=feature_map)\n\n qml.fit(X_train, y_train)\n prediction = qml.predict(X_test)\n\n \"Test Accuracy: {}\".format(\n sum([1 if p == t else 0 for p, t in zip(prediction, y_test)])/len(prediction)\n )\n\n prediction_train = qml.predict(X_train)\n \"Train Accuracy: {}\".format(\n sum([1 if p == t else 0 for p, t in zip(prediction_train, y_train)])/len(prediction_train)\n )\n\nThe details are a bit more involved as to how this works and the classifier can be configured with a circuit factory\nor a feature map.\n\n.. gettingstarted-end-inclusion-marker-do-not-remove\n\nPlease refer to the `documentation of the dc qiskit qml library `_ .\n\nContributing\n============\n\nWe welcome contributions - simply fork the repository of this plugin, and then make a\n`pull request `_ containing your contribution.\nAll contributers to this plugin will be listed as authors on the releases.\n\nWe also encourage bug reports, suggestions for new features and enhancements, and even links to cool projects or applications built on PennyLane.\n\nAuthors\n=======\n\nCarsten Blank\n\n.. support-start-inclusion-marker-do-not-remove\n\nSupport\n=======\n\n- **Source Code:** https://github.com/carstenblank/dc-qiskit-qml\n- **Issue Tracker:** https://github.com/carstenblank/dc-qiskit-qml/issues\n\nIf you are having issues, please let us know by posting the issue on our Github issue tracker.\n\n.. support-end-inclusion-marker-do-not-remove\n.. license-start-inclusion-marker-do-not-remove\n\nLicense\n=======\n\nThe data cybernetics qiskit algorithms plugin is **free** and **open source**, released under\nthe `Apache License, Version 2.0 `_.\n\n.. license-end-inclusion-marker-do-not-remove\n\n\n",
"description_content_type": "",
"docs_url": null,
"download_url": "",
"downloads": {
"last_day": -1,
"last_month": -1,
"last_week": -1
},
"home_page": "http://data-cybernetics.com",
"keywords": "",
"license": "Apache License 2.0",
"maintainer": "Carsten Blank",
"maintainer_email": "blank@data-cybernetics.com",
"name": "dc-qiskit-qml",
"package_url": "https://pypi.org/project/dc-qiskit-qml/",
"platform": "",
"project_url": "https://pypi.org/project/dc-qiskit-qml/",
"project_urls": {
"Homepage": "http://data-cybernetics.com"
},
"release_url": "https://pypi.org/project/dc-qiskit-qml/0.0.3/",
"requires_dist": [
"qiskit",
"numpy",
"scipy",
"bitstring",
"scikit-learn",
"dc-qiskit-algorithms"
],
"requires_python": "",
"summary": "Machine learning (quantum-)algorithms with qiskit as basis",
"version": "0.0.3"
},
"last_serial": 5964175,
"releases": {
"0.0.2": [
{
"comment_text": "",
"digests": {
"md5": "c97e69bb1dfca05fe522c916181e36ae",
"sha256": "98cff904a2eb5596637ab7f5ca9c650939a8000f7c0496c19170943d8dbe02e4"
},
"downloads": -1,
"filename": "dc_qiskit_qml-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c97e69bb1dfca05fe522c916181e36ae",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 35631,
"upload_time": "2019-01-19T20:44:39",
"url": "https://files.pythonhosted.org/packages/e7/f1/4872b1727c973953ff4b26189bdad4dcec112a364a1ec239bebf326c4652/dc_qiskit_qml-0.0.2-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "e1892bc80cffd8308c909562c7d1d718",
"sha256": "5ffddf1c5036620a2b8d589f08f938f3b117dd3da56a238d7e8e8de3d5c9e453"
},
"downloads": -1,
"filename": "dc_qiskit_qml-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "e1892bc80cffd8308c909562c7d1d718",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 18455,
"upload_time": "2019-01-19T20:44:41",
"url": "https://files.pythonhosted.org/packages/2e/48/39fb770c6a2132f2728a3f11848b0761c33a06e0f6208c27fbad85924fce/dc_qiskit_qml-0.0.2.tar.gz"
}
],
"0.0.3": [
{
"comment_text": "",
"digests": {
"md5": "b18b46272faf68d40c7403b9083ff6b7",
"sha256": "11cdef8a480bc128b3337d7d0d6000b996983701356e826449db7ddda30ea85d"
},
"downloads": -1,
"filename": "dc_qiskit_qml-0.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b18b46272faf68d40c7403b9083ff6b7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 38903,
"upload_time": "2019-10-12T12:48:04",
"url": "https://files.pythonhosted.org/packages/16/56/2bc20fbe57cda52585feb27a21fd2a0fc9d0c28c309905c276ce3c6f629e/dc_qiskit_qml-0.0.3-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "a19f30ca9930922d4d0a4818ac03f1eb",
"sha256": "145f3401f1ff0e580898622e427aced4c2055464a819cc787b4ad103985c3b23"
},
"downloads": -1,
"filename": "dc_qiskit_qml-0.0.3.tar.gz",
"has_sig": false,
"md5_digest": "a19f30ca9930922d4d0a4818ac03f1eb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 16677,
"upload_time": "2019-10-12T12:48:06",
"url": "https://files.pythonhosted.org/packages/e0/4a/fa88841e3c9e159f6fcdb96370d32d48600bef7dca5d5893994923d3feaf/dc_qiskit_qml-0.0.3.tar.gz"
}
]
},
"urls": [
{
"comment_text": "",
"digests": {
"md5": "b18b46272faf68d40c7403b9083ff6b7",
"sha256": "11cdef8a480bc128b3337d7d0d6000b996983701356e826449db7ddda30ea85d"
},
"downloads": -1,
"filename": "dc_qiskit_qml-0.0.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b18b46272faf68d40c7403b9083ff6b7",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 38903,
"upload_time": "2019-10-12T12:48:04",
"url": "https://files.pythonhosted.org/packages/16/56/2bc20fbe57cda52585feb27a21fd2a0fc9d0c28c309905c276ce3c6f629e/dc_qiskit_qml-0.0.3-py3-none-any.whl"
},
{
"comment_text": "",
"digests": {
"md5": "a19f30ca9930922d4d0a4818ac03f1eb",
"sha256": "145f3401f1ff0e580898622e427aced4c2055464a819cc787b4ad103985c3b23"
},
"downloads": -1,
"filename": "dc_qiskit_qml-0.0.3.tar.gz",
"has_sig": false,
"md5_digest": "a19f30ca9930922d4d0a4818ac03f1eb",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 16677,
"upload_time": "2019-10-12T12:48:06",
"url": "https://files.pythonhosted.org/packages/e0/4a/fa88841e3c9e159f6fcdb96370d32d48600bef7dca5d5893994923d3feaf/dc_qiskit_qml-0.0.3.tar.gz"
}
]
}