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

MPS: Improve performance of Pauli expectation value #812

Merged
merged 8 commits into from
Jul 2, 2020

Conversation

merav-aharoni
Copy link
Contributor

Summary

We improve the performance of computing the Pauli expectation value in MPS by inserting identity matrices on qubits that don't participate in the expectation value.

Details and comments

We implemented idea (2) suggested in issue #748.
When computing the expectation value on a subset of the qubits, in the previous implementation, we did the following:

  1. Copied the MPS structure to a temporary structure
  2. We centralized the relevant qubit using swaps, so that we could compute the exp. value on them only.
    In the new algorithm, we take the minimum and maximum qubits that participate in the exp. value, and compute the exp. value on all the qubits in this range, putting identity matrices on those qubits that do not need to participate.
    The new algorithm does not require a copy of the MPS and does not require swaps, and is therefore more efficient.

@merav-aharoni merav-aharoni changed the title [WIP] MPS: Improve performance of Pauli expectation value MPS: Improve performance of Pauli expectation value Jun 29, 2020
@chriseclectic
Copy link
Member

What sort of performance improvement does this give?

@merav-aharoni
Copy link
Contributor Author

compare expval with insert I

Copy link
Member

@chriseclectic chriseclectic left a comment

Choose a reason for hiding this comment

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

Looks like a nice performance improvement!

@chriseclectic chriseclectic added the performance Performance improvements label Jul 1, 2020
@chriseclectic chriseclectic merged commit fd10aac into Qiskit:master Jul 2, 2020
@chriseclectic chriseclectic added the Changelog: New Feature Include in the Added section of the changelog label Aug 6, 2020
@merav-aharoni merav-aharoni deleted the insert_I branch November 4, 2020 12:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Changelog: New Feature Include in the Added section of the changelog performance Performance improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants