Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

Be more memory efficient converting SummedOp to MatrixOp #1129

Merged
merged 4 commits into from
Jul 24, 2020

Conversation

jlapeyre
Copy link
Contributor

Before all summands were converted to MatrixOp and then summed. This
PR instead converts them one by one and accumulates the result.

Previously the method ListOp.to_matrix_op was called when converting an instance of SummedOp to a MatrixOp. This PR adds the more specific method SummedOp.to_matrix_op, which avoid allocating a large array of matrices as an intermediate step.

Closes #1027

@jlapeyre
Copy link
Contributor Author

If this looks like the right approach, I'll add a release note, etc. to the PR.

Before, all summands were converted to MatrixOp and then summed. This
PR instead converts them one by one and accumulates the result,
thereby avoiding building a large intermediate list.

Closes qiskit-community#1027

* Add release note
@jlapeyre jlapeyre force-pushed the matrix_memory_new branch from 92cff4b to 50042da Compare July 23, 2020 20:37
@jlapeyre jlapeyre changed the title [WIP] Be more memory efficient converting SummedOp to MatrixOp Be more memory efficient converting SummedOp to MatrixOp Jul 23, 2020
@woodsp-ibm woodsp-ibm merged commit 6ee74dd into qiskit-community:master Jul 24, 2020
manoelmarques added a commit to manoelmarques/qiskit-aqua that referenced this pull request Jul 28, 2020
…unity#1129)

Before, all summands were converted to MatrixOp and then summed. This
PR instead converts them one by one and accumulates the result,
thereby avoiding building a large intermediate list.

Closes qiskit-community#1027

* Add release note

Co-authored-by: Manoel Marques <manoel@us.ibm.com>
pbark pushed a commit to pbark/qiskit-aqua that referenced this pull request Sep 16, 2020
…unity#1129)

Before, all summands were converted to MatrixOp and then summed. This
PR instead converts them one by one and accumulates the result,
thereby avoiding building a large intermediate list.

Closes qiskit-community#1027

* Add release note

Co-authored-by: Manoel Marques <manoel@us.ibm.com>
mtreinish pushed a commit to mtreinish/qiskit-core that referenced this pull request Nov 20, 2020
…unity/qiskit-aqua#1129)

Before, all summands were converted to MatrixOp and then summed. This
PR instead converts them one by one and accumulates the result,
thereby avoiding building a large intermediate list.

Closes qiskit-community/qiskit-aqua#1027

* Add release note

Co-authored-by: Manoel Marques <manoel@us.ibm.com>
manoelmarques added a commit to manoelmarques/qiskit-terra that referenced this pull request Dec 2, 2020
…unity/qiskit-aqua#1129)

Before, all summands were converted to MatrixOp and then summed. This
PR instead converts them one by one and accumulates the result,
thereby avoiding building a large intermediate list.

Closes qiskit-community/qiskit-aqua#1027

* Add release note

Co-authored-by: Manoel Marques <manoel@us.ibm.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

opflow extensive memory usage for VQE with UCCSD variational form
3 participants