-
-
Notifications
You must be signed in to change notification settings - Fork 168
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
Implements high-level functions for QSE #1902
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1902 +/- ##
==========================================
+ Coverage 98.52% 98.53% +0.01%
==========================================
Files 76 77 +1
Lines 3520 3545 +25
==========================================
+ Hits 3468 3493 +25
Misses 52 52
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @bubakazouba !
The code is very clean and clear. I like how simple the workflow looks like at the high-level (thanks to previously merged utility functions): get pop, get pp, return pop/pp. :-)
My main comment is on testing improvements with respect to unmitigated execution.
All the rest looks great to me!
e9569f9
to
d1713a3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with Andrea, really nice work making the main function so simple. A few minor comments.
return ( | ||
pauli_string_to_expectation_cache[cache_key] * pauli_string.coeff | ||
).real | ||
|
||
total_expectation_value_for_observable = 0.0 | ||
final_executor: Executor = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
initially i was overriding the variable, but pylint was getting confused by the type of executor
in line 66, so I had to change the name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thanks @bubakazouba for all the constant work on this new QSE technique, taking care of its full implementation in Mitiq. Thanks also to your colleges/collaborators for their contributions during the RFC phase.
POST EDITED: I just noticed that functions are not visible in the API-docs. But since this is true for the full QSE module, I created a new issue (#1923) dedicated to this aspect.
Thank you! I will start working on #1923 then #1924 with the group |
Description
Closes #1812
Adds execute_with_qse, qse_decorator and mitigate_executor to Quantum Subspace Expansion.
License
Before opening the PR, please ensure you have completed the following where appropriate.