Metadata-Version: 2.4
Name: online-qml
Version: 0.3.0
Summary: Online quantum machine learning package, using PyTorch.
Keywords: quantum,machine-learning,shadow-tomography,pytorch
Author: Alessandro Romancino
License-Expression: Apache-2.0
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Dist: numpy>=2.4
Requires-Dist: pandas>=3.0
Requires-Dist: torch>=2.11
Requires-Python: >=3.11
Project-URL: Repository, https://github.com/alex180500/online-qml
Project-URL: Issues, https://github.com/alex180500/online-qml/issues
Project-URL: Changelog, https://github.com/alex180500/online-qml/releases
Description-Content-Type: text/markdown

# 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

```python
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"]
```
