Skip to main content

Qreservoir

Code style: black

Qreservoir is a lightweight python package built on top of qulacs to simulate quantum extreme learning and quantum reservoir computing models.

Qreservoir is licensed under the MIT license.

Tutorial and API documents

Documentation and API: https://owenagnel.github.io/qreservoir.

Quick Install for Python

pip install qreservoir

Uninstall Qreservoir:

pip uninstall qreservoir

Features

Fast simulation of quantum extreme learning machine and quantum reservoir computing.

Python sample code

from qulacs import Observable
from sklearn.linear_model import LinearRegression

from qreservoir.datasets import Complex_Fourrier
from qreservoir.encoders import ExpEncoder
from qreservoir.models import QELModel
from qreservoir.reservoirs import RotationReservoir

dataset = Complex_Fourrier(complexity=1, size=1000, noise=0.0)

encoder = ExpEncoder(1, 1, 3) # 1 feature, 1 layer, 1 qubit per feature
reservoir = RotationReservoir(encoder, 0, 10)  # 0 ancilla qubits, 10 depth

observables = [Observable(3) for _ in range(9)] # create observable set
for i, ob in enumerate(observables[:3]):
    ob.add_operator(1.0, f"X {i}")
for i, ob in enumerate(observables[3:6]):
    ob.add_operator(1.0, f"Z {i}")
for i, ob in enumerate(observables[6:]):
    ob.add_operator(1.0, f"Y {i}")

model = QELModel(reservoir, observables, LinearRegression()) # observable is a qulacs Observable object
X, _, y, _ = dataset.get_train_test()
model.fit(X, y)
print(model.score(X, y))

How to cite

N/A

Future improvements

  • Model creation currently a bit clunky. Models should take encoders and reservoirs as two seperate arguments and size of inputs should be determined dynamically when fit/score are called. This is made more difficult by the fact we wish to extract variance and concentration data from the models. Ideally we want RCModel and QELModel to implement scikit-learn's BaseEstimator interface.

  • Additional tests should be written for datasets and new reservoirs/encoders

  • Improve package structure by using python specific object oriented features.

Metadata

Release files for qreservoir 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qreservoir 0.5.0
File Size Uploaded Provenance Actions
qreservoir-0.5.0.tar.gz 15.5 kB Without provenance Details for qreservoir-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for qreservoir 0.5.0
File Interpreter ABI Platform Actions
qreservoir-0.5.0-py3-none-any.whl Python 3 none any Details for qreservoir-0.5.0-py3-none-any.whl

Total release size: 32.4 kB

Release files / qreservoir-0.5.0.tar.gz

Download URL qreservoir-0.5.0.tar.gz
Size 15.5 kB
Tags Source
SHA-256 checksum
How to use checksums
6aa803f136b10894cd9a83931c154399a2fb4ce2a14e2cb2d63f9148a85a398d
BLAKE2b-256 checksum
How to use checksums
85fc8591913b6f35e6930fd04e3408492c586ae529ca5a9a159661b198463f20
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.4 Darwin/21.6.0

Release files / qreservoir-0.5.0-py3-none-any.whl

Download URL qreservoir-0.5.0-py3-none-any.whl
Size 17.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0b78e63b3abcdb43a341c22cf21309c5b47e468e723ebdef560ba9c94864ec32
BLAKE2b-256 checksum
How to use checksums
9cd3468091649d723b4410a46684ac651890a554bd1df657552be934084f591f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.11.4 Darwin/21.6.0

Security for qreservoir 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page