Skip to main content

A tiny Python package that steps through Grover’s Search algorithm.

Project description

Grover’s Search Visualizer

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

  • A bar‐chart of amplitudes (or probabilities)
  • A sine‐curve of success‐probability 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 bit‐string (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 bit‐string
  • Choose max iterations or leave at 0 for optimal
  • Control the animation speed

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


License

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

grovers_visualizer-0.5.0.tar.gz (351.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

grovers_visualizer-0.5.0-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file grovers_visualizer-0.5.0.tar.gz.

File metadata

  • Download URL: grovers_visualizer-0.5.0.tar.gz
  • Upload date:
  • Size: 351.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.22

File hashes

Hashes for grovers_visualizer-0.5.0.tar.gz
Algorithm Hash digest
SHA256 aceb44b6a36de6e1dc1864c207f702f71721fa62403ae0ad1e5a2ee50c0284d5
MD5 ed1863a4e254290812f6ca6238364984
BLAKE2b-256 f0fa2fb2bc42e2efae77a2ffb1ba8741e1130dc66f86f1d9c4f5a857ec921a49

See more details on using hashes here.

File details

Details for the file grovers_visualizer-0.5.0-py3-none-any.whl.

File metadata

File hashes

Hashes for grovers_visualizer-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 47d0e8500e741168d8f3a4378db0d1379bc2d28b894324aa69c3786f7b59e588
MD5 ed1ae07d9e436834d15088bbfd6c3a8b
BLAKE2b-256 56ba9ab34aa9a94d754b7eff6bcdf0541a5e0362232bd6fb106e064946a5a3a5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page