Divi
Divi is a Python library developed by Qoro Quantum that enables scalable, cloud-based execution of hybrid quantum-classical programs. It abstracts away the complexity of distributed quantum computing by automatically optimizing, parallelizing, and dispatching jobs across heterogeneous compute resources such as CPUs, GPUs, FPGAs, and quantum processing units (QPUs).
Whether you’re a student, researcher, or enterprise developer, Divi provides a unified interface for building and running quantum workflows that integrate classical logic, parameterized quantum circuits, and cloud resource orchestration.
Key Features
-
Unified API for hybrid workflows
Write quantum-classical applications using Python without worrying about the backend infrastructure. -
Automatic parallelization
Divi generates parallel workloads and submits them to Qoro’s centralized cloud system for execution. -
Efficient batch job generation
Large batch programs are generated, managing program variables in an efficent way. -
Build-in resilence and backup
Automatic job monitoring with retry and backups for iterative algorithms. -
Built-in support for popular frameworks
Works with libraries like Qiskit, Cirq, and PennyLane, allowing you to reuse existing quantum code.
Who is it for?
-
Students & Educators
Teach and learn hybrid quantum programming without needing access to specialized infrastructure. -
Researchers
Prototype and scale experiments that integrate quantum and classical components with minimal overhead. -
Enterprises
Accelerate time-to-value from quantum exploration by integrating existing compute with quantum resources.
Code Example
To execute parallelized and distributed programs from Divi, one only needs to include their parameters to the problem, and Divi and the rest of the stack handle the execution. No need to define simulators or backends. Qoro’s stack handles it all.
from divi.qprog import VQEAnsatze, VQEHyperparameterSweep
from divi.qprog.optimizers import Optimizers
from divi.services import QoroService
q_service = QoroService(QORO_API_KEY)
vqe_problem = VQEHyperparameterSweep(
symbols=["H", "H"],
bond_lengths=list(np.linspace(0.1, 2.7, 25)),
ansatze=[VQEAnsatze.HARTREE_FOCK, VQEAnsatze.UCCSD],
coordinate_structure=[(0, 0, 0), (0, 0, 1)],
max_iterations=10,
optimizer=Optimizers.MONTE_CARLO,
shots=5000,
qoro_service=q_service,
)
vqe_problem.create_programs()
vqe_problem.run()
vqe_problem.aggregate_results()
print(f"Total circuits: {vqe_problem.total_circuit_count}")
print(f"Simulation time: {vqe_problem.total_run_time}")
vqe_problem.visualize_results()
Optimization
Divi provides built-in support for optimizing quantum programs currently using three distinct methods, each suited to different problem types and user requirements. These methods can be used interchangeably within Divi’s parallel execution framework, allowing users to flexibly explore and fine-tune their solutions.
1. Monte Carlo Optimization
The Monte Carlo method in Divi is a stochastic global optimization approach. It works by randomly sampling the parameter space and selecting configurations that minimize the target cost function. This method is particularly useful when:
- The optimization landscape is rugged or non-convex.
- Gradients are not available or are unreliable.
- A rough global search is preferred before local refinement.
Monte Carlo optimization can help identify promising regions in high-dimensional parameter spaces before applying more refined methods.
2. Nelder-Mead
Nelder-Mead is a gradient-free, simplex-based optimization algorithm. It is ideal for local optimization in low to moderate dimensional spaces. The method iteratively refines a simplex (a geometrical figure defined by a set of parameter vectors) by evaluating cost function values and applying operations such as reflection, expansion, and contraction.
Use Nelder-Mead when:
- Your problem is continuous but noisy.
- Gradients are unavailable or expensive to compute.
- You are tuning parameters in a relatively low-dimensional space.
3. L-BFGS-B with Parameter Shift Gradients
L-BFGS-B (Limited-memory Broyden–Fletcher–Goldfarb–Shanno with Bound constraints) is a quasi-Newton method that leverages gradient information to efficiently converge to a local minimum. In Divi, gradient calculation is performed using the parameter shift rule, a technique well-suited to quantum circuits that allows for analytical gradient computation by evaluating the function at shifted parameter values.
Divi computes these parameter shifts in parallel, significantly reducing wall-clock time for gradient evaluations.
Use L-BFGS-B when:
- You require fast convergence to a local minimum.
- Your cost function is smooth and differentiable.