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.4.0.tar.gz (20.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.4.0-py3-none-any.whl (25.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: online_qml-0.4.0.tar.gz
  • Upload date:
  • Size: 20.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","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.4.0.tar.gz
Algorithm Hash digest
SHA256 148826cd82b656973b60fa23016dfa68153f16ddfcc8256a1d05cb8afbf6a096
MD5 ed45404edafdb7e074529a19ba17e98a
BLAKE2b-256 4a44073adb094f04100a090598c351463b2241b8f7fc597e257ee0811e3ee368

See more details on using hashes here.

File details

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

File metadata

  • Download URL: online_qml-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 25.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9a16879f967fafd152859a15f6e2e5a9e476f61b8b9799250d5a62fb9f68919a
MD5 b8d11b4bbf69dce57a7478d5c7e06ff7
BLAKE2b-256 901b3ff4746457c4d2c10066cf88b58fe2ef4cb97a9bc83077063ad07b9cde8d

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