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.2.tar.gz (350.6 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.2-py3-none-any.whl (11.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: grovers_visualizer-0.4.2.tar.gz
  • Upload date:
  • Size: 350.6 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.2.tar.gz
Algorithm Hash digest
SHA256 3d00ec46406b09e17bf7574eb3b4d9c52de89aba190b45ce38969ec40f2d4e20
MD5 ac0716bcc11e94d82b5e537397e46111
BLAKE2b-256 40101e4163a72d4ef30758f2c01cc173a3befa23a03451c5377f770db7fc621f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for grovers_visualizer-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1fbb2eaf88bc3f98fad670eafeea96f295e2f5a367880f3e767c13ce113513d2
MD5 e628de7121654ca214aef9215fcd7894
BLAKE2b-256 e536e21b2d506d38b8d7a9ebaf1022a6bd97ab3fae4de7250b1dfa1aec8510a0

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