Skip to content

luismtorresv/grover-pyscript

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grover-pyscript

Grover's algorithm

Grover's algorithm is a popular introductory algorithm in quantum computing that "finds" one or more elements in a list.1

It uses amplitude amplification to increase the probability of measuring the state that's to be searched for. In all, it's "pointless": you need to know which states you're looking for before you look for them.

That said, it's a classical introductory algorithm. I had to implement for my quantum computing class in the second semester of 2024. I wrote two versions that implement a statevector simulation:

  1. A "classical" version using numpy. Quite fast. Does not add noise. Essentially large matrices underneath.

  2. A qiskit version, IBM's quantum computing library, that it's more or less the same thing when you think about it, but you could add noise if you wanted to.

What this program does

Out of sheer curiosity, I wanted to run my first implementation (the lightweight one, as it only uses numpy) on a web browser, entirely client-side. Python web apps depend on the server's processing, but that seems a bit unnecessary here: the client's computer can do all the calculations! No need for another computer to do it.

I found PyScript and decided to give it a go. My plan was to deploy this web app on Google Cloud Platform instance I had thanks to some Education credits I've received from another class, but those expired. Thankfully, this project can be served as a static website, so GitHub Pages will do.

Build

None!

You just need to host the docs directory somewhere. It's a static website.

Developers

Luis Torres

Screenshots

The entire website

Fullpage screenshot

Output after running Grover's algorithm

Output preview

License

Copyright (c) 2024 (luismtorresv)

Footnotes

  1. More information at: https://learning.quantum.ibm.com/course/fundamentals-of-quantum-algorithms/grovers-algorithm

About

Entirely client-side web version of my ⟨Python + numpy⟩ implementation of Grover's algorithm using pyscript. You just need a browser!

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages