Metadata-Version: 2.4
Name: openqml
Version: 0.14.0
Summary: Deep quantum-classical neural networks with tensor-network execution and hardware-aware training
Author: OpenQML contributors
License-Expression: Apache-2.0
Project-URL: Repository, https://github.com/OpenQML-org/OpenQML
Keywords: quantum,machine-learning,pytorch,jax,quantum-computing
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: packaging>=23
Requires-Dist: psutil>=5.9
Requires-Dist: numpy>=1.24; platform_system != "Darwin" or platform_machine != "x86_64"
Requires-Dist: numpy<2,>=1.26; platform_system == "Darwin" and platform_machine == "x86_64"
Provides-Extra: torch
Requires-Dist: torch>=2.2; extra == "torch"
Provides-Extra: jax
Requires-Dist: jax>=0.4.30; extra == "jax"
Requires-Dist: optax>=0.2; extra == "jax"
Provides-Extra: qiskit
Requires-Dist: qiskit[qasm3-import]>=1.2; extra == "qiskit"
Requires-Dist: sympy>=1.12; extra == "qiskit"
Provides-Extra: aer
Requires-Dist: qiskit[qasm3-import]>=1.2; extra == "aer"
Requires-Dist: qiskit-aer>=0.15; extra == "aer"
Requires-Dist: sympy>=1.12; extra == "aer"
Provides-Extra: qasm
Requires-Dist: qiskit[qasm3-import]>=1.2; extra == "qasm"
Requires-Dist: openqasm3[parser]>=1.0; extra == "qasm"
Requires-Dist: sympy>=1.12; extra == "qasm"
Provides-Extra: flax
Requires-Dist: jax>=0.4.30; extra == "flax"
Requires-Dist: flax>=0.10; extra == "flax"
Requires-Dist: optax>=0.2; extra == "flax"
Provides-Extra: symbolic
Requires-Dist: sympy>=1.12; extra == "symbolic"
Provides-Extra: tensor
Requires-Dist: cotengra<0.8,>=0.7.5; (python_version < "3.11" or (platform_system == "Darwin" and platform_machine == "x86_64")) and extra == "tensor"
Requires-Dist: autoray<0.8,>=0.7.2; (python_version < "3.11" or (platform_system == "Darwin" and platform_machine == "x86_64")) and extra == "tensor"
Requires-Dist: cotengra>=0.8.3; (python_version >= "3.11" and (platform_system != "Darwin" or platform_machine != "x86_64")) and extra == "tensor"
Requires-Dist: autoray>=0.8.4; (python_version >= "3.11" and (platform_system != "Darwin" or platform_machine != "x86_64")) and extra == "tensor"
Provides-Extra: pennylane
Requires-Dist: pennylane>=0.40; extra == "pennylane"
Requires-Dist: sympy>=1.12; extra == "pennylane"
Provides-Extra: cirq
Requires-Dist: cirq-core>=1.4; extra == "cirq"
Requires-Dist: sympy>=1.12; extra == "cirq"
Provides-Extra: all
Requires-Dist: torch>=2.2; extra == "all"
Requires-Dist: jax>=0.4.30; extra == "all"
Requires-Dist: flax>=0.10; extra == "all"
Requires-Dist: optax>=0.2; extra == "all"
Requires-Dist: qiskit[qasm3-import]>=1.2; extra == "all"
Requires-Dist: qiskit-aer>=0.15; extra == "all"
Requires-Dist: pennylane>=0.40; extra == "all"
Requires-Dist: cirq-core>=1.4; extra == "all"
Requires-Dist: openqasm3[parser]>=1.0; extra == "all"
Requires-Dist: sympy>=1.12; extra == "all"
Requires-Dist: cotengra<0.8,>=0.7.5; (python_version < "3.11" or (platform_system == "Darwin" and platform_machine == "x86_64")) and extra == "all"
Requires-Dist: autoray<0.8,>=0.7.2; (python_version < "3.11" or (platform_system == "Darwin" and platform_machine == "x86_64")) and extra == "all"
Requires-Dist: cotengra>=0.8.3; (python_version >= "3.11" and (platform_system != "Darwin" or platform_machine != "x86_64")) and extra == "all"
Requires-Dist: autoray>=0.8.4; (python_version >= "3.11" and (platform_system != "Darwin" or platform_machine != "x86_64")) and extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=8; extra == "dev"
Requires-Dist: ruff>=0.11; extra == "dev"
Requires-Dist: build>=1.2; extra == "dev"
Requires-Dist: twine>=6; extra == "dev"
Dynamic: license-file

# OpenQML

[PyPI](https://pypi.org/project/openqml/) · [CI](https://github.com/OpenQML-org/OpenQML/actions/workflows/ci.yml) · [Documentation](https://github.com/OpenQML-org/OpenQML/tree/main/docs)

Quantum–classical models, quantitative finance and circuit interoperability in one Python package.

## Install

Python 3.10 or later:

```bash
python -m pip install --upgrade openqml
```

The core depends on NumPy, packaging and psutil. Frameworks and quantum SDKs are
optional; importing OpenQML loads neither NumPy nor execution engines.

## Allocate a portfolio

```python
import openqml as oq

returns = [[0.01, -0.02], [-0.01, 0.03], [0.02, 0.01]]
portfolio = oq.finance.allocate(returns, caps=0.7, fees=0.001)
print(portfolio.weights)
```

The allocator includes factor risk, position limits, funding and transaction
costs. Supply your own return observations and previous holdings.

## Train a model

Install `openqml[torch]`, `openqml[jax]` or `openqml[flax]`, then use the same
`fit`/`predict` interface:

```python
import openqml as oq

x = [[0.0, 0.0], [0.0, 1.0], [1.0, 0.0], [1.0, 1.0]] * 8
y = [0, 1, 1, 0] * 8
model = oq.Model(task="classification", hidden_features=8, depth=2)
model.fit(x, y)
print(model.predict(x[:2]))
```

Set `framework="jax"` or `framework="flax"` to change the training integration.
Tasks include `regression`, `classification` and `forecast`. The native network
and trainer remain available as `model.module` and `model.trainer`.

## Interfaces

| Task | Entry point |
| --- | --- |
| Supervised hybrid models | `oq.Model` |
| Custom convolution, attention, graph and generative networks | `oq.HybridArchitecture` |
| Risk, allocation, accounting and pricing | `oq.finance` |
| Native framework layers | `oq.torch`, `oq.jax`, `oq.flax` |
| Circuits and conversion | `oq.Circuit`, `oq.convert`, `oq.compile_program` |
| Tensor contraction and distribution | `oq.TensorNetworkPlan`, `oq.DistributedTensorPlan` |
| Quantum reinforcement learning | Framework `QuantumActorCritic` and `PPOTrainer` |
| Hardware and cost policies | `oq.configure_runtime`, `oq.CostAwareBackend` |

`framework` selects the training integration, `backend` selects circuit execution,
and `device` selects native tensor placement. Modules, integrations and backends
load when used. Existing low-level APIs remain available through `oq`.

Automatic pricing uses available exact calculations before amplified sampling.
Quantum estimation accepts an error target, calibrated contrast and query limits.
Quantum query advantages depend on coherent oracles, noise and total execution
cost. Circuit capacity follows memory, work and backend limits; there is no fixed
library-wide qubit ceiling.

[API guide](https://github.com/OpenQML-org/OpenQML/blob/main/docs/api.md) · [Finance](https://github.com/OpenQML-org/OpenQML/blob/main/docs/finance.md) · [Models](https://github.com/OpenQML-org/OpenQML/blob/main/docs/models.md) · [Stateful models](https://github.com/OpenQML-org/OpenQML/blob/main/docs/frontier-models.md) · [Training](https://github.com/OpenQML-org/OpenQML/blob/main/docs/hybrid-training.md) · [Tensor networks](https://github.com/OpenQML-org/OpenQML/blob/main/docs/tensor-networks.md) · [Runtime](https://github.com/OpenQML-org/OpenQML/blob/main/docs/runtime.md)

## License

[Apache-2.0](https://github.com/OpenQML-org/OpenQML/blob/main/LICENSE).
