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

AerPauliExpectation.compute_variance returns zero variance #5743

Closed
ikkoham opened this issue Aug 4, 2020 · 7 comments
Closed

AerPauliExpectation.compute_variance returns zero variance #5743

ikkoham opened this issue Aug 4, 2020 · 7 comments
Assignees
Labels
mod: opflow Related to the Opflow module

Comments

@ikkoham
Copy link
Contributor

ikkoham commented Aug 4, 2020

What is the expected enhancement?

AerPauliExpectation.compute_variance returns zero variance as the comment said.
https://qiskit.org/documentation/stubs/qiskit.aqua.operators.expectations.AerPauliExpectation.compute_variance.html

However, AerPauliExpectation has a finite (=non-zero) variance in general. In SnapshotExpectationValue used here, an optional argument of variance is True. It seems that this returns variance computed in Aer.

@Cryoris
Copy link
Contributor

Cryoris commented Aug 4, 2020

Which variance do you mean exactly?

As far as I know, the variance argument in the SnapshotExpectationValue does not return an estimator for the sampling noise but only if you add a noise model to the backend. I.e. it cannot be used as a replacement of PauliExpectation.

@ikkoham
Copy link
Contributor Author

ikkoham commented Aug 5, 2020

Yeah, SnapshotExpectationValue returns an expectation value <psi | H psi>. This is not an estimator.

The variance here is
<psi | H^2 psi> - <psi |H psi>^2.

@woodsp-ibm
Copy link
Member

Is this still valid, and if so should it be moved to Terra repo given that opflow has been moved and is being maintained there now? Or should this be closed?

@yaelbh
Copy link
Contributor

yaelbh commented Jan 26, 2021

It's an Aer thing. As commented above, the variance should be equal to 0, since this is not an estimator. But it is perhaps about to change, @chriseclectic should know more.

@ikkoham
Copy link
Contributor Author

ikkoham commented Jan 27, 2021

This will be resolved by usingSaveExpVal in AerPauliExpectation.
Qiskit/qiskit-aer#1101

Closable in Aqua.

Move to Terra and we need to update opflow.AerPauliExpectation after SaveExpVal.

@woodsp-ibm woodsp-ibm transferred this issue from qiskit-community/qiskit-aqua Jan 28, 2021
@woodsp-ibm woodsp-ibm added the mod: opflow Related to the Opflow module label Jan 28, 2021
@manoelmarques
Copy link
Member

manoelmarques commented Jun 4, 2021

If this issue replaces SnapshotExpectationValue with SaveExpectationValue in AerPauliExpectation, then it will also fix #6504

@ikkoham
Copy link
Contributor Author

ikkoham commented Feb 24, 2023

Close once. Please reopen if you want.

@ikkoham ikkoham closed this as completed Feb 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mod: opflow Related to the Opflow module
Projects
None yet
Development

No branches or pull requests

6 participants