-
Notifications
You must be signed in to change notification settings - Fork 40
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
Implement Grover's Algorithm using Lightning-Qubit's C++ API #963
Comments
Hi Thomas, thanks for giving me the opportunity to work on this! I had some questions about setting everything up such that I can build files against the C++ API. I couldn't find instructions on how to do this anywhere in the repository or on the pennylane main site. I was able to build and run the C++ files using |
Hi Jake,
You'll also have to add your source folder with |
Hi @jzaia18, |
Hi Thomas, Thanks so much! Sorry on the late reply, I had a higher-than-average amount of workload due in the middle of the week. I'm planning on working on this tonight & tomorrow. I was able to get it to build my (basically blank) cpp file into an executable using the tip you gave me, but I haven't done much more past that. Thanks again! |
Hi Thomas, I think I've completed a (simplest possible/MVP) implementation of Grover's algorithm. I had a couple questions on how much you'd like it to be fleshed out:
Thanks! |
Hi @jzaia18,
We may still have some questions afterwards on one of these points 🙂 |
@tomlqc I've started benchmarking against the python library and the python library is significantly faster, which tells me that it's probably making use of a better set of kernels for my system than the LM ones. I picked LM arbitrarily at the beginning since I was originally dev'ing in a VM and I wasn't sure what support it had for AVX512, etc. Looking into it further, it seems like LM is not going to be most performant on my system since it seems to be optimized for memory efficiency (and I'm sitting on 48GB of RAM). I suspect AVX512 should perform much better. Should I alter my C++ implementation to be more competitive, or are the performance of these benchmarks not something I should worry about at this time? |
Hi @jzaia18 nice work so far! Yes, we generally expect significantly better performance when using AVX2/512+streaming kernels. We would be happy to review how you have benchmarked and compared these codes in your pull request, and we can continue the discussion there. While it's optional, you can also disable the AVX kernels by rebuilding Lightning-Qubit with the |
Even when compiling with PR is marked ready for review @tomlqc, thanks again for the opportunity, and have a good day. |
Important Note
Context
Lightning-Qubit is one of the C++ simulators for PennyLane. It uses Python bindings to be integrated in PennyLane's Python-API. Alternatively, algorithms can be implemented with the C++ API directly. The purpose of this issue is to build Grover's algorithm in C++ only and to benchmark it against an implementation with PennyLane.
Requirements
Don't hesitate to ask for clarification or raise any concerns regarding the issue. We'll be happy to discuss with you!
The text was updated successfully, but these errors were encountered: