-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Accelerated implementation of objective function class for approximate quantum compiling #7697
Conversation
Thanks for the contribution. Is this a drop-in replacement or there are some trade-offs? If it's simply faster then I don't think we need to keep the old objective function. Also do you have some numbers about how much faster it is on an example input? |
Hi Ali, thank you for your reponse. The default implementation might be interesting because it is easy to understand, if someone would like to see some technical details how the method does work. The accelerated code is harder to comprehend as it uses a lot of caching and transformations. Also, it uses more memory. Otherwise, you are right. |
Ok sounds good. Yes I think we can keep the old one around then for now. I had a look through the PR and it all looks pretty good. Once you put some benchmarking numbers here then I think we can merge. |
This is the benchmarking result: accelerated implementation vs default (straightforward) one. The actual speedup may depend on Numpy version, number of CPU cores and hardware generation, whether the code is executed with multi-threading enabled or not, and so on. However, the performance of accelerated version is always consistently higher. On the chart you can see the speedup (averaged over various circuit depths) as a function of the number of qubits. We also show the dispersion of speedup measurements (plus/minus standard deviation around the mean). |
Pull Request Test Coverage Report for Build 3341797110
💛 - Coveralls |
Dear reviewers, could have a look at this pull request? |
Summary
Accelerated implementation of objective function class for approximate quantum compiling
Details and comments
The objective function itself remains the same as in the current version (Frobenius norm of the difference between the target matrix and approximating circuit). However, the new implementation is significantly faster. It can be optionally selected along with the current version.