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

Memory consumption optimization for Observable::observe #542

Open
1tnguyen opened this issue May 20, 2022 · 0 comments
Open

Memory consumption optimization for Observable::observe #542

1tnguyen opened this issue May 20, 2022 · 0 comments

Comments

@1tnguyen
Copy link
Member

The way Observable::observe generates all CompositeInstructions at once may consume a very large amount of memory.

In particular, all these CompositeInstructions are deep copies

It has always been like that for a long time and I think a deep copy is properly needed anyway since we don't want any interference between potential IRTransformation passes (if any) down the track.

For example, UCCSD ansatz + H8 Hamiltonian may consume multiple GBs just for these CompositeInstructions

We need to come up with a way to handle this more efficiently. A potential solution is to have the upper layer (e.g., VQE) to process this in chunks, i.e., create observe circuits for subsets of the terms in chunks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant