-
Notifications
You must be signed in to change notification settings - Fork 575
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
Compressed Sparse Row (CSR) representation for Hamiltonians and Tensors #2561
Conversation
Hello. You may have forgotten to update the changelog!
|
Codecov Report
@@ Coverage Diff @@
## master #2561 +/- ##
=======================================
Coverage 99.58% 99.58%
=======================================
Files 243 243
Lines 19596 19596
=======================================
Hits 19515 19515
Misses 81 81
Continue to review full report at Codecov.
|
…ennyLaneAI/pennylane into feature/CSR_Hamiltonian_Representation
Thanks @AmintorDusko. I am curious how CRS compares with COO in terms of the time needed to create the sparse Hamiltonian matrix and also the size of the sparse matrix. |
Hi @soranjh, thanks for asking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good 🎉 The changes look good, though it would be great to get an extra pair of eyes here before merging.
Thank you, @antalszava! I will wait for one more approval before merging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me @AmintorDusko, just left two questions.
…ennyLaneAI/pennylane into feature/CSR_Hamiltonian_Representation
Thank you, @soranjh, @antalszava and @josh146! |
Context:
This PR changes the Pennylane sparse representation to Compressed Sparse Row (CSR) representation.
Description of the Change:
When converting a Hamiltonian to a sparse format, this format will be CSR.
The COO format previously used in all parts of PennyLane was left as an internal format in parts of the code where it will be beneficial.
Benefits:
The expval calculation speed of Sparse Hamiltonians has increased by 20%-30%.
Possible Drawbacks:
Related GitHub Issues: