Metadata-Version: 2.5
Name: qoro-divi
Version: 0.17.0.dev202612020039
Summary: A Python library to automate generating, parallelizing, and executing quantum programs.
Project-URL: Homepage, https://qoroquantum.net
Project-URL: Documentation, https://divi.readthedocs.io
Project-URL: Repository, https://github.com/QoroQuantum/divi
Project-URL: Issue Tracker, https://github.com/QoroQuantum/divi/issues
Project-URL: Changelog, https://github.com/QoroQuantum/divi/blob/main/CHANGELOG.md
Author-email: Ahmed Darwish <ahmed@qoroquantum.de>, Stephen DiAdamo <stephen@qoroquantum.de>
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: optimization,qaoa,qiskit,quantum,quantum-computing,simulation,vqe
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: Apache Software License
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-Python: <3.15,>=3.11
Requires-Dist: dill<0.5,>=0.4
Requires-Dist: dimod<0.13,>=0.12
Requires-Dist: matplotlib<4.0,>=3.10
Requires-Dist: networkx<4.0,>=3.5
Requires-Dist: numba>=0.68.0
Requires-Dist: numpy
Requires-Dist: platformdirs<5.0,>=4.13
Requires-Dist: pydantic<3.0,>=2.14
Requires-Dist: pymetis<2026.0.0,>=2025.2; sys_platform != 'win32'
Requires-Dist: pymoo<0.7,>=0.6
Requires-Dist: python-dotenv<2.0,>=1.1.1
Requires-Dist: qiskit>=2.6.1
Requires-Dist: qoro-maestro==0.3.15
Requires-Dist: requests<3.0,>=2.32
Requires-Dist: rich>=15.0
Requires-Dist: rustworkx>=0.18
Requires-Dist: scikit-learn<2.0,>=1.7
Requires-Dist: scipy<2.0,>=1.17
Requires-Dist: stim<2.0,>=1.15.0
Requires-Dist: sympy<2.0,>=1.14
Requires-Dist: textual<9.0.0,>=8.1.1
Requires-Dist: threadpoolctl<4.0,>=3.1
Provides-Extra: aer
Requires-Dist: qiskit-aer>=0.18; extra == 'aer'
Requires-Dist: qiskit-ibm-runtime>=0.51; extra == 'aer'
Provides-Extra: ai
Requires-Dist: bm25s<0.4,>=0.3; extra == 'ai'
Requires-Dist: docutils>=0.18; extra == 'ai'
Requires-Dist: faiss-cpu<2.0.0,>=1.13.2; extra == 'ai'
Requires-Dist: fastembed<0.10.0,>=0.9; extra == 'ai'
Requires-Dist: huggingface-hub>=1.0; extra == 'ai'
Requires-Dist: llama-cpp-python<0.4.0,>=0.3.16; extra == 'ai'
Requires-Dist: psutil<8.0,>=7.0; extra == 'ai'
Requires-Dist: pyperclip<2.0.0,>=1.11.0; extra == 'ai'
Provides-Extra: all
Requires-Dist: dwave-hybrid<0.7.0,>=0.6.14; extra == 'all'
Requires-Dist: ffsim<0.1,>=0.0.85; (sys_platform != 'win32') and extra == 'all'
Requires-Dist: ipykernel<8.0.0,>=7.1.0; extra == 'all'
Requires-Dist: ipywidgets<9.0.0,>=8.1.7; extra == 'all'
Requires-Dist: openfermion<2.0,>=1.5; extra == 'all'
Requires-Dist: pennylane<0.46,>=0.45; extra == 'all'
Requires-Dist: pyscf<3.0,>=2.14; (sys_platform != 'win32') and extra == 'all'
Requires-Dist: qiskit-aer>=0.18; extra == 'all'
Requires-Dist: qiskit-ibm-runtime>=0.51; extra == 'all'
Requires-Dist: qiskit-nature<0.9.0,>=0.8.0; extra == 'all'
Requires-Dist: qrmi[ibm]<0.28,>=0.27; (sys_platform == 'linux') and extra == 'all'
Requires-Dist: threadpoolctl<4,>=3.1; extra == 'all'
Provides-Extra: chem
Requires-Dist: ffsim<0.1,>=0.0.85; (sys_platform != 'win32') and extra == 'chem'
Requires-Dist: openfermion<2.0,>=1.5; extra == 'chem'
Requires-Dist: pyscf<3.0,>=2.14; (sys_platform != 'win32') and extra == 'chem'
Requires-Dist: qiskit-nature<0.9.0,>=0.8.0; extra == 'chem'
Requires-Dist: threadpoolctl<4,>=3.1; extra == 'chem'
Provides-Extra: jupyter
Requires-Dist: ipykernel<8.0.0,>=7.1.0; extra == 'jupyter'
Requires-Dist: ipywidgets<9.0.0,>=8.1.7; extra == 'jupyter'
Provides-Extra: pennylane
Requires-Dist: pennylane<0.46,>=0.45; extra == 'pennylane'
Provides-Extra: qrmi
Requires-Dist: qrmi[ibm]<0.28,>=0.27; (sys_platform == 'linux') and extra == 'qrmi'
Provides-Extra: qubo-decompose
Requires-Dist: dwave-hybrid<0.7.0,>=0.6.14; extra == 'qubo-decompose'
Description-Content-Type: text/markdown

<p align="center">
  <h1 align="center">Divi</h1>
  <p align="center">
    <em>Generate, parallelize, and execute quantum programs at scale.</em>
  </p>
</p>

<p align="center">
  <a href="https://pypi.org/project/qoro-divi/"><img src="https://img.shields.io/pypi/v/qoro-divi?color=blue" alt="PyPI"></a>
  <a href="https://pypi.org/project/qoro-divi/"><img src="https://img.shields.io/pypi/pyversions/qoro-divi" alt="Python"></a>
  <a href="https://divi.readthedocs.io"><img src="https://img.shields.io/badge/docs-readthedocs-blue" alt="Docs"></a>
  <a href="LICENSES/Apache-2.0.txt"><img src="https://img.shields.io/badge/license-Apache%202.0-green" alt="License"></a>
  <a href="https://github.com/astral-sh/ruff"><img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json" alt="Ruff"></a>
  <a href="https://github.com/facebook/pyrefly"><img src="https://img.shields.io/endpoint?url=https://pyrefly.org/badge.json" alt="Checked with pyrefly"></a>
</p>

---

**Divi** is a Python library by [Qoro Quantum](https://qoroquantum.net) for building and running quantum programs at scale. It handles circuit generation, job parallelization, and cloud execution — with built-in support for variational algorithms, custom workflows, and more — so you can focus on the quantum problem, not the plumbing.

> [!IMPORTANT]
> Divi is under active development. Expect breaking changes between minor versions.

<!-- -->

> [!TIP]
> **Using Claude Code, Cursor, or another LLM coding agent?** Divi is indexed on [Context7](https://context7.com/qoroquantum/divi) — point your agent at `/qoroquantum/divi` to pull current, version-specific Divi docs and snippets directly into its context.

## 📦 Installation

```bash
pip install qoro-divi
```

That covers local and cloud execution, VQE, QAOA, and program ensembles.
Heavier features live behind optional extras — `pennylane` (PennyLane circuits,
operators, and molecules), `aer` (Qiskit Aer backends), `qubo-decompose`
(partitioned QUBO solving), `chem` (PySCF/OpenFermion chemistry), `qrmi`
(QRMI-managed resources, Linux only), `ai`, and `jupyter` — or `pip install "qoro-divi[all]"` for all of them but `ai`. See the
**[installation guide](https://divi.readthedocs.io/en/latest/installation.html)**
for what each unlocks and what keeps working without it.

### Nightly Builds

To install the latest development build (published daily from `main`):

```bash
pip install qoro-divi --pre
```

### Learning Divi

For the shortest introduction, start with the
**[five-minute tutorial](https://divi.readthedocs.io/en/latest/quickstart.html)**.
Algorithm guides, execution guides, and the API reference live at
**[divi.readthedocs.io](https://divi.readthedocs.io)**; hands-on examples are in
the [`tutorials/`](tutorials/) folder.

## ⚡ At-Scale Example

Split a graph into quantum-sized MaxCut problems, solve the partitions, and
stitch their candidates into a global solution:

```python
import networkx as nx

from divi.backends import MaestroSimulator
from divi.qprog.algorithms import QAOA
from divi.qprog.ensembles import BeamSearchStrategy
from divi.qprog.optimizers import ScipyOptimizer, ScipyMethod
from divi.qprog.problems import GraphPartitioningConfig, MaxCutProblem
from divi.qprog.ensembles import PartitioningProgramEnsemble

graph = nx.barbell_graph(4, 0)
problem = MaxCutProblem(
    graph,
    config=GraphPartitioningConfig(
        max_n_nodes_per_cluster=4,
        partitioning_algorithm="kernighan_lin",
    ),
)

backend = MaestroSimulator()
ensemble = PartitioningProgramEnsemble(
    problem=problem,
    program_factory=QAOA,
    n_layers=1,
    backend=backend,
    optimizer=ScipyOptimizer(method=ScipyMethod.COBYLA),
    max_iterations=10,
    seed=42,
)

ensemble.run()
cut, _ = ensemble.aggregate_results(
    strategy=BeamSearchStrategy(beam_width=3, n_partition_candidates=5)
)
print(f"Cut edges: {nx.cut_size(graph, cut)}")
print(f"Circuits executed: {ensemble.total_circuit_count}")
```

``PartitioningProgramEnsemble`` handles decomposition, parallel execution, and
candidate aggregation while each partition remains small enough for the chosen
backend.

## 🌐 Cloud Execution with Qoro Service

Run the same workflow on Qoro's cloud platform by swapping only the backend:

```python
from divi.backends import QoroService

backend = QoroService()  # reads QORO_API_KEY from .env or environment
```

**Get started for free** → Sign up at [dash.qoroquantum.net](https://dash.qoroquantum.net/) and receive **$100 worth of credits** to run your first quantum programs on our cloud.

## 🤖 divi-ai: AI Coding Assistant

Ask questions about Divi directly in your terminal — no API keys, no internet required after setup.

```bash
pip install qoro-divi[ai]
divi-ai
```

Answers questions about Divi APIs, generates code examples, and explains concepts — powered by a local LLM that runs entirely on your machine. See the [full documentation](https://divi.readthedocs.io/en/latest/tools/divi_ai.html) for model options and usage.

## 🧩 Key Features

| Feature | Description |
|---|---|
| **VQE & QAOA** | Built-in variational algorithms with pluggable ansätze and optimizers |
| **Circuit Pipelines** | Expand → execute → reduce pattern for complex circuit workflows |
| **Program Ensembles** | Parallel execution of multiple quantum programs with automatic scheduling, over one round or many adaptive ones |
| **Flexible Backends** | `MaestroSimulator` for local simulation, `QiskitSimulator` for Qiskit-native noise models (extra: `aer`), `QoroService` for cloud execution |
| **Execution Config** | Control bond dimension, simulator type, and simulation method per job |
| **Live Reporting** | Real-time dashboards and convergence tracking via callbacks |

## Contributing

Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup, testing, and code style guidelines.

## 📄 License

Apache 2.0 — see [LICENSE](LICENSES/Apache-2.0.txt) for details.
