Skip to main content

A Python library to automate generating, parallelizing, and executing quantum programs.

Project description

Divi

Generate, parallelize, and execute quantum programs at scale.

PyPI Python Docs License Code style: black Checked with pyrefly


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.

⚡ Quick Start

pip install qoro-divi

Nightly Builds

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

pip install qoro-divi --pre

Run a VQE energy minimization in a few lines:

import numpy as np
import pennylane as qp
from divi.qprog import VQE, HartreeFockAnsatz
from divi.backends import MaestroSimulator
from divi.qprog.optimizers import ScipyOptimizer, ScipyMethod

# Define an H₂ molecule
molecule = qp.qchem.Molecule(
    symbols=["H", "H"],
    coordinates=np.array([(0, 0, 0), (0, 0, 0.5)]),
)

vqe = VQE(
    molecule=molecule,
    ansatz=HartreeFockAnsatz(),
    n_layers=2,
    backend=MaestroSimulator(shots=5000),
    optimizer=ScipyOptimizer(method=ScipyMethod.COBYLA),
    seed=42,
)

vqe.run()
print(f"Ground state energy: {vqe.best_loss:.6f}")

Hamiltonians and circuits accept either Qiskit (SparsePauliOp, QuantumCircuit) or PennyLane (QuantumScript, operators) inputs interchangeably.

🌐 Cloud Execution with Qoro Service

Run the same programs on Qoro's cloud platform with tensor-network simulators — no code changes needed:

from divi.backends import QoroService

service = QoroService()  # reads QORO_API_KEY from .env or environment
vqe = VQE(molecule=molecule, backend=service)
vqe.run()

Get started for free → Sign up at 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.

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 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
Flexible Backends MaestroSimulator for fast local dev, QiskitSimulator for noisy simulation, 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

🏗️ Architecture

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)

📚 Documentation

Full documentation, user guides, and API reference: divi.readthedocs.io

Hands-on examples are in the tutorials/ folder.

� Contributing

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

📄 License

Apache 2.0 — see LICENSE for details.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qoro_divi-0.12.0.dev20260524.tar.gz (13.8 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qoro_divi-0.12.0.dev20260524-py3-none-any.whl (13.2 MB view details)

Uploaded Python 3

File details

Details for the file qoro_divi-0.12.0.dev20260524.tar.gz.

File metadata

  • Download URL: qoro_divi-0.12.0.dev20260524.tar.gz
  • Upload date:
  • Size: 13.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for qoro_divi-0.12.0.dev20260524.tar.gz
Algorithm Hash digest
SHA256 b7b5a4db8ccbdc08761a691afdf74e385797399ab8419fdef73f3574453fd896
MD5 d8b9358eb006c17fb7b9cf1a95bd615d
BLAKE2b-256 1c2d0e36bc0ae3260c3fec2c3bdb211c46770c491bff6a502c6f98dc6d71ab69

See more details on using hashes here.

Provenance

The following attestation bundles were made for qoro_divi-0.12.0.dev20260524.tar.gz:

Publisher: nightly.yml on QoroQuantum/divi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qoro_divi-0.12.0.dev20260524-py3-none-any.whl.

File metadata

File hashes

Hashes for qoro_divi-0.12.0.dev20260524-py3-none-any.whl
Algorithm Hash digest
SHA256 5975a28ba3fbef7e1bbbd6e2d53d1390c6908a4ab1e755906be21f1834f64a23
MD5 2e70d88fb1ce3e3e65196b1b547c9e92
BLAKE2b-256 dd61b608f44a183b3c393c134293087805967a7034f312dc2eb2d35d988a7e44

See more details on using hashes here.

Provenance

The following attestation bundles were made for qoro_divi-0.12.0.dev20260524-py3-none-any.whl:

Publisher: nightly.yml on QoroQuantum/divi

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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