Skip to content

Conversation

@kajoel
Copy link

@kajoel kajoel commented Mar 26, 2019

We found a bug while using vqe with samples=None. The current version uses the expectation method of WavefunctionSimulator from pyquil.api to calculate the expectation values of every term (including coefficients) in the PauliSum and then weights these with the coefficients of the terms. Thus, the coefficients are, effectively, squared, which results in an incorrect expectation value of the PauliSum. The proposed solution is to let the expectation method of WavefunctionSimulator handle everything since it supports PauliSums.

Moreover, we found that vqe expectation made some unnecessary computations on the QC, probably due to an accidental indentation (see last commit).

Joel Karlsson added 4 commits March 24, 2019 14:53
Fixes the bug of squared coefficients when using vqe with samples=None.
The expectation method of WavefunctionSimulator can handle a PauliSum and takes care of both coefficients and summing.
Skip some unnecessary computations on the qc.
@mstechly
Copy link
Contributor

mstechly commented May 14, 2019

@kajoel Thanks for this!

@amyfbrown Can someone take a look into it and merge it, please?
I think it's pretty critical one - if anyone is using VQE (or QAOA), they probably run a simulation with no sampling at first.

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 this pull request may close these issues.

2 participants