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

[WIP] Fix the incorrect results given by QEOM with noisy simulators #623

Closed

Conversation

Anthony-Gandon
Copy link
Contributor

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:

  • test/algorithms/excited_state_solvers/test_bosonic_esc_calculation_noisy.py
  • test/algorithms/excited_state_solvers/test_excited_states_solvers_noisy.py
    were added to evaluate the results of QEOM with the qasm_simulator and the
    AerPauliExpectation()

Fixes qiskit-community#52
Fixes qiskit-community#415

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.

Added the required support for non-hermitian operators in the aer_pauli_expectation class
@CLAassistant
Copy link

CLAassistant commented Apr 1, 2022

CLA assistant check
All committers have signed the CLA.

@Anthony-Gandon Anthony-Gandon changed the title Fix the incorrect results given by QEOM with noisy simulators [WIP] Fix the incorrect results given by QEOM with noisy simulators Apr 5, 2022
@Anthony-Gandon Anthony-Gandon marked this pull request as draft April 5, 2022 13:49
@mrossinek mrossinek removed the request for review from pbark June 29, 2022 15:26
@HuangJunye HuangJunye added the Community PR PRs from contributors that are not 'members' of the Qiskit organization label Jun 30, 2022
@mrossinek mrossinek removed the Community PR PRs from contributors that are not 'members' of the Qiskit organization label Jul 4, 2022
@mrossinek mrossinek added the on hold Can not fix yet label Oct 19, 2022
@mrossinek
Copy link
Member

This PR was superseded by #971

@mrossinek mrossinek closed this Dec 22, 2022
@Anthony-Gandon Anthony-Gandon deleted the qeom_commit_v2 branch February 22, 2024 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
on hold Can not fix yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

QEOM evaluation of operators QEOM energies differ for Statevector and Qasm simulator
4 participants