-
Notifications
You must be signed in to change notification settings - Fork 140
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
Update optimizers to allow new primitives-based algorithms #436
Conversation
62334fc
to
5776fe5
Compare
5776fe5
to
8a042d9
Compare
eb327ef
to
2736b59
Compare
2736b59
to
c52c4b5
Compare
Pull Request Test Coverage Report for Build 3579787083
💛 - Coveralls |
MinimumEigenOptimizer
to allow new primitive-based algorithmsccd9649
to
3c4eb2e
Compare
3c4eb2e
to
b76fe7f
Compare
The qiskit-terra version in requirements.dev should be updated to >= 0.22.* since this now needs the newly updated primitives. Also unit tests should be catching deprecated messages so as CI just catches those which we do not expect (or are outside of our code's control). These would be where we still support/test with older now pending deprecated terra algos for instance. Looking at the messages there are some that are not related to the primitves change that we might want to take a look at to see if we want/need to adjust the optimization code - e.g. some from our use of matplotlib - best done though if needed in a separate PR. |
Update: |
releasenotes/notes/add-primitives-support-31af39549b5e66e3.yaml
Outdated
Show resolved
Hide resolved
While I update the tutorial #442, I notice that |
073d4d8
to
0868492
Compare
I have updated |
releasenotes/notes/add-primitives-support-31af39549b5e66e3.yaml
Outdated
Show resolved
Hide resolved
I applied Steve's suggestions. So, this PR is about to merge. The option of binary prob or nearest prob #436 (comment) will be a separate PR. |
I'm asking @garrison to take a look at this PR to avoid break of https://github.com/qiskit-community/prototype-qrao |
According to Jim, this PR works fine with QRAO. So, I merge this PR. |
Parts of this follow qiskit-community/qiskit-optimization#436
* WIP: use primitives for solving the relaxed problem * Use QAOAAnsatz with VQE The new QAOA implementation in qiskit-terra assumes the problem Hamiltonian is diagonal so that it can benefit from certain additional features, like applying CVaR or other aggregation functions. However, for us the problem Hamiltonian is not diagonal. So, we implement QAOA using the `QAOAAnsatz` together with `VQE`. * Use the default mixer in QAOA, rather than the problem Hamiltonian * The optimizer now works with both the old and new eigen[ ]solvers * Update optimizer to accept new eigensolvers Parts of this follow qiskit-community/qiskit-optimization#436 * Restore tests for the other legacy eigen_solvers (and suppress the `PendingDeprecationWarning`s using pytest) * Make the code path for `LegacyNumPyMinimumEigensolver` more explicit This way, it will be more clear when this branch/block can be removed in the future * Fix a typo
Summary
Add support of the new primitive-based algorithms to optimizers
MinimumEigenOptimizer
GroverOptimizer
WarmStartQAOAOptimizer
addresses #425
Note that the update of tutorials will be a separate PR to minimize the size of PR.
Details and comments
I copied some tests with legacy solvers to
test/algorithms/legacy
dir so that we can easiliy remove them when the legacy algorithms are deprecated.