Generate, parallelize, and execute quantum programs at scale.
Divi is a Python library by Qoro Quantum 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 — point your agent at /qoroquantum/divi to pull current, version-specific Divi docs and snippets directly into its context.
For the shortest introduction, start with the five-minute tutorial.
pip install qoro-diviTo install the latest development build (published daily from main):
pip install qoro-divi --preSplit a graph into quantum-sized MaxCut problems, solve the partitions, and stitch their candidates into a global solution:
import networkx as nx
from divi.backends import MaestroSimulator
from divi.qprog import BeamSearchStrategy
from divi.qprog.optimizers import ScipyOptimizer, ScipyMethod
from divi.qprog.problems import GraphPartitioningConfig, MaxCutProblem
from divi.qprog.workflows 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,
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.
Run the same workflow on Qoro's cloud platform by swapping only the backend:
from divi.backends import QoroService
backend = QoroService() # reads QORO_API_KEY from .env or environmentGet started for free → Sign up at dash.qoroquantum.net and receive $100 worth of credits to run your first quantum programs on our cloud.
Ask questions about Divi directly in your terminal — no API keys, no internet required after setup.
pip install qoro-divi[ai]
divi-aiAnswers 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 for model options and usage.
| 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, 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 |
divi/
├── qprog/ # Quantum programs: VQE, QAOA, base classes, optimizers
├── backends/ # Execution backends: MaestroSimulator, QiskitSimulator, QoroService
├── circuits/ # MetaCircuit templates and Circuit instances
├── pipeline/ # Circuit pipeline stages (expand, execute, reduce)
├── hamiltonians # Molecular Hamiltonian generation
├── reporting/ # Live reporting and visualization callbacks
└── ai/ # Offline documentation chatbot (divi-ai)
Algorithm guides, execution guides, and API reference: divi.readthedocs.io
Hands-on examples are in the tutorials/ folder.
Contributions are welcome! See CONTRIBUTING.md for development setup, testing, and code style guidelines.
Apache 2.0 — see LICENSE for details.