Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grover search for database with decimal value and computation time #174

Open
sakib005 opened this issue Aug 3, 2018 · 1 comment
Open

Comments

@sakib005
Copy link

sakib005 commented Aug 3, 2018

Hello, I saw the example of the binary search using Grover, however, I am interested in search decimal values from a database. Let's say. I want to search for '20' feet from a database which has data from 0-100 feet values. Could you please enlighten me about how to do that? Could you please let me know if converting the decimal to binary would be appropriate?

Another question is the time of Grover search computation, could you let me know how can I find the time for the search?

Thanks in advance and have a great day!

@vtomole
Copy link
Contributor

vtomole commented Aug 3, 2018

@sakib005

Could you please let me know if converting the decimal to binary would be appropriate?

Try it out. Based on https://github.com/rigetticomputing/grove/blob/master/examples/GroversAlgorithm.ipynb

You can probably do

target_bitstring = '0010100' #20 to binary, 7 bits because it take 7 bits to store numbers up to 100

How can I find the time for the search?

Grover's algorithm is usually analyzed by query complexity. But if you want the time complexity, I guess you can time your quantum program and compare it to a classical implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants