{"id":22703918,"url":"https://github.com/lynkos/grovers-algorithm","last_synced_at":"2025-09-01T01:16:51.880Z","repository":{"id":153682197,"uuid":"630267810","full_name":"lynkos/grovers-algorithm","owner":"lynkos","description":"Python (.py) and Jupyter notebook (.ipynb) implementations of Grover's Algorithm aka Quantum Search Algorithm for n qubits and m targets.","archived":false,"fork":false,"pushed_at":"2025-07-27T20:50:46.000Z","size":17455,"stargazers_count":14,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-30T10:33:53.808Z","etag":null,"topics":["algorithm","anaconda","anaconda3","conda","grover","grover-algorithm","grovers-algorithm","jupyter","jupyter-notebook","latex","python","python3","qiskit","quantum","quantum-algorithms","quantum-computing","quantum-search","quantum-search-algorithm"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lynkos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-04-20T02:49:04.000Z","updated_at":"2025-08-02T12:37:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"61f72085-9e08-49fc-bef2-437fe81c1abb","html_url":"https://github.com/lynkos/grovers-algorithm","commit_stats":{"total_commits":197,"total_committers":1,"mean_commits":197.0,"dds":0.0,"last_synced_commit":"ae682c77061cff4293ad7105fe3c37292bf35ed0"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lynkos/grovers-algorithm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lynkos%2Fgrovers-algorithm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lynkos%2Fgrovers-algorithm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lynkos%2Fgrovers-algorithm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lynkos%2Fgrovers-algorithm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lynkos","download_url":"https://codeload.github.com/lynkos/grovers-algorithm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lynkos%2Fgrovers-algorithm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273061089,"owners_count":25038596,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm","anaconda","anaconda3","conda","grover","grover-algorithm","grovers-algorithm","jupyter","jupyter-notebook","latex","python","python3","qiskit","quantum","quantum-algorithms","quantum-computing","quantum-search","quantum-search-algorithm"],"created_at":"2024-12-10T08:13:11.705Z","updated_at":"2025-09-01T01:16:51.875Z","avatar_url":"https://github.com/lynkos.png","language":"Jupyter Notebook","readme":"\u003cdiv align=\"center\"\u003e\n\u003ch1\u003eGrover's Algorithm\u003c/h1\u003e\n\u003cimg alt=\"Python\" src=\"https://img.shields.io/static/v1?label=Language\u0026style=flat\u0026message=Python+3.12.2\u0026logo=python\u0026color=c7a228\u0026labelColor=393939\u0026logoColor=4f97d1\"\u003e\n\u003cimg alt=\"Jupyter\" src=\"https://img.shields.io/static/v1?label=Packages\u0026style=flat\u0026message=Jupyter\u0026logo=jupyter\u0026color=f37626\u0026labelColor=393939\u0026logoColor=f37626\"\u003e\n\u003cimg alt=\"Qiskit\" src=\"https://img.shields.io/static/v1?label=Packages\u0026style=flat\u0026message=Qiskit\u0026logo=qiskit\u0026color=6929c4\u0026labelColor=393939\u0026logoColor=af7afa\"\u003e\n\u003cimg alt=\"Shell\" src=\"https://img.shields.io/static/v1?label=Shell\u0026style=flat\u0026message=Bash\u0026logo=gnu+bash\u0026color=4EAA25\u0026labelColor=393939\u0026logoColor=4EAA25\"\u003e\n\u003cimg alt=\"Code+Editor\" src=\"https://img.shields.io/static/v1?label=Code+Editor\u0026style=flat\u0026message=Visual+Studio+Code\u0026logo=visual+studio+code\u0026color=007acc\u0026labelColor=393939\u0026logoColor=007acc\"\u003e\n\u003cbr\u003e\n\u003cimg alt=\"License\" src=\"https://img.shields.io/github/license/lynkos/grovers-algorithm?style=flat\u0026label=License\u0026labelColor=393939\u0026color=788200\u0026link=https%3A%2F%2Fgithub.com%2Flynkos%2Fgrovers-algorithm%2Fblob%2Fmaster%2FLICENSE.md\"\u003e\n\u003cimg alt=\"Last Commit\" src=\"https://img.shields.io/github/last-commit/lynkos/grovers-algorithm?style=flat\u0026label=Last+Commit\u0026labelColor=393939\u0026color=be0000\"\u003e\n\u003cimg alt=\"Commit Activity\" src=\"https://img.shields.io/github/commit-activity/y/lynkos/grovers-algorithm?style=flat\u0026label=Commit+Activity\u0026labelColor=393939\u0026color=b30086\"\u003e\n\u003cimg alt=\"Repo Size\" src=\"https://img.shields.io/github/repo-size/lynkos/grovers-algorithm?style=flat\u0026label=Repo+Size\u0026labelColor=393939\u0026color=ff62b1\"\u003e\n\u003ca target=\"_blank\" href=\"https://deepwiki.com/lynkos/grovers-algorithm\" title=\"DeepWiki for lynkos/grovers-algorithm repository\"\u003e\u003cimg src=\"https://deepwiki.com/badge.svg\" alt=\"Ask DeepWiki\"\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n\u003e [!IMPORTANT]\n\u003e This repository has accompanying blog posts on [my blog](https://blog.lynkos.dev)!\n\u003e \n\u003e * [**Quantum Search Algorithm**](https://blog.lynkos.dev/posts/grover): Short, Twitter/X-inspired thread format\n\u003e * [**Quantum Search Algorithm (Full)**](https://blog.lynkos.dev/posts/grover-full): Full explanation with additional details\n\u003e \n\u003e These blog posts are much more readable and user-friendly than this repository by itself and GitHub. If you're interested in sharing or reading this repository as a blog post, please feel free to refer to the aforementioned links!\n\n## Requirements\n- [x] [Anaconda](https://docs.continuum.io/free/anaconda/install) **OR** [Miniconda](https://docs.conda.io/projects/miniconda/en/latest)\n\n\u003e [!TIP]\n\u003e If you have trouble deciding between Anaconda and Miniconda, please refer to the table below\n\u003e \u003ctable\u003e\n\u003e  \u003cthead\u003e\n\u003e   \u003ctr\u003e\n\u003e    \u003cth\u003e\u003ccenter\u003eAnaconda\u003c/center\u003e\u003c/th\u003e\n\u003e    \u003cth\u003e\u003ccenter\u003eMiniconda\u003c/center\u003e\u003c/th\u003e\n\u003e   \u003c/tr\u003e\n\u003e  \u003c/thead\u003e\n\u003e  \u003ctbody\u003e\n\u003e   \u003ctr\u003e\n\u003e    \u003ctd\u003eNew to conda and/or Python\u003c/td\u003e\n\u003e    \u003ctd\u003eFamiliar with conda and/or Python\u003c/td\u003e\n\u003e   \u003c/tr\u003e\n\u003e   \u003ctr\u003e\n\u003e    \u003ctd\u003eNot familiar with using terminal and prefer GUI\u003c/td\u003e\n\u003e    \u003ctd\u003eComfortable using terminal\u003c/td\u003e\n\u003e   \u003c/tr\u003e\n\u003e   \u003ctr\u003e\n\u003e    \u003ctd\u003eLike the convenience of having Python and 1,500+ scientific packages automatically installed at once\u003c/td\u003e\n\u003e    \u003ctd\u003eWant fast access to Python and the conda commands and plan to sort out the other programs later\u003c/td\u003e\n\u003e   \u003c/tr\u003e\n\u003e   \u003ctr\u003e\n\u003e    \u003ctd\u003eHave the time and space (a few minutes and 3 GB)\u003c/td\u003e\n\u003e    \u003ctd\u003eDon't have the time or space to install 1,500+ packages\u003c/td\u003e\n\u003e   \u003c/tr\u003e\n\u003e   \u003ctr\u003e\n\u003e    \u003ctd\u003eDon't want to individually install each package\u003c/td\u003e\n\u003e    \u003ctd\u003eDon't mind individually installing each package\u003c/td\u003e\n\u003e   \u003c/tr\u003e\n\u003e  \u003c/tbody\u003e\n\u003e \u003c/table\u003e\n\u003e\n\u003e Typing out entire Conda commands can sometimes be tedious, so I wrote a shell script ([`conda_shortcuts.sh` on GitHub Gist](https://gist.github.com/lynkos/7a4ce7f9e38bb56174360648461a3dc8)) to define shortcuts for commonly used Conda commands.\n\u003e \u003cdetails\u003e\n\u003e   \u003csummary\u003eExample: Delete/remove a conda environment named \u003ccode\u003etest_env\u003c/code\u003e\u003c/summary\u003e\n\u003e\n\u003e * Shortcut command\n\u003e     ```\n\u003e     rmenv test_env\n\u003e     ```\n\u003e * Manually typing out the entire command\n\u003e     ```sh\n\u003e     conda env remove -n test_env \u0026\u0026 rm -rf $(conda info --base)/envs/test_env\n\u003e     ```\n\u003e\n\u003e The shortcut has 80.8% less characters!\n\u003e \u003c/details\u003e\n\n## Installation\n1. Verify that conda is installed\n   ```\n   conda --version\n   ```\n2. Ensure conda is up to date\n   ```\n   conda update conda\n   ```\n3. Enter the directory where you want the repository ([`grovers-algorithm`](https://github.com/lynkos/grovers-algorithm)) to be cloned\n     * POSIX\n       ```sh\n       cd ~/path/to/directory\n       ```\n     * Windows\n       ```sh\n       cd C:\\Users\\user\\path\\to\\directory\n       ```\n4. Clone the repository ([`grovers-algorithm`](https://github.com/lynkos/grovers-algorithm)), then enter (i.e. `cd` command) `grovers-algorithm` directory\n   ```sh\n   git clone https://github.com/lynkos/grovers-algorithm.git \u0026\u0026 cd grovers-algorithm\n   ```\n5. Create a conda virtual environment from [`environment.yml`](environment.yml)\n   ```\n   conda env create -f environment.yml\n   ```\n6. Activate the virtual environment (`grovenv`)\n   ```\n   conda activate grovenv\n   ```\n7. Confirm that the virtual environment (`grovenv`) is active\n     * If active, the virtual environment's name should be in parentheses () or brackets [] before your command prompt, e.g.\n       ```\n       (grovenv) $\n       ```\n     * If necessary, see which environments are available and/or currently active (active environment denoted with asterisk (*))\n       ```\n       conda info --envs\n       ```\n       **OR**\n       ```\n       conda env list\n       ```\n\n## Usage\n\u003e [!TIP]\n\u003e If you're unsure about which subsection(s) to follow, please refer to the table below\n\u003e \u003ctable\u003e\n\u003e  \u003cthead\u003e\n\u003e   \u003ctr\u003e\n\u003e    \u003cth\u003e\u003ccenter\u003eVisual Studio Code\u003c/center\u003e\u003c/th\u003e\n\u003e    \u003cth\u003e\u003ccenter\u003eCommand Line\u003c/center\u003e\u003c/th\u003e\n\u003e   \u003c/tr\u003e\n\u003e  \u003c/thead\u003e\n\u003e  \u003ctbody\u003e\n\u003e   \u003ctr\u003e\n\u003e    \u003ctd\u003eBeginner/User-friendly\u003c/td\u003e\n\u003e    \u003ctd\u003eRecommended if familiar with using terminals/shells/CLIs\u003c/td\u003e\n\u003e   \u003c/tr\u003e\n\u003e   \u003ctr\u003e\n\u003e    \u003ctd\u003eGUI\u003c/td\u003e\n\u003e    \u003ctd\u003eCLI\u003c/td\u003e\n\u003e   \u003c/tr\u003e\n\u003e   \u003ctr\u003e\n\u003e    \u003ctd\u003eClick a button to run program\u003c/td\u003e\n\u003e    \u003ctd\u003eExecute a command in terminal/shell/CLI to run program\u003c/td\u003e\n\u003e   \u003c/tr\u003e\n\u003e  \u003c/tbody\u003e\n\u003e \u003c/table\u003e\n\n### Python Script\n\u003e [!NOTE]\n\u003e Although they both perform the same function, there's a discernable difference between [`grovers_algorithm.py`](src/grovers_algorithm.py) and [`grovers_algorithm.ipynb`](src/grovers_algorithm.ipynb). The former is a Python script, the latter is a Jupyter notebook.\n\n#### Command Line (Recommended)\nRun [`grovers_algorithm.py`](src/grovers_algorithm.py)\n```sh\npython src/grovers_algorithm.py\n```\n\n\u003cdetails open\u003e\n   \u003csummary\u003eCommand Line Arguments\u003c/summary\u003e\n   \u003ctable align=\"center\" style=\"width: 100%; text-align: center; display: block; max-width: -moz-fit-content; max-width: fit-content; overflow-x: auto;\"\u003e\n       \u003cthead\u003e\n       \u003ctr\u003e\n           \u003cth align=\"center\"\u003eOption\u003c/th\u003e\n           \u003cth align=\"center\"\u003eType\u003c/th\u003e\n           \u003cth align=\"center\"\u003eDescription\u003c/th\u003e\n           \u003cth align=\"center\"\u003eDefault\u003c/th\u003e\n       \u003c/tr\u003e\n       \u003c/thead\u003e\n       \u003ctbody\u003e\n       \u003ctr\u003e\n           \u003ctd align=\"center\" style=\"white-space: nowrap;\"\u003e\u003ccode\u003e-H, --help\u003c/code\u003e\u003c/td\u003e\n           \u003ctd align=\"center\"\u003e\u003c/td\u003e\n           \u003ctd align=\"center\"\u003eShow help message and exit\u003c/td\u003e\n           \u003ctd align=\"center\"\u003e\u003c/td\u003e\n       \u003c/tr\u003e\n       \u003ctr\u003e\n           \u003ctd align=\"center\" style=\"white-space: nowrap;\"\u003e\u003ccode\u003e-T, --title \u0026lt;title\u0026gt;\u003c/code\u003e\u003c/td\u003e\n           \u003ctd align=\"center\"\u003e\u003ccode\u003estr\u003c/code\u003e\u003c/td\u003e\n           \u003ctd align=\"center\"\u003eWindow title\u003c/td\u003e\n           \u003ctd align=\"center\"\u003e\"Grover's Algorithm\"\u003c/td\u003e\n       \u003c/tr\u003e\n       \u003ctr\u003e\n           \u003ctd id=\"modpath\" align=\"center\" style=\"white-space: nowrap;\"\u003e\u003ccode\u003e-n, --n-qubits \u0026lt;n_qubits\u0026gt;\u003c/code\u003e\u003c/td\u003e\n           \u003ctd align=\"center\"\u003e\u003ccode\u003eint\u003c/code\u003e\u003c/td\u003e\n           \u003ctd align=\"center\"\u003eNumber of qubits\u003c/td\u003e\n           \u003ctd align=\"center\"\u003e\u003ccode\u003e5\u003c/code\u003e\u003c/td\u003e\n       \u003c/tr\u003e\n       \u003ctr\u003e\n           \u003ctd align=\"center\" style=\"white-space: nowrap;\"\u003e\u003ccode\u003e-s, --search \u0026lt;search\u0026gt;\u003c/code\u003e\u003c/td\u003e\n           \u003ctd align=\"center\"\u003e\u003ccode\u003eint\u003c/code\u003e\u003c/td\u003e\n           \u003ctd align=\"center\"\u003eNonnegative integers to search for\u003c/td\u003e\n           \u003ctd align=\"center\"\u003e\u003ccode\u003e11 9 0 3\u003c/code\u003e\u003cbr\u003e(i.e., { 11, 9, 0, 3 })\u003c/td\u003e\n       \u003c/tr\u003e\n       \u003ctr\u003e\n           \u003ctd align=\"center\" style=\"white-space: nowrap;\"\u003e\u003ccode\u003e-S, --shots \u0026lt;shots\u0026gt;\u003c/code\u003e\u003c/td\u003e\n           \u003ctd align=\"center\"\u003e\u003ccode\u003eint\u003c/code\u003e\u003c/td\u003e\n           \u003ctd align=\"center\"\u003eNumber of simulations\u003c/td\u003e\n           \u003ctd align=\"center\"\u003e\u003ccode\u003e1000\u003c/code\u003e\u003c/td\u003e\n       \u003c/tr\u003e\n       \u003ctr\u003e\n           \u003ctd align=\"center\" style=\"white-space: nowrap;\"\u003e\u003ccode\u003e-f, --font-size \u0026lt;font_size\u0026gt;\u003c/code\u003e\u003c/td\u003e\n           \u003ctd align=\"center\"\u003e\u003ccode\u003eint\u003c/code\u003e\u003c/td\u003e\n           \u003ctd align=\"center\"\u003eHistogram's font size\u003c/td\u003e\n           \u003ctd align=\"center\"\u003e\u003ccode\u003e10\u003c/code\u003e\u003c/td\u003e\n       \u003c/tr\u003e\n       \u003ctr\u003e\n           \u003ctd align=\"center\" style=\"white-space: nowrap;\"\u003e\u003ccode\u003e-p, --print\u003c/code\u003e\u003c/td\u003e\n           \u003ctd align=\"center\"\u003e\u003ccode\u003ebool\u003c/code\u003e\u003c/td\u003e\n           \u003ctd align=\"center\"\u003eWhether or not to print quantum circuit(s)\u003c/td\u003e\n           \u003ctd align=\"center\"\u003e\u003ccode\u003eFalse\u003c/code\u003e\u003c/td\u003e\n       \u003c/tr\u003e\n       \u003ctr\u003e\n           \u003ctd align=\"center\" style=\"white-space: nowrap;\"\u003e\u003ccode\u003e-c, --combine\u003c/code\u003e\u003c/td\u003e\n           \u003ctd align=\"center\"\u003e\u003ccode\u003ebool\u003c/code\u003e\u003c/td\u003e\n           \u003ctd align=\"center\"\u003eWhether to combine all non-winning states into 1 bar labeled \"Others\" or not\u003c/td\u003e\n           \u003ctd align=\"center\"\u003e\u003ccode\u003eFalse\u003c/code\u003e\u003c/td\u003e\n       \u003c/tr\u003e\n       \u003c/tbody\u003e\n   \u003c/table\u003e\n\u003c/details\u003e\n\n#### Visual Studio Code\n1. Open [`grovers_algorithm.py`](src/grovers_algorithm.py)\n2. Run [`grovers_algorithm.py`](src/grovers_algorithm.py): Click `▷` (i.e. `Play` button) in the upper-right corner\n\n### Jupyter Notebook\n#### Visual Studio Code (Recommended)\n1. Open the Command Palette with the relevant keyboard shortcut\n    * Mac: \u003ckbd\u003e⌘\u003c/kbd\u003e + \u003ckbd\u003eShift\u003c/kbd\u003e + \u003ckbd\u003eP\u003c/kbd\u003e\n    * Windows: \u003ckbd\u003eCTRL\u003c/kbd\u003e + \u003ckbd\u003eShift\u003c/kbd\u003e + \u003ckbd\u003eP\u003c/kbd\u003e\n2. Search and select `Python: Select Interpreter`\n3. Select the virtual environment (`grovenv`)\n4. Open [`grovers_algorithm.ipynb`](src/grovers_algorithm.ipynb)\n5. Confirm `grovenv` is the selected [kernel](https://docs.jupyter.org/en/latest/install/kernels.html)\n6. Run [`grovers_algorithm.ipynb`](src/grovers_algorithm.ipynb) by clicking `Run All`\n\n#### Command Line\n1. Install `ipykernel` in the virtual environment (`grovenv`)\n   ```\n   conda install -n grovenv ipykernel\n   ```\n2. Add the virtual environment (`grovenv`) as a Jupyter kernel\n   ```\n   python -m ipykernel install --user --name=grovenv\n   ```\n3. Open [`grovers_algorithm.ipynb`](src/grovers_algorithm.ipynb) in the currently running notebook server, starting one if necessary\n   ```\n   jupyter notebook src/grovers_algorithm.ipynb\n   ```\n4. Select the virtual environment (`grovenv`) as the kernel before running [`grovers_algorithm.ipynb`](src/grovers_algorithm.ipynb)\n\n## Cleanup\n1. [Optional] Deactivate the virtual environment (`grovenv`) to clean up and remove it\n   ```\n   conda deactivate\n   ```\n2. Close the terminal\n\n## Examples\nThese serve as example outputs/results of the running Grover's algorithm (i.e. files in [`src`](src))\n\n### Quantum Circuits\nGenerated by [`grovers_algorithm.ipynb`](src/grovers_algorithm.ipynb) (i.e. Jupyter notebook)\n\n#### Oracle\n\u003cdiv align=\"center\"\u003e\n   \u003cfigure\u003e\n      \u003cpicture\u003e\u003cimg alt=\"Oracle circuit\" src=\"assets/circuits/oracle.png\"\u003e\u003c/picture\u003e\u003cbr\u003e\n      \u003cfigcaption style=\"font-size: 11px;\"\u003e\u003c/figcaption\u003e\n   \u003c/figure\u003e\n\u003c/div\u003e\n\n#### Diffuser\n\u003cdiv align=\"center\"\u003e\n   \u003cfigure\u003e\n      \u003cpicture\u003e\u003cimg alt=\"Diffuser circuit\" src=\"assets/circuits/diffuser.png\"\u003e\u003c/picture\u003e\u003cbr\u003e\n      \u003cfigcaption style=\"font-size: 11px;\"\u003e\u003c/figcaption\u003e\n   \u003c/figure\u003e\n\u003c/div\u003e\n\n#### Grover\n\u003cdiv align=\"center\"\u003e\n   \u003cfigure\u003e\n      \u003cpicture\u003e\u003cimg alt=\"Grover circuit\" src=\"assets/circuits/grover.png\"\u003e\u003c/picture\u003e\u003cbr\u003e\n      \u003cfigcaption style=\"font-size: 11px;\"\u003e\u003c/figcaption\u003e\n   \u003c/figure\u003e\n\u003c/div\u003e\n\n### Figures\nGenerated by [`grovers_algorithm.ipynb`](src/grovers_algorithm.ipynb) (i.e. Jupyter notebook)\n\n#### Bloch Sphere\n\u003cdiv align=\"center\"\u003e\n   \u003cfigure\u003e\n      \u003cpicture\u003e\u003cimg alt=\"Bloch sphere\" src=\"assets/figures/bloch.png\"\u003e\u003c/picture\u003e\u003cbr\u003e\n      \u003cfigcaption style=\"font-size: 11px;\"\u003e\u003c/figcaption\u003e\n   \u003c/figure\u003e\n\u003c/div\u003e\n\n#### City Plot\n\u003cdiv align=\"center\"\u003e\n   \u003cfigure\u003e\n      \u003cpicture\u003e\u003cimg alt=\"City plot\" src=\"assets/figures/city.png\"\u003e\u003c/picture\u003e\u003cbr\u003e\n      \u003cfigcaption style=\"font-size: 11px;\"\u003e\u003c/figcaption\u003e\n   \u003c/figure\u003e\n\u003c/div\u003e\n\n#### Hinton Plot\n\u003cdiv align=\"center\"\u003e\n   \u003cfigure\u003e\n      \u003cpicture\u003e\u003cimg alt=\"Hinton plot\" src=\"assets/figures/hinton.png\"\u003e\u003c/picture\u003e\u003cbr\u003e\n      \u003cfigcaption style=\"font-size: 11px;\"\u003e\u003c/figcaption\u003e\n   \u003c/figure\u003e\n\u003c/div\u003e\n\n#### Q-Sphere\n\u003cdiv align=\"center\"\u003e\n   \u003cfigure\u003e\n      \u003cpicture\u003e\u003cimg alt=\"Q-Sphere\" src=\"assets/figures/q-sphere.png\"\u003e\u003c/picture\u003e\u003cbr\u003e\n      \u003cfigcaption style=\"font-size: 11px;\"\u003e\u003c/figcaption\u003e\n   \u003c/figure\u003e\n\u003c/div\u003e\n\n### Simulations\nHistograms visualize the outcome/results of 1000 simulations of Grover's algorithm\n\n#### [Python](src/grovers_algorithm.py)\nGenerated by [`grovers_algorithm.py`](src/grovers_algorithm.py) (i.e. Python script)\n\n\u003e [!TIP]\n\u003e Hovering above a bar in the histogram displays that state's frequency\n\n\u003cdiv align=\"center\"\u003e\n   \u003cfigure\u003e\n      \u003cpicture\u003e\u003cimg alt=\"Histogram of the outcome of 1000 simulations of Grover's algorithm\" src=\"assets/simulations/py.png\"\u003e\u003c/picture\u003e\u003cbr\u003e\n      \u003cfigcaption style=\"font-size: 11px;\"\u003eHistogram of the outcome of 1000 simulations of Grover's algorithm\u003c/figcaption\u003e\n   \u003c/figure\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\u003cdiv align=\"center\"\u003e\n   \u003cfigure\u003e\n      \u003cpicture\u003e\u003cimg alt=\"Histogram of the outcome of 1000 simulations of Grover's algorithm, with all non-target states combined into a single bar\" src=\"assets/simulations/py_combined.png\"\u003e\u003c/picture\u003e\u003cbr\u003e\n      \u003cfigcaption style=\"font-size: 11px;\"\u003eHistogram of the outcome of 1000 simulations of Grover's algorithm, with all non-target states combined into a single bar\u003c/figcaption\u003e\n   \u003c/figure\u003e\n\u003c/div\u003e\n\n#### [Jupyter Notebook](src/grovers_algorithm.ipynb)\nGenerated by [`grovers_algorithm.ipynb`](src/grovers_algorithm.ipynb) (i.e. Jupyter notebook)\n\n\u003cdiv align=\"center\"\u003e\n   \u003cfigure\u003e\n      \u003cpicture\u003e\u003cimg alt=\"Histogram of the outcome of 1000 simulations of Grover's algorithm in Jupyter notebook\" src=\"assets/simulations/ipynb.png\"\u003e\u003c/picture\u003e\u003cbr\u003e\n      \u003cfigcaption style=\"font-size: 11px;\"\u003eHistogram of the outcome of 1000 simulations of Grover's algorithm\u003c/figcaption\u003e\n   \u003c/figure\u003e\n\u003c/div\u003e\n\n## Resources\n* [Anaconda Documentation](https://docs.anaconda.com)\n* [Conda Documentation](https://docs.conda.io/en/latest)\n* [Getting Started with Conda](https://conda.io/projects/conda/en/latest/user-guide/getting-started.html)\n* [Jupyter Notebook Documentation](https://jupyter-notebook.readthedocs.io/en/latest)\n* [Jupyter Project Documentation](https://docs.jupyter.org/en/latest/index.html) [[PDF](https://buildmedia.readthedocs.org/media/pdf/jupyter/latest/jupyter.pdf)]\n* [Technical Support - Jupyter Google Group](https://discourse.jupyter.org)\n* [Qiskit Documentation](https://qiskit.org/documentation/index.html)\n* [Documentation for Visual Studio Code](https://code.visualstudio.com/docs)\n* [Using Jupyter Notebooks in Visual Studio Code](https://code.visualstudio.com/docs/datascience/jupyter-notebooks)\n\n## Credit\nSpecial thanks to [Simanraj Sadana](https://sqmscenter.fnal.gov/profile/simanraj-sadana) for \"[Grover's search algorithm for *n* qubits with optimal number of iterations](https://arxiv.org/abs/2011.04051)\", which has been a helpful reference and an informative read\n\n## License\nDistributed under the [MIT License](LICENSE.md), Copyright © 2023 – 2025 Kiran Brahmatewari\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flynkos%2Fgrovers-algorithm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flynkos%2Fgrovers-algorithm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flynkos%2Fgrovers-algorithm/lists"}