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.4.3.tar.gz (351.0 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.4.3-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: grovers_visualizer-0.4.3.tar.gz
  • Upload date:
  • Size: 351.0 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.4.3.tar.gz
Algorithm Hash digest
SHA256 3f548ea4db14eff1d65857294229ad72cef098f38f1416a28e1cf071b069ff19
MD5 04293f8c7e916775866e99f1d6957264
BLAKE2b-256 182c44060ba867c8d5f502d1dc4231bc15a444b40502ceadc415f25c8a990ca2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for grovers_visualizer-0.4.3-py3-none-any.whl
Algorithm Hash digest
SHA256 766a15f15010b9f6f3d6a1ea2524abc77b18b04390806b333f7174fdf1e5d586
MD5 3cbb25154ac944d657e97371be085b81
BLAKE2b-256 c17be7e45091bc3d891ff7ce2a19c9e08937850246e0d9f8c3ff8757060640fa

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