Welcome to the Luna Quantum SDK demonstration! This project showcases Luna Quantum's powerful optimization capabilities through comprehensive implementations of classic optimization problems including the Traveling Salesman Problem (TSP) and Warehouse Location Problem (WLP).
This project demonstrates Luna Quantum's key features:
- Unified Programming Model: Write once, run on classical CPUs, quantum simulators, or real quantum hardware
- Smart Abstractions: Focus on problem modeling while Luna handles algorithm-specific transformations
- Plug-and-Play Architecture: Seamlessly switch between algorithms and backends without code changes
- Production-Ready: Enterprise-grade quantum cloud platform with secure token management
We solve the TSP for 4 German cities: Berlin, Hamburg, Munich, and Cologne. The goal is to find the shortest route that visits all cities exactly once and returns to the starting point.
We solve a facility location optimization challenge that determines which warehouses to open and how to assign customers to minimize total cost. The problem considers:
- 🚚 Transportation costs from warehouses to customers (hospitals in this demo)
- 💰 Setup costs for opening new warehouses
- 📦 Capacity constraints for each facility
- Python 3.13 or higher
- uv package manager
-
Clone the repository (if applicable) or navigate to the project directory:
cd /path/to/LunaDemo -
Install dependencies using uv:
uv sync
This will install all required packages from
pyproject.toml:folium>=0.19.7- Interactive mapsipywidgets>=8.1.7- Jupyter widgetsluna-quantum>=1.0.0- Luna Quantum SDKmatplotlib>=3.10.3- Plottingnetworkx>=3.5- Graph processingnotebook>=7.4.3- Jupyter notebookpandas>=2.3.0- Data manipulation
Set up your quantum computing tokens:
-
D-Wave Token (for quantum annealing):
export DWAVE_TOKEN="your_dwave_token_here"
-
Luna Quantum API Key (if required):
export LUNA_API_KEY="your_luna_api_key_here"
-
Start Jupyter:
uv run jupyter notebook
-
Open the notebooks:
Traveling Salesman Problem (TSP):
- Main demo: Navigate to
notebooks/TSP_with_LunaSolve.ipynbfor the full demonstration - Lite version: Open
notebooks/TSP_with_LunaSolve_lite.ipynbfor a streamlined version
Warehouse Location Problem (WLP):
-
Main demo: Navigate to
notebooks/WLP_with_FlexQAOA.ipynbfor the full demonstration -
Lite version: Open
notebooks/WLP_with_FlexQAOA_lite.ipynbfor a streamlined version -
Run cells sequentially to see the demonstrations
- Main demo: Navigate to
LunaDemo/
├── README.md # This file
├── pyproject.toml # Project dependencies
├── uv.lock # Locked dependencies
├── notebooks/ # Jupyter notebooks
│ ├── TSP_with_LunaSolve.ipynb # TSP main demonstration notebook
│ ├── TSP_with_LunaSolve_lite.ipynb # TSP streamlined demonstration
│ ├── WLP_with_FlexQAOA.ipynb # WLP main demonstration notebook
│ ├── WLP_with_FlexQAOA_lite.ipynb # WLP streamlined demonstration
│ └── plots/ # Visualization assets
└── utils/ # Utility functions
- Rapid prototyping with
TravellingSalesmanProblem - Automatic model generation from graph data
- Zero-setup optimization patterns
- Position-based TSP formulation
- Advanced constraint handling
- Algorithm-agnostic model development
- Classical algorithms (Simulated Annealing, Tabu Search, SCIP)
- Quantum algorithms (Quantum Annealing, FlexQAOA)
- Hybrid approaches and advanced constraint handling
- Algorithm comparison and benchmarking
The demos will show you:
- Problem Setup: Interactive map showing the 4 German cities
- Model Creation: Two different modeling approaches (predefined vs custom)
- Algorithm Comparison: Results from classical and quantum algorithms
- Solution Visualization: Optimal tour plotted on an interactive map
- Problem Setup: Network visualization of warehouses, hospitals, and transportation costs
- Model Creation: Constrained optimization with capacity limits and facility costs
- FlexQAOA Variants: Comparison of different constraint handling approaches (standard QAOA, one-hot encoding, indicator functions)
- Performance Analysis: Solution quality distributions and algorithm benchmarking
- Missing tokens: Ensure environment variables are set correctly
- Package conflicts: Use
uv sync --forceto resolve dependencies - Jupyter not starting: Try
uv run jupyter labinstead ofjupyter notebook - D-Wave connection issues: Verify your token has sufficient credits and access
If you encounter issues:
- Check the troubleshooting section above
- Verify all environment variables are set
- Ensure you have sufficient credits on quantum platforms
- Review the notebook outputs for error messages
- Reach out to the team at support@aqarios.com
After running these demos:
- Experiment with different algorithms and parameters
- Modify the problems by adding more cities/facilities or constraints
- Compare FlexQAOA variants on your own optimization problems
- Explore other Luna Quantum use cases
- Scale to larger, real-world optimization problems
Ready to explore quantum-enhanced optimization? Start with either the TSP or WLP notebooks and experience the future of problem-solving!