How omenndt/frombittoqubit works
Project Type and Purpose
• This is a hybrid full-stack application combining:
• A Unity-based visualization front end (C#)
• A Python backend that simulates quantum circuits
• Docker & Nginx for containerized deployment
• Jupyter notebooks for teaching/demo purposes
• Purpose: provide an educational journey from classical bits to qubits by running circuit simulations in Python and visualizing them in a Unity UI.
Main Components
A. Unity Frontend
– Unity/Assets/Scripts/QuantumSimulationManager.cs
– QuantumUI.cs, QuantumVisualizer.cs, QubitVisualizer.cs
*Role*: fetch simulation results and render them in 3D.
B. Python Backend Service
– quantum_backend.py (local)
– quantum_backend_simple.py (no-deps quick demo)
– quantum_backend_docker.py (production entry point)
– requirements.txt (dependencies)
*Role*: expose a REST or RPC API to compute quantum circuit state vectors or probabilities.
C. Orchestration & Reverse Proxy
– docker-compose.yml / docker-compose.simple.yml
– nginx.conf
– Dockerfile / Dockerfile.simple
– deploy.sh, DOCKER_SETUP.md, DOCKER_SUMMARY.md
*Role*: containerize backend, serve API over HTTP, optionally reverse-proxy via Nginx.
D. Demo & Testing
– circuits/01_circuit_basics.ipynb (educational notebook)
– test_backend.py, test_simple_backend.py, test_docker.py
*Role*: verify correctness of simulation and Docker setup.
Relationships & Data Flow
1. Unity Frontend → HTTP calls → Nginx (or direct)
2. Nginx → forwards /api/simulate requests → quantum_backend_docker container
3. Python Backend → computes quantum circuit → returns JSON payload
4. Unity ← parses JSON → updates visual representation
5. (Separately) Jupyter notebook reads quantum_backend.py for interactive exploration
6. CI/testing suite invokes backends and Docker environment to validate endpoints
Architectural Patterns & Principles
• Separation of Concerns: visualization (Unity) vs. computation (Python)
• Containerization: reproducible environment via Docker
• API-first design: backend exposes well-defined HTTP endpoints
• Extensibility: two backend modes (simple vs. full Docker) for quick demos or production
Diagramming Conventions
• Rounded-rectangle for applications (Unity, Jupyter Notebook)
• Parallelogram or cloud for external resources (Docker Hub, Git, NPM)
• Blue = Frontend components
• Green = Backend services
• Orange = Deployment/orchestration
• Gray = Demo/test artifacts
• Containers with ports exposed (e.g., 8000)
Final Checklist
• Every component is clearly labeled
• Notes on deployment scripts/compose files are included