Examples

Examples

Divi Examples

The divi-examples repository contains complete, real-world applications built with Divi. Each example is a standalone project with its own documentation and can be run locally or on the cloud via QoroService.

1. Cluster MaxCut

Partitioned QAOA for MaxCut on large, community-structured graphs. Demonstrates how to split large graphs (e.g., 50+ qubits) into smaller sub-graphs using spectral clustering for parallel execution.

Highlights:

  • Graph partitioning with spectral clustering
  • Parallel QAOA execution on sub-graphs
  • Comparison of quantum vs. classical results
  • Support for both local simulation and cloud execution

2. Minimum Birkhoff Decomposition

VQE-based approach to find the Birkhoff decomposition of doubly stochastic matrices. Showcases Divi’s modular design — the application inherits from the VQE class with minimal, targeted changes.

Highlights:

  • Custom VQE implementation for Birkhoff decomposition
  • Multi-threaded classical optimization with caching
  • CLI for various problem configurations
  • Support for sparse and dense matrix types

3. Portfolio Optimization

Quantum portfolio optimization using QAOA combined with spectral partitioning for large-scale problems. Partitions the asset correlation graph into smaller sub-problems for efficient quantum execution.

Highlights:

  • QUBO formulation for portfolio optimization
  • Spectral partitioning based on asset correlations
  • Interactive Jupyter notebook workflow
  • Solution comparison between QAOA and exact solvers
  • Financial metrics analysis and visualization

4. Quantum-Guided Cluster Algorithm

Implementation of the Quantum-Guided Cluster Algorithm from arXiv:2508.10656. QAOA runs once to extract two-point correlations ⟨ZᵢZⱼ⟩, which guide a classical cluster Monte Carlo for Max-Cut.

Highlights:

  • QAOA as a one-shot correlation oracle
  • QWC observable grouping for up to 60% circuit reduction
  • Correlation-guided cluster Monte Carlo
  • Benchmarks against simulated annealing and coupling-constant baselines
  • Support for cloud execution via QoroService for >18-qubit instances

Running the Examples

git clone https://github.com/QoroQuantum/divi-examples.git
cd divi-examples

# Install dependencies
pip install qoro-divi

# For cloud execution, set your API key
export QORO_API_KEY="your-api-key"

# Run any example
cd cluster_maxcut
python main.py

Each example directory contains its own README.md with specific instructions and configuration options.