Add 3x3 Sudoku — Grover's Algorithm notebook to games/#187
Open
y2sud wants to merge 1 commit intoqiskit-community:masterfrom
Open
Add 3x3 Sudoku — Grover's Algorithm notebook to games/#187y2sud wants to merge 1 commit intoqiskit-community:masterfrom
y2sud wants to merge 1 commit intoqiskit-community:masterfrom
Conversation
Adds a 22-qubit Qiskit/Aer notebook that solves a 3x3 Latin-square Sudoku using Grover's algorithm. Demonstrates oracle construction via neq_pair/neq_const gadgets, phase kickback, and amplitude amplification. Also updates games/README.md with an entry for the new notebook.
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds a new Jupyter notebook to the
games/folder demonstrating Grover's algorithm applied to a 3×3 Latin-square Sudoku puzzle.games/3x3_sudoku_grover.ipynbWhat the notebook covers
00→0,01→1,10→2), totalling 22 qubits (12 variable + 9 clause ancillae + 1 output)neq_pairandneq_constgadgets (compute → kick → uncompute pattern)(1/√3)(|00⟩+|01⟩+|10⟩)to exclude the invalid|11⟩codewordk ≈ (π/4)·√(N/M), N=729, M=2) and measures the circuit on Qiskit AerChanges
games/3x3_sudoku_grover.ipynb— new notebookgames/README.md— added entry for the new notebook under ContentsDependencies
qiskit >= 1.0,qiskit-aer >= 0.14,matplotlib >= 3.7— all standard Qiskit ecosystem packages.Testing
Runs end-to-end on a standard laptop in under one minute using the Aer statevector simulator. Both valid solutions (
[1,2,0,2,0,1]and[2,0,1,1,2,0]) are consistently the top-ranked measurements.