Go to file
2025-05-08 11:22:36 +03:00
.github/workflows ci(publish): add auto publish to pypi 2025-05-08 09:47:06 +03:00
media docs: add gif 2025-05-08 11:22:36 +03:00
src/grovers_visualizer build: fix installation 2025-05-08 11:12:31 +03:00
.gitignore chore: remove .python-version file 2025-04-22 16:13:22 +03:00
LICENSE Create LICENSE 2025-04-20 16:26:07 +03:00
pyproject.toml build: fix installation 2025-05-08 11:12:31 +03:00
README.md docs: add readme 2025-05-08 11:12:33 +03:00
uv.lock chore(ui): setup dependencies 2025-05-08 09:47:06 +03:00

Grovers Search Visualizer

A tiny Python package that steps through Grovers Search algorithm and shows you, after each iteration:

  • A barchart of amplitudes (or probabilities)
  • A sinecurve of successprobability vs. iteration
  • A geometric "rotation" on the unit circle

Choose between a Matplotlib-based CLI or an optional DearPyGui GUI (WIP).


Demo of Grover’s Visualizer


Installation

Via pipx

Basic (CLI only):

pipx install grovers-visualizer
grovers-visualizer 1111

With the optional DearPyGui UI (WIP):

pipx "grovers-visualizer[ui]"
grovers-visualizer --ui

Via uvx

Basic (CLI only):

uvx grovers-visualizer 1111

With the optional UI extra:

uvx "grovers-visualizer[ui]" --ui

Usage

CLI Mode

Flags:

-t, --target
Target bitstring (e.g. 010). Length determines number of qubits.
-s, --speed
Delay between iterations (seconds). Default 0.5.
-i, --iterations
Max iterations; 0 means use the optimal \lfloor\frac\pi4\sqrt{2^n}\rfloor.
--ui
Launch the optional DearPyGui GUI (requires the [ui] extra) (WIP).

GUI Mode (WIP)

If you installed with "[ui]", launch the DearPyGui window:

grovers-visualizer --ui

In the UI you can:

  • Set number of qubits
  • Enter the target bitstring
  • Choose max iterations or leave at 0 for optimal
  • Control the animation speed

Hit Start to watch the bar chart, sine plot, and rotationcircle update in real time.


License

This project is licensed under the MIT License - see the LICENSE file for details.