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.3.0.tar.gz (18.0 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.3.0-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: online_qml-0.3.0.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","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.3.0.tar.gz
Algorithm Hash digest
SHA256 095e2401fd2d601358e38f9812f618523419c86a1e13a71ee570d3849422a663
MD5 08275c83639ecaf7124442fbd8401354
BLAKE2b-256 f5c1be10890b685b609c72621c4e0ad8115c9bc0faafb66707f216b68606e02c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: online_qml-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 23.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.16 {"installer":{"name":"uv","version":"0.11.16","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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d1c1e0859a2d4906b8b2f17bbc1963e8ab00dfd613357a2931c59513d74c38a5
MD5 432f0f50d33d7c8a58fd6241caf8430f
BLAKE2b-256 dd2bf95e2427b47345121c5bbd143bb0e377fe4992a5b409cb05e2498f7ddeea

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