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

BopesSampler uses deprecated method of VQE - needs to be updated #242

Closed
woodsp-ibm opened this issue Jun 18, 2021 · 0 comments · Fixed by #321
Closed

BopesSampler uses deprecated method of VQE - needs to be updated #242

woodsp-ibm opened this issue Jun 18, 2021 · 0 comments · Fixed by #321
Assignees

Comments

@woodsp-ibm
Copy link
Member

VQE was changed to deprecate a bunch of methods, that were around aspects of the result, to make it stateless, which now requires the result object to be used directly. AdaptVQE was updated in #222 but as that was progressed, after the Terra PR to make VQE stateless was merged, CI failed when BopeSampler accessed one of the deprecated properties. Turned out the decorators were in the wrong order leading it to return different than was expected - see #222 for more details in the comments. That was fixed an CI passed for #222, which has now been merged asap since it was blocking all other activity, but this leaves BopesSampler still needing to be updated to avoid the newly added deprecation of aspects of VQE. The failure was in the BopesSampler tutorial - I recall unit tests passing - indeed in the CI of #222, after it passed, I see no deprecation message in the rollup - so maybe the unit tests don't cover that code (arguably they should) - either way this need investigation and correction. Here is what was saved from the when it showed the message

qiskit_nature/algorithms/pes_samplers/bopes_sampler.py:196: DeprecationWarning: 
The VQE.optimal_params property is deprecated as of Qiskit Terra 0.18.0
and will be removed no sooner than 3 months after the releasedate.
This information is part of the returned result object and can be
queried as VQEResult.optimal_point.
  optimal_params = self._gss.solver.optimal_params  # type: ignore

so its part of this code https://github.com/Qiskit/qiskit-nature/blob/3757845c601a65bc0dad7a6a4eae78ef7a235e2c/qiskit_nature/algorithms/pes_samplers/bopes_sampler.py#L193-L197

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

Successfully merging a pull request may close this issue.

2 participants