Inspiration
Secure quantum workflows rarely show the whole story end-to-end. We wanted a compact demo that connects three pillars:
- Detect eavesdropping with quantum key distribution (BB84),
- Compute something meaningful with near-term quantum tech (VQE for H₂),
- Deliver results securely (AES-CTR), with artifacts a judge can verify in minutes.
The goal: a pipeline that is scientifically honest, fast to run, and easy to audit.
What it does
Quantum Duo gates a quantum chemistry computation with a QKD health check:
- Phase 1 — BB84: simulate intercept-resend and bit-flip noise, compute the quantum bit error rate (QBER). Proceed only if the channel looks secure.
$$ \mathrm{QBER} \;=\; \frac{1}{|\mathcal{S}|}\sum_{i\in \mathcal{S}} \mathbf{1}{a_i\neq b_i} $$
where $\mathcal{S}$ are sifted positions with matching bases.
- Phase 2 — VQE(H₂): compute the H₂ potential curve on a 2-qubit Hamiltonian using an EfficientSU2 ansatz and L-BFGS-B optimizer. Validate against the exact ground state by diagonalizing the same Hamiltonian.
$$ E(\theta) \;=\; \langle \psi(\theta) \vert H \vert \psi(\theta)\rangle,\quad E_\star=\min \mathrm{eig}(H) $$
- Phase 3 — Secure delivery: derive a 256-bit key from BB84 bits via SHA-256, encrypt outputs with AES-CTR (nonce prepended), and auto-generate a one-page HTML report with plots, CSV/JSON, and links to ciphertext.
Artifacts include: QBER plot, H₂ energy curve (VQE vs Exact), absolute error plot, optional QBER heatmap, BB84 walkthrough CSV, encrypted payload, and a single-file HTML report.
How we built it
BB84: Qiskit Aer statevector; random Z/X bases, intercept-resend attacker with probability $p_{\text{eve}}$, optional channel bit-flip $p_{\text{noise}}$. Sifting keeps only matching bases; we compute QBER and derive key bits.
VQE: EfficientSU2 (2 qubits, entanglement=full, reps=2), objective $\langle \psi(\theta)\vert H \vert\psi(\theta)\rangle$ evaluated from the statevector, optimized by SciPy L-BFGS-B. We provide an exact baseline via $\min\mathrm{eig}(H)$. To keep the demo portable, we use a compact pre-tabulated 2-qubit H₂ Hamiltonian (relative a.u.) that preserves curve shape and minimum.
Crypto: SHA-256 KDF over BB84 key material → 32-byte key. AES-CTR with a 16-byte random nonce prepended to the ciphertext. Fallback to XOR if AES is unavailable. The app validates decryption before writing the report.
UX & Packaging: One CLI (
python main.py), deterministic seeds, plots via Matplotlib, CSV/JSON dumps, and a self-contained HTML report so judges can review everything quickly.
Challenges we ran into
- Ecosystem drift: API changes in
qiskit/qiskit-nature(e.g.,Estimator,UnitsType, parameter binding) required re-tooling. We stabilized on a statevector + SciPy stack to avoid version roulette. - Portability vs fidelity: Full PySCF integration adds weight and build issues. We chose a 2-qubit pre-tabulated H₂ model (relative a.u.) for speed and reproducibility, while retaining a rigorous exact baseline check.
- Numerical stability: Ensuring VQE converges cleanly on all machines; seeds and optimizer caps keep runs deterministic and fast.
- Storytelling: Turning three topics (QKD, VQE, crypto) into a single, audit-friendly narrative with minimal friction.
Accomplishments that we’re proud of
- End-to-end quantum workflow in one command, with a real security gate before compute.
- Validated VQE: error vs exact typically $\sim 10^{-10}$, clearly shown on a separate plot.
- Standards-based crypto: SHA-256 KDF + AES-CTR, with Base64 export and nonce handling.
- Judge-friendly artifacts: QBER plot, energy curve, error curve, heatmap, walkthrough CSV, CSV/JSON, and a single HTML report.
- Reproducibility: deterministic seeds and clear CLI flags.
What we learned
- How to bridge QKD and NISQ computing into a credible, inspectable pipeline.
- The importance of a baseline: showing VQE vs exact removes ambiguity and builds trust.
- Practical trade-offs between portability and chemical fidelity for hackathon demos.
- How small UX choices (single report, CSV/JSON, decent defaults) dramatically improve evaluation.
What’s next for Quantum Duo
- Authenticated encryption: upgrade to AES-GCM or AES-CTR + HMAC-SHA-256.
- Hardware backends: try small-qubit providers and add error-mitigation snapshots.
- Richer chemistry: swap in PySCF/fermionic mappings for LiH/HeH⁺ with a “fast/accurate” flag.
- UI: lightweight Streamlit app for sliders and realtime plots.
- Key management: optional digital signatures for artifact integrity and provenance.
Log in or sign up for Devpost to join the conversation.