How usainbond007/qpf works
Quantum Privacy Firewall combines a research pipeline that measures algorithm-family leakage and evaluates verified circuit rewrites with a separate interactive single-circuit web demo. In the demo, a user configures and previews a circuit, submits a run, and inspects verification, metrics, predictions, comparisons, and exports. The research path additionally evaluates retrained attackers on a frozen test split. Some subsystem links are based on the README or SOURCE INDEX rather than complete implementation excerpts.
Main entry points: pipeline.py Research orchestrator · demo.py Demo workflow · App.tsx Demo workspace · main.py API application
Components 25
Interactive demo
- Demo workspace
frontend/src/App.tsx - Circuit controls
frontend/src/components/CircuitControls.tsx - Run state
frontend/src/hooks/useRun.ts - API client
frontend/src/lib/api.ts - Circuit views
frontend/src/components/CircuitViewer.tsx - Audit result views
frontend/src/components/VerificationPanel.tsx - Accuracy panel
frontend/src/components/AccuracyPanel.tsx
Demo API
- API application
backend/app/main.py - Circuit routes
backend/app/routes/circuits.py - Run routes
backend/app/routes/runs.py - Export routes
backend/app/routes/exports.py - Background jobs
backend/app/services/jobs.py - Demo workflow
backend/app/services/demo.py - Saved benchmarks
backend/app/services/accuracy.py
Circuit audit engine
- Circuit families
src/qpf/circuits.py - Backend compilation
src/qpf/compilation.py - Circuit rewrites
src/qpf/defenses.py - Equivalence checks
src/qpf/verification.py - Physical features
src/qpf/features.py - Budgeted selection
src/qpf/selection.py
Research evaluation
- Research orchestrator
src/qpf/pipeline.py - Attacker models
src/qpf/attacks.py - Leakage metrics
src/qpf/metrics.py - Research reports
src/qpf/report.py
Other components
- User
Connections 31
- User → Demo workspace: configures audit
README.md - Demo workspace → Circuit controls: renders controls
frontend/src/App.tsx - Demo workspace → Run state: tracks runs
frontend/src/App.tsx - Run state → API client: submits and polls
frontend/src/hooks/useRun.ts - Demo workspace → Circuit views: renders circuits
frontend/src/App.tsx - Demo workspace → Audit result views: renders results
frontend/src/App.tsx - Demo workspace → Accuracy panel: renders benchmarks
frontend/src/App.tsx - API client → API application: calls API
README.md - API application → Circuit routes: registers routes
backend/app/main.py - API application → Run routes: registers routes
backend/app/main.py - API application → Export routes: registers routes
backend/app/main.py - API application → Saved benchmarks: loads benchmarks
backend/app/main.py - Circuit routes → Circuit families: generates preview
backend/app/routes/circuits.py - Run routes → Background jobs: submits jobs
backend/app/routes/runs.py - Background jobs → Demo workflow: runs workflow
backend/app/services/jobs.py - Demo workflow → Circuit families: generates input
backend/app/services/demo.py - Demo workflow → Backend compilation: compiles circuits
backend/app/services/demo.py - Demo workflow → Circuit rewrites: creates candidates
backend/app/services/demo.py - Demo workflow → Equivalence checks: checks equivalence
backend/app/services/demo.py - Demo workflow → Physical features: analyzes circuits
backend/app/services/demo.py - Demo workflow → Budgeted selection: scores candidates
backend/app/services/demo.py - Demo workflow → Saved benchmarks: loads benchmarks
backend/app/services/demo.py - Research orchestrator → Circuit families: generates circuits
src/qpf/pipeline.py - Research orchestrator → Circuit rewrites: applies strategies
src/qpf/pipeline.py - Research orchestrator → Equivalence checks: verifies rewrites
src/qpf/pipeline.py - Research orchestrator → Backend compilation: compiles candidates
src/qpf/pipeline.py - Research orchestrator → Physical features: extracts features
src/qpf/pipeline.py - Research orchestrator → Budgeted selection: selects candidates
src/qpf/pipeline.py - Research orchestrator → Attacker models: evaluates attackers
src/qpf/pipeline.py - Research orchestrator → Leakage metrics: computes leakage
src/qpf/pipeline.py - Research orchestrator → Research reports: produces reports
src/qpf/pipeline.py