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

Improve the speed of the Matrix Product States simulator #25

Open
aromanro opened this issue Sep 2, 2024 · 4 comments
Open

Improve the speed of the Matrix Product States simulator #25

aromanro opened this issue Sep 2, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@aromanro
Copy link
Owner

aromanro commented Sep 2, 2024

There are various ways of doing so... a straightforward one would be to parallelize some of the computations with open mp.
There are also ways of optimizing the execution of some gates.

qiskit aer does it, they have a tensor class oriented towards qubits computations (it holds internally matrices and execution of many operations is optimized), this implementation is more generic and uses Eigen tensors (with suboptimal data copying between matrices and tensors back and forth).

I probably won't go that path, unless really necessary.

@aromanro aromanro added the enhancement New feature or request label Sep 2, 2024
@aromanro aromanro self-assigned this Sep 2, 2024
@aromanro
Copy link
Owner Author

aromanro commented Sep 3, 2024

The copying between tensors and matrices could be improved using 'slice' and/or 'chip'.

@aromanro
Copy link
Owner Author

aromanro commented Sep 3, 2024

For tensor->matrix conversion, here is a way: https://stackoverflow.com/questions/48795789/eigen-unsupported-tensor-to-eigen-matrix

@aromanro
Copy link
Owner Author

aromanro commented Sep 7, 2024

TensorMap could be used in a less generic way than used in the link above, if needed.

@aromanro
Copy link
Owner Author

aromanro commented Sep 7, 2024

Another thing that could be used to improve the speed: use multithreading. Eigen tensors have support for 'thread pools', for example one can do a contraction using multiple threads. See Eigen::ThreadPool and Eigen::ThreadPoolDevice for details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant