Skip to main content

Online quantum machine learning package, using PyTorch.

Project description

online-qml

online-qml is a PyTorch based package for quantum extreme learning machines (QELM) simulations. It is with online shadow training readouts.

The distribution name is online-qml; the import name is online_qml.

Current focus

  • generate Haar pure states and random Naimark POVMs;
  • train OST and prior-frame readout layers;
  • train dense pseudoinverse/ridge baselines;
  • evaluate Haar bias and variance;
  • study state-frame and measurement-frame distances.

Minimal example

import torch
from online_qml.quantum import sample_dm, sample_povm, shots_outcome
from online_qml.estimators import ShadowReadoutEstimator

states = sample_dm(1000, d=2, dtype=torch.cdouble)
povm = sample_povm(16, d=2, dtype=torch.cdouble)
outcomes = shots_outcome(povm, states, shots=1)
obs = sample_dm(1, d=2, dtype=torch.cdouble).T

est = ShadowReadoutEstimator(
    n_out=16,
    d=2,
    dtype=torch.float64,
    methods=("ost", "state_prior_ost"),
)
est.update_single_shot(outcomes[:, 0], states)
layers = est.layers(obs)
W_ost = layers["ost"]
W_state_prior = layers["state_prior_ost"]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

online_qml-0.2.0.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

online_qml-0.2.0-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file online_qml-0.2.0.tar.gz.

File metadata

  • Download URL: online_qml-0.2.0.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for online_qml-0.2.0.tar.gz
Algorithm Hash digest
SHA256 68377db6648297002732ab63bf3ad590671980115ad72253dc36a1b6a880018c
MD5 69b35e5ec28c0d9cf42212e49d85aa74
BLAKE2b-256 c29b516c900a73a032209e4aba985330d18d8bf0627d7684bdd1422eba7dc6c1

See more details on using hashes here.

File details

Details for the file online_qml-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: online_qml-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 21.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for online_qml-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 db10e329b6964fe77d22bda69f7ba2a377a8eaaaf576a597c253a376e4c3b02f
MD5 3ca9045e381930857563482e8e7e9aab
BLAKE2b-256 9f58b81ea202785f2413edab226de048d31a8832d35659d5c4ed76d6ae640671

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page