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.1.tar.gz (4.2 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.1-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: grovers_visualizer-0.4.1.tar.gz
  • Upload date:
  • Size: 4.2 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.1.tar.gz
Algorithm Hash digest
SHA256 2a6807af98855a597294883cd027509739b672e6d01ba3798791e2c585cdb3be
MD5 f9318e434baf593f72f94580d7c15bb2
BLAKE2b-256 b2dd2e98db3368a57b9d8336500aa2ab140e6eef6408017616282f5f16818d72

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for grovers_visualizer-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0b2838da095abc3eb4c2be8534c10214f7b764d0d0926402cf29b77a0dbb7db4
MD5 05711831468ed9896d9a1854d820ce34
BLAKE2b-256 c3c036f2ecbcc8b8aa909a7ea9d1d409599303b135be90464938ddaefebe3070

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