Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

Re-use optimal vector result previously computed in VQE #1014

Conversation

Cryoris
Copy link
Contributor

@Cryoris Cryoris commented May 25, 2020

Summary

Closes #1012.

@woodsp-ibm
Copy link
Member

All the dictionary settings/return of VQE etc is deprecated and will be deleted. Maybe for now put the method return value into a temp and assign to dict via the np array wrapping, and to eigenstate directly. As changed it alters what is returned by eigenstate.

@Cryoris
Copy link
Contributor Author

Cryoris commented May 25, 2020

Oh right, I thought it simply converts to an array, didn't see it additionally wraps it into an array element. I swapped the order, the dict value now used the result value 👍

@woodsp-ibm
Copy link
Member

Ok, we had kept the dict setting as a single block to facilitate deleting that - as you can see the TODO is above that block - hence my suggestion of a temp var with an intent of leaving the order unchanged. Perhaps put a TODO comment above this moved block too - though I think once the prior block is deleted this moved part would hopefully be self evident

@Cryoris
Copy link
Contributor Author

Cryoris commented May 25, 2020

There's a also another todo below, I'm sure we'll think of it -- also because self._ret will no longer be defined 🙂

@manoelmarques manoelmarques merged commit f95aa3e into qiskit-community:master May 25, 2020
@Cryoris Cryoris deleted the double-call-to-get-optimal-vector branch May 25, 2020 17:54
mtreinish pushed a commit to mtreinish/qiskit-core that referenced this pull request Nov 20, 2020
…nity/qiskit-aqua#1014)

* re-use optimal vector result previously computed

* fix type of result.eigenstate
manoelmarques pushed a commit to manoelmarques/qiskit-terra that referenced this pull request Dec 7, 2020
…nity/qiskit-aqua#1014)

* re-use optimal vector result previously computed

* fix type of result.eigenstate
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Double call to get_optimal_vector
3 participants