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

Update MPS expectation value snapshots #509

Closed
wants to merge 3 commits into from
Closed

Conversation

yaelbh
Copy link
Contributor

@yaelbh yaelbh commented Jan 9, 2020

Summary

Updated MPS expectation value snapshots to support snapshots with variance and single shot.

Details and comments

@merav-aharoni can you please check a failing test.

@chriseclectic chriseclectic added this to the Qiskit Aer 0.4 milestone Jan 9, 2020
@chriseclectic chriseclectic mentioned this pull request Jan 9, 2020
13 tasks
@chriseclectic chriseclectic removed this from the Qiskit Aer 0.4 milestone Jan 25, 2020
@yaelbh yaelbh changed the title [WIP] Update MPS expectation value snapshots Update MPS expectation value snapshots Jan 28, 2020
@yaelbh
Copy link
Contributor Author

yaelbh commented Jan 28, 2020

This pull request works fine for the Pauli expectation value but not for the matrix expectation value. I've removed the test of the matrix expectation value, so all tests should pass now, and the pull request is ready for review. @chriseclectic could you please make it to the upcoming release. It is important because it allows faster simulation of VQE instances.

@yaelbh
Copy link
Contributor Author

yaelbh commented Jan 28, 2020

I see that tests are failing. They pass for me locally. Checking.

@yaelbh
Copy link
Contributor Author

yaelbh commented Jan 29, 2020

Apparently there is a core dump in MPS_with_new_indices (called from MPS::expectation_value_pauli). @merav-aharoni will check.

@@ -75,6 +77,8 @@ class TestQasmMatrixProductStateSimulator(
QasmSnapshotStatevectorTests,
QasmSnapshotProbabilitiesTests,
QasmSnapshotStabilizerTests
#QasmSnapshotExpValPauliTests,
Copy link
Member

@chriseclectic chriseclectic Feb 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the issue with the failing tests? Is it due to a bug in the expectation value method or something else? We need the ExpVal tests to pass to merge, otherwise we can't trust the results.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are actually 3 issues in this PR:

  1. bug in the interface of MPS expectation value, following the addition of SnapshotDataType. This was fixed by Yael.
  2. bug in Pauli expectation value when qubits parameter is not given in ascending order.
  3. bug in matrix expectation value when qubits parameter is not given in ascending order.
    These were discovered because Yael added new tests after her change.
    I am in the process of fixing 2 and 3, but would rather address them as separate issues (I will open these). The interface change (1) is more urgent, because that enables the users to use MPS in VQE. I stress that when the qubits are given in the default order, the expectation value works fine.

@chriseclectic chriseclectic removed this from the 0.4.1 release milestone Feb 21, 2020
@atilag
Copy link
Member

atilag commented Feb 24, 2020

Superseed by #619
Closing.

@atilag atilag closed this Feb 24, 2020
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.

4 participants