-
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
Local fidelity #9504
Local fidelity #9504
Conversation
Thank you for opening a new pull request. Before your PR can be merged it will first need to pass continuous integration tests and be reviewed. Sometimes the review process can be slow, so please be patient. While you're waiting, please feel free to review other open PRs. While only a subset of people are authorized to approve pull requests for merging, everyone is encouraged to review open pull requests. Doing reviews helps reduce the burden on the core team and helps make the project's code better for everyone. One or more of the the following people are requested to review this:
|
@Cryoris maybe you have some further suggestions? |
Pull Request Test Coverage Report for Build 4067143317
💛 - Coveralls |
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.
Mostly LGTM, I left some small comments below. Could you also add a release note? 🙂
test/python/algorithms/state_fidelities/test_compute_uncompute.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Julien Gacon <[email protected]>
releasenotes/notes/computeuncompute-local-fidelity-501fe175762b7593.yaml
Outdated
Show resolved
Hide resolved
.. math:: | ||
|
||
\hat{O} = \frac{1}{N}\sum_{i=1}^N|0_i\rangle\langle 0_i|, | ||
|
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.
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, adding the extra line break worked 👍
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 for the updates!
* local fidelity * lint * Update qiskit/algorithms/state_fidelities/compute_uncompute.py Co-authored-by: Julien Gacon <[email protected]> * implement suggestions * doc fix * private variable renamed * reno * try doc fix --------- Co-authored-by: Julien Gacon <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* local fidelity * lint * Update qiskit/algorithms/state_fidelities/compute_uncompute.py Co-authored-by: Julien Gacon <[email protected]> * implement suggestions * doc fix * private variable renamed * reno * try doc fix --------- Co-authored-by: Julien Gacon <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* local fidelity * lint * Update qiskit/algorithms/state_fidelities/compute_uncompute.py Co-authored-by: Julien Gacon <[email protected]> * implement suggestions * doc fix * private variable renamed * reno * try doc fix --------- Co-authored-by: Julien Gacon <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Summary
Adds a flag
average_local
to theComputeUncompute
state fidelity class that allows to compute the local fidelity, which is defined by averaging over single-qubit projectors. It has been shown that global observables, such as the global projector used in the standard fidelity, lead to cost-function induced barren plateaus that can be mitigated by employing a local cost-function instead [1].While this local fidelity cannot replace the global fidelity in all use cases, it coincides with the global version in the case that the fidelity is 1. This is especially useful in algorithms where the fidelity is maximised variationally, such as for example in p-VQD.
Details and Comments
I added a unit test for the case where the fidelity is 1. Open for suggestions for further unit tests if anyone has an idea of an example that would make sense.
References
[1] Cerezo, M., Sone, A., Volkoff, T. et al. Cost function dependent barren plateaus in shallow parametrized quantum circuits. Nat Commun 12, 1791 (2021). https://doi.org/10.1038/s41467-021-21728-w