High level API to define, train and deploy Polyadic Quantum Machine Learning models
Project description
This package provides a library to define, train and deploy Quantum Machine Learning models.
This library has been used to train a qmodel with the Iris flower dataset on IBM quantum computers: iris.entropicalabs.io
The quantum circuits can run on top of any quantum computer provider. As for now, it implements interfaces for a fast simulator, manyq, and Qiskit.
Installation
From PyPI, at the command line:
pip install polyadicqml
Installing latest stable from github:
git clone https://github.com/entropicalabs/polyadicQML.git polyadicqml cd polyadicqml pip install -U .
Documentation
You can find a quickstart guide, the tutorial and the module references in the docs.
Sample code
Training a model on a simulator and testing it on a real quantum computer can be done in a few lines:
# Define the circuit structure
make_circuit(bdr, x, params):
...
# Prepare a circuit simulator:
qc = mqCircuitML(make_circuit=make_circuit,
nbqbits=nbqbits, nbparams=nbparams)
# Instanciate and train the model
model = Classifier(qc, bitstr).fit(input_train, target_train)
# Prepare to run the circuit on an IBMq machine:
backend = Backends("ibmq_ourense", hub="ibm-q")
qc2 = qkCircuitML(
make_circuit=make_circuit,
nbqbits=nbqbits, nbparams=nbparams,
backend=backend
)
# Change the model backend and run it
model.set_circuit(qc2)
model.nbshots = 300
model.job_size = 30
pred_test = model(input_test)
You can find out more in the documentation, where you will find tutorials and examples. A quickstart through examples can be found in the examples folder, as well as on the website. As an introduction to the algorithm you can check out this video presentation.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file polyadicqml-0.1.0b4.tar.gz
.
File metadata
- Download URL: polyadicqml-0.1.0b4.tar.gz
- Upload date:
- Size: 19.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 12f6e43514a13fadaa5d3c3b9454836eb70a4a2265c503c5faca8373ec6fa560 |
|
MD5 | b64f28580659ec2678fac61a3c077f0a |
|
BLAKE2b-256 | 816e1130a90e255da44fa994ba7343f48ee08e63b1510c648975d47f061c5594 |
File details
Details for the file polyadicqml-0.1.0b4-py3-none-any.whl
.
File metadata
- Download URL: polyadicqml-0.1.0b4-py3-none-any.whl
- Upload date:
- Size: 26.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 632f03dd14dd8003f81b06fa3bb12b7487c94ae8ce9d8e59330b10f03522a62c |
|
MD5 | 8c9bf43cd7c91e1649bc8a3f4b2fe94f |
|
BLAKE2b-256 | a2755f19e27330a9141002277a0b5fae784b8bbe2fd03387aeb69e748d5eb2bf |