[WIP] Fix the incorrect results given by QEOM with noisy simulators #623
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #52
Fixes #415
Summary
Previously, QEOM evaluated the many operators needed to create the matrices Q,M on the
groundstate resulting from a call to VQE. This worked for StateVector simulators because
this object was exactly the statefunction (type VectorStateFn). However, when using QASM or
aer_simulator this eigenstate is a dictionary of samples which was converted
into a VectorStateFn without consideration of the sign ambiguity.
This commit changes the evaluate_operators() method used in QEOM to the eval_observables()
that was added in a recent commit of qiskit-terra.
This method is called on the ansatz function evaluated at the optimal parameters given by
the solver instead of on the groundstate. This delays the call to the eval() method which
was the root of the issue.
A Qiskit-terra pull requests gives the required support for non-hermitian operators in the
aer_pauli_expectation class.
Details and comments
This commit modifies the evaluate_operators() method of the ground state_eigensolver to allow
input of type Circuit.
However, a recent commit to Qiskit-terra aims to unify the many such evaluation method.
The modified QEOM function calls eval_observables() instead of evaluate_operators().
This leads in a failure to pass the first test of test_excited_states_solvers.py due to an
error an unhandled case in eval_observables() when the solver is NumPyMinimumEigensolver().
The tests:
were added to evaluate the results of QEOM with the qasm_simulator and the
AerPauliExpectation()