Skip to content

sai21-learn/Amphan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Amphan Quantum 🌪️⚛️

Amphan Quantum is an AI-powered decision support system that leverages Quantum Approximate Optimization Algorithms (QAOA) to solve complex evacuation routing problems during cyclones. By combining real-world geospatial data with quantum simulation, it finds the most efficient, low-risk paths to move coastal populations to safety.


🚀 How to Run the Simulation

1. Prerequisites

  • Python 3.14+ (Optimized for scipy and pennylane).
  • Node.js 20+.
  • Arch Linux (Preferred environment with gcc-fortran and OpenBLAS installed).

2. Setup Backend

cd backend
# Create virtual environment (if not already done)
python3 -m venv --system-site-packages venv
# Install dependencies
./venv/bin/pip install -r requirements.txt
# Run the FastAPI server
./venv/bin/python3 -m uvicorn app:app --host 0.0.0.0 --port 8001

3. Setup Frontend

cd frontend
# Install dependencies
npm install
# Run the Vite development server
npm run dev -- --host --port 5173

4. Access the Simulation

Open your browser to http://localhost:5173.

  • Left Sidebar: Adjust QAOA depth, iterations, and population metrics.
  • Map (Center): Drag the storm track markers or shelter markers to see the quantum algorithm re-route in real-time.
  • Right Sidebar: Compare the QAOA (Quantum) strategy against a Greedy (Classical) baseline.

🧠 How the Project Works

  1. Environment Modeling: The system builds a network graph where Villages are source nodes and Shelters are destination nodes.
  2. Risk Scoring: For every road segment, the backend calculates a Flood Risk Score using the cyclone's trajectory. Roads closer to the storm track are penalized with higher "travel time."
  3. Real-world Distance: Integrated with the OSRM (OpenStreetMap) API, the system uses actual driving distances, not just straight-line paths.
  4. Quantum Optimization:
    • The routing problem is converted into a QUBO (Quadratic Unconstrained Binary Optimization) matrix.
    • The QAOA algorithm then searches the vast state space (millions of possible routing combinations) to find a global minimum that minimizes total evacuation time while staying within shelter capacities.

⚛️ Why Quantum?

The "Scaling Wall"

Classical routing algorithms (like Dijkstra or A*) are excellent for single paths. However, Mass Evacuation is a combinatorial optimization problem:

  • With 10 villages and 5 shelters, there are $5^{10}$ (nearly 10 million) possible routing configurations.
  • As the number of villages grows, classical computers struggle to find the globally optimal solution in real-time.

How Quantum Enhances the Solution

  1. Superposition: Quantum computers can represent multiple routing configurations simultaneously, exploring the entire "solution landscape" much faster than a sequential classical processor.
  2. Quantum Interference: QAOA uses interference to amplify the probability of measuring the "low-cost" routing paths and cancel out the "high-risk" ones.
  3. Global Resilience: Unlike greedy algorithms that might overload the nearest shelter, the Quantum approach optimizes the entire system, ensuring that the last person arrives safely in the shortest possible time.

🛠️ Technical Architecture

  • Quantum Core: PennyLane with lightning.qubit simulator.
  • Backend: FastAPI (Python).
  • Geospatial: Leaflet.js for interactive mapping.
  • Routing API: OSRM (OpenStreetMap) for real-world driving data.
  • UI: React with Recharts for optimization convergence telemetry.

🐳 Deployment (Docker)

Build and deploy the complete stack using the provided Dockerfile:

docker build -t amphan-quantum .
docker run -p 8001:8001 amphan-quantum

Developed for the Quantum-Powered Disaster Resilience Challenge.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors