-
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 VQE result, add ansatz #8816
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 3161882352
💛 - Coveralls |
Co-authored-by: Julien Gacon <gaconju@gmail.com>
…into vqe-result-fix Apply suggestion
…into vqe-result-fix Pull suggestion
* Add ansatz to result * Add ansatz to eigen. results * Update qiskit/algorithms/minimum_eigensolvers/minimum_eigensolver.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Copy ansatz * Apply comments * Change name to optimal_circuit(s) * add blank line * move optimal circuit to variational result * remove import Co-authored-by: Julien Gacon <gaconju@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
* Add ansatz to result * Add ansatz to eigen. results * Update qiskit/algorithms/minimum_eigensolvers/minimum_eigensolver.py Co-authored-by: Julien Gacon <gaconju@gmail.com> * Copy ansatz * Apply comments * Change name to optimal_circuit(s) * add blank line * move optimal circuit to variational result * remove import Co-authored-by: Julien Gacon <gaconju@gmail.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Summary
On #8702 and #8640, the
eigenstate
was removed from the eigen-result classes, which has affected certain workflows inqiskit-nature
(@mrossinek).This PR adds the ansatz to the
eigensolver
/minimum_eigensolver
results so that the eigenstates can be retrieved from the result directly (in other words, making the result self-contained). The code would look like:Details and comments
In the future, I believe the
VariationalResult
class should be reviewed, and potentially include thisansatz
property. But so far the eigensolver result does not inherit fromVariationalResult
, and for the sake of including this fix into the upcoming0.22
release, I have decided to add it to the Eigen-results directly.