Skip to content
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

Leverage Dict-based aux_operators #396

Closed
mrossinek opened this issue Oct 14, 2021 · 4 comments · Fixed by #406
Closed

Leverage Dict-based aux_operators #396

mrossinek opened this issue Oct 14, 2021 · 4 comments · Fixed by #406
Assignees

Comments

@mrossinek
Copy link
Member

What is the expected enhancement?

Terra has just added support for Dict-based aux_operators in its Eigensolver interfaces (Qiskit/qiskit#6870). This can greatly improve the handling within the property framework.

@mrossinek
Copy link
Member Author

I believe the aforementioned PR also slightly changed the list-based interface by removing one level of list-nesting. This went unnoticed until the CI on the main branch failed last night, presumably because the terra unittests do not cover the aux_operators interface? 🤔

@mrossinek
Copy link
Member Author

Actually, there now appears to be a mismatch between the aux_op_eigenvalues as returned by the NumPyMinimumEigensolver compared to the VQE...

@mrossinek
Copy link
Member Author

Okay some more observations:

  • the NumPyEigensolver has (since its first commit) returned the auxiliary operator eigenvalues as a tuple: (value, 0). current code. It is not 100% clear to me, why it is done this way. I also did not find documentation on this matter. Neither in the algorithm itself nor in the Result object. The only suggestion I have would be that the 0 is a place-holder for when we will have standard-deviation information on this eigenvalue (which in the numpy case is always 0).
  • in order to match this interface (that each aux_op_eigenvalue is actually a tuple) the VQE used to wrap each evaluated aux_op into a list here which is no longer the case in the new code here

There are two solutions:

  1. Remove the tuple style from NumPyMinimumEigensolver (strongly disfavored)
  2. Change the VQE to also return tuples (not simply wrap the eigenvalue into a list, imo) and document the return type properly for the future.

@mrossinek
Copy link
Member Author

I removed the critical label again, because this is an issue which needs to be fixed on the Terra side. See my PR: Qiskit/qiskit#7144

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant