A Wordle-style web game where you guess a 5-gate quantum circuit sequence to match a target quantum state.
Live site: qwordle.jaspersands.com
- Build a 5-gate quantum circuit in 6 attempts or fewer.
- After each guess, tiles show standard Wordle feedback:
- Green: Correct gate and correct slot.
- Yellow: Gate is in the sequence, but in a different slot.
- Gray: Gate is not in the remaining sequence.
- The board displays the resulting quantum state vector and computes state fidelity (
$F = |\langle \psi_{\text{guess}} | \psi_{\text{target}} \rangle|^2$ ) against the target state.
- Beginner: 1 qubit (
q0), single-qubit gates (X,Y,Z,H,S,T). - Intermediate: 2 qubits (
q0,q1), adds 2-qubit gates (CX,CZ,SWAP). Click tiles on the active row to cycle qubit mappings. - Advanced: 3 qubits (
q0,q1,q2), adds 3-qubit gates (CCX,CSWAP).
Modes can be played as a Daily Puzzle (same seed each day) or Unlimited Random.
index.html/styles.css– App shell and styles.src/main.js&src/game-engine.js– Game loop and state handling.src/quantum/simulator.js– In-browser state-vector quantum simulator (no runtime dependencies).src/puzzle-generator.js– Seeded PRNG for daily puzzles.scripts/qiskit_render_server.py– Optional Flask backend to render circuit diagrams with Qiskit.tests/– Unit test suite using Node's native test runner.
Serve the directory with any local HTTP server:
python3 -m http.server 8000Run unit tests:
npm testOptionally run the Qiskit diagram renderer:
pip install qiskit matplotlib flask flask-cors
npm run qiskit-rendererMIT