A quantum computing demo application: SDK-agnostic algorithm library, a quantum-randomness CAPTCHA service, and a FastAPI layer - plus the original vendor reference notebooks.
qc_app/ THE APPLICATION (SDK-agnostic)
├── core/ Backend helpers (AerSimulator, counts)
├── algorithms/ 10 algorithms behind one registry interface
│ ├── deutsch_jozsa.py Constant vs balanced, one query
│ ├── grover.py Unstructured search (quadratic speedup)
│ ├── simon.py Hidden XOR mask (exponential speedup)
│ ├── shors.py Factoring via quantum period finding
│ ├── qft.py QFT / inverse QFT from primitive gates
│ ├── qpe.py Quantum Phase Estimation (T-gate demo)
│ ├── vqe.py VQE on H2 with built-in SPSA optimizer
│ └── qaoa.py QAOA for MaxCut optimization
├── apps/
│ └── captcha.py QuantumCaptcha: QRNG text + entanglement challenge
└── api/
└── main.py FastAPI service
notebooks/ VENDOR REFERENCE MATERIAL (original notebooks)
├── ibm/QisKit_BaseCircuit.ipynb Qiskit fundamentals (50 cells)
├── google/Cirq/simple_demo.ipynb Cirq basics
├── pennylane/ PennyLane QNodes & workflows
├── basics/ Microquantum, classical ML baseline
├── algorithms_*.ipynb Original algorithm notebooks
└── demos/QuantumCaptcha.ipynb Original captcha notebook
tests/ pytest suite (algorithms, captcha, API)
pip install -r requirements.txt
# Run any algorithm from Python
python -c "from qc_app.algorithms import run_algorithm; print(run_algorithm('shors', n=15))"
# Start the API + web UI
uvicorn qc_app.api.main:app --reload
# open http://localhost:8000 for the demo dashboarddocker build -t quantumcomputing-demo .
docker run -p 8000:8000 quantumcomputing-demo| Method | Path | Description |
|---|---|---|
| GET | /health |
Liveness check |
| GET | /algorithms |
List registered algorithms |
| POST | /algorithms/{name}/run |
Run an algorithm with JSON params |
| GET | /captcha?length=6 |
PNG captcha image (quantum RNG) |
| GET | /captcha/challenge |
Bell-state entanglement challenge |
Example:
curl -X POST localhost:8000/algorithms/grovers/run \
-H "Content-Type: application/json" \
-d '{"params": {"marked": "101"}}'- Shor's - factorization, O((log N)^3) vs classical exponential
- Grover's - search, O(sqrt(N)) queries
- QFT - periodicity detection, O((log N)^2) gates
- QPE - eigenphase estimation; core of Shor's
- Deutsch-Jozsa - constant/balanced in one query
- Simon's - hidden XOR structure, O(n) queries
- VQE - H2 ground state energy (NISQ-friendly hybrid)
- QAOA - MaxCut combinatorial optimization (NISQ-friendly hybrid)
- HHL - linear system solver Ax=b (2x2 Hermitian demo)
- Quantum Walk - discrete-time walk on a cycle graph
Roadmap additions: real-hardware backends (IBM Quantum), Streamlit UI.
pip install -r requirements.txt -r requirements-dev.txt
pytest -v # run test suite
flake8 qc_app testsCI runs on every push/PR to main via GitHub Actions.