-
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
Fix PVQD loss function #9371
Fix PVQD loss function #9371
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:
|
Pull Request Test Coverage Report for Build 3912389631
💛 - 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.
Hi @gentinettagian!!! Thanks for catching this!! I was surprised that the unit tests did not find the bug before, but now I see that the only unit test that actually calls the loss function is with fidelity = 1
. Given that you are already working with the algorithm, do you have any simple use case we could add as a relevant unit test here?
It's probably tricky to find a test that covers this, since the minimum is the same whether we square or not: if the optimizer used is good enough it would work with both this and the previous version. One option would be to test |
That would simplify things for sure :) |
Co-authored-by: Julien Gacon <[email protected]>
* fixed loss function * reno and year * bugfix * Update releasenotes/notes/fix-pvqd-loss-cb1ebe0258f225de.yaml Co-authored-by: Julien Gacon <[email protected]> Co-authored-by: Julien Gacon <[email protected]>
* fixed loss function * reno and year * bugfix * Update releasenotes/notes/fix-pvqd-loss-cb1ebe0258f225de.yaml Co-authored-by: Julien Gacon <[email protected]> Co-authored-by: Julien Gacon <[email protected]>
Summary
The loss function in PVQD is defined as
1 - fidelity
, in the current implementation it was1 - |fidelity|²
.