Divi
Divi is Qoro’s open-source Python library for building, executing, and managing quantum programs. It provides high-level abstractions for variational quantum algorithms, combinatorial optimization, quantum chemistry, and Hamiltonian simulation β with built-in support for parallel execution, error mitigation, checkpointing, and multi-backend deployment.
Divi handles the complexity of quantum-classical hybrid workflows so you can focus on the problem, not the plumbing.
π For installation instructions, code examples, and API usage, visit the Divi Documentation.
Core Concepts
Quantum Programs
Every quantum workload in Divi is a QuantumProgram β a composable unit that encapsulates circuit generation, parameter management, execution, and result processing. Higher-level constructs like VQE, QAOA, and PCE all extend this base.
Parallel Execution
Divi’s execution model is inherently parallel. Whether running locally on MaestroSimulator or remotely via QoroService, circuits are dispatched in batches and results are aggregated automatically.
Backends
| Backend | Description |
|---|---|
MaestroSimulator |
Default local backend powered by Maestro β state vector, MPS, and auto-routing |
QiskitSimulator |
Local Qiskit Aer simulation with noise model support and fake backends |
QoroService |
Cloud execution through Composer, with access to Maestro and QPU hardware |
Built-In Algorithms
| Algorithm | Use Case |
|---|---|
| VQE | Ground-state energy estimation for quantum chemistry |
| QAOA | Combinatorial optimization (MaxCut, Max-Clique, QUBO, etc.) |
| PCE | Pauli Correlation Encoding β logarithmic qubit reduction for QUBO problems |
| TimeEvolution | Hamiltonian time evolution via Trotter-Suzuki decomposition |
| CustomVQA | Optimize any parameterized PennyLane or Qiskit circuit |
Workflows
| Workflow | Description |
|---|---|
| PartitioningProgramEnsemble | Divide-and-conquer optimization on large graphs or QUBOs via partitioning (QAOA, PCE, or Iterative QAOA) |
| VQEHyperparameterSweep | Sweep bond lengths and ansatze for molecular energy surfaces |
Ansatze
Divi provides a library of parameterized circuit templates:
| Ansatz | Description |
|---|---|
HartreeFockAnsatz |
Chemistry-inspired initial state |
UCCSDAnsatz |
Unitary Coupled Cluster Singles and Doubles |
QAOAAnsatz |
Standard QAOA mixer/cost layers |
HardwareEfficientAnsatz |
Hardware-native entangling layers |
GenericLayerAnsatz |
Custom gate sequences repeated in layers |
All ansatze extend the Ansatz abstract base class. Custom ansatze can be created by subclassing it.
Optimizers
Divi offers classical optimizers as composable objects:
| Optimizer | Type | Method |
|---|---|---|
ScipyOptimizer |
Gradient-based & gradient-free | L-BFGS-B, Nelder-Mead, COBYLA, and all SciPy methods |
MonteCarloOptimizer |
Stochastic global search | Random parameter sampling |
GridSearchOptimizer |
Exhaustive search | Systematic parameter sweeps over defined grids |
PymooOptimizer |
Evolutionary | CMA-ES, Differential Evolution |
See the Technical Summary for details.
Circuit Transformations
- Observable Grouping β Reduces measurement overhead by grouping commuting observables
- Zero-Noise Extrapolation (ZNE) β Error mitigation via Mitiq integration
See the Technical Summary for details.
Additional Features
Checkpointing
Save and resume optimization state at any iteration. Useful for long-running VQE/QAOA jobs on cloud backends. See the Technical Summary for details.
Top-N Solutions API
Access the best solutions found during optimization via get_top_solutions(), with probability-ranked results and decoded variable assignments (for PCE).
Circuit Depth Tracking
All backends automatically track circuit depths during execution, enabling performance analysis and depth-reduction strategies.
BinaryQuadraticModel Support
QAOA and PCE accept D-Wave’s BinaryQuadraticModel as input, in addition to NumPy arrays and sparse matrices.
Getting Started
Install Divi via pip:
pip install qoro-diviFor detailed usage instructions, code examples, and API reference, please visit the Divi Documentation.