How sophavisnuka/quantum-maze-solver works
Quantum Maze Solver is an interactive maze game and Grover-search demonstration. Players configure and explore generated mazes, request a quantum solution, compare their route with the shortest route, and inspect the search rounds visually. The backend generates maze layouts, reduces them to decision graphs, and solves them using a configured simulation engine. The frontend renders the maze and solution, with separate visualizations for circuit statistics and Grover’s amplitude evolution. Evidence is limited to the supplied excerpts and SOURCE INDEX; the README is empty, so the frontend-to-backend HTTP link is shown as unverified.
Main entry points: App.tsx Game application · routes.py HTTP routes · useMazeGame.ts Game state and controls · maze_service.py Maze use cases
Components 23
Maze gameplay
- Game application
frontend/src/App.tsx - Game state and controls
frontend/src/hooks/useMazeGame.ts - Maze view
frontend/src/components/MazeGrid.tsx - Maze settings
frontend/src/components/SettingsPanel.tsx - Path actions
frontend/src/components/ActionsPanel.tsx - Maze API client
frontend/src/api/maze.ts
API and maze domain
- HTTP routes
backend/app/api/routes.py - Request and response schemas
backend/app/api/schemas.py - Maze use cases
backend/app/services/maze_service.py - Maze generation
backend/app/domain/generator.py - Maze and decision graph
backend/app/domain/maze.py - Maze shape templates
backend/app/domain/shapes.py
Quantum solving
- Grover solver
backend/app/services/grover_solver.py - Simulation engine selection
backend/app/services/engines/__init__.py - NumPy simulator
backend/app/services/engines/numpy_engine.py - Qiskit simulator
backend/app/services/engines/qiskit_engine.py
Solution exploration
- Solution and animation
frontend/src/components/SolutionPanel.tsx - Grover animation
frontend/src/components/GroverAnimation.tsx - Grover frames
frontend/src/utils/groverFrames.ts - Circuit statistics
frontend/src/components/CircuitPanel.tsx - Search charts
frontend/src/components/Charts.tsx - Measurement histogram
frontend/src/utils/histogram.ts
Other components
- Player
Connections 25
- Player → Game application: uses
frontend/src/App.tsx - Game application → Game state and controls: uses
frontend/src/App.tsx - Game application → Maze view: renders
frontend/src/App.tsx - Game application → Maze settings: renders
frontend/src/App.tsx - Game application → Path actions: renders
frontend/src/App.tsx - Game application → Solution and animation: renders
frontend/src/App.tsx - Game application → Circuit statistics: renders
frontend/src/App.tsx - Game state and controls → Maze API client: fetches maze and solution
frontend/src/hooks/useMazeGame.ts - Game state and controls → Maze view: supplies game state
- Player → HTTP routes: requests maze or solve
- Maze API client → HTTP routes: calls HTTP API
- HTTP routes → Request and response schemas: uses response models
backend/app/api/routes.py - HTTP routes → Maze use cases: calls use case
backend/app/api/routes.py - Maze use cases → Maze generation: generates maze
backend/app/services/maze_service.py - Maze generation → Maze and decision graph: builds maze graph
backend/app/domain/generator.py - Maze generation → Maze shape templates: loads template
backend/app/domain/generator.py - Maze use cases → Grover solver: solves maze
backend/app/services/maze_service.py - Grover solver → Maze and decision graph: searches maze routes
backend/app/services/grover_solver.py - Grover solver → Simulation engine selection: selects engine
backend/app/services/grover_solver.py - Simulation engine selection → NumPy simulator: dispatches
backend/app/services/engines/__init__.py - Simulation engine selection → Qiskit simulator: dispatches
backend/app/services/engines/__init__.py - Solution and animation → Grover animation: renders
frontend/src/components/SolutionPanel.tsx - Grover animation → Grover frames: builds animation frames
frontend/src/components/GroverAnimation.tsx - Circuit statistics → Search charts: renders charts
frontend/src/components/CircuitPanel.tsx - Circuit statistics → Measurement histogram: formats outcomes
frontend/src/components/CircuitPanel.tsx