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

Implements native support for Sparse Hamiltonians expval() calculation with Kokkos #283

Merged
merged 132 commits into from
May 27, 2022

Conversation

AmintorDusko
Copy link
Contributor

@AmintorDusko AmintorDusko commented Apr 20, 2022

Context:

This PR implements native support for sparse Hamiltonians expval calculation.
Sparse operations are offloaded to Kokkos.

Description of the Change:

Add native support for the calculation of sparse Hamiltonians' expectation values.

Benefits:

Performant calculation with Pennylane-Lightning

Possible Drawbacks:

Not that I'm aware of.

Related GitHub Issues:

Not that I'm aware of.

@AmintorDusko AmintorDusko added enhancement New feature or request WIP Work-in-progress issue. Not for general fixing. labels Apr 20, 2022
@github-actions
Copy link
Contributor

Hello. You may have forgotten to update the changelog!
Please edit .github/CHANGELOG.md with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 20, 2022

Test Report (C++) on Ubuntu

           1 files  ±  0             1 suites  ±0   1s ⏱️ -1s
       865 tests +11         865 ✔️ +11  0 💤 ±0  0 ±0 
228 763 runs  +21  228 763 ✔️ +21  0 💤 ±0  0 ±0 

Results for commit ef86272. ± Comparison against base commit e4db7f1.

♻️ This comment has been updated with latest results.

@codecov
Copy link

codecov bot commented Apr 20, 2022

Codecov Report

Merging #283 (ef86272) into master (e4db7f1) will increase coverage by 0.19%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #283      +/-   ##
==========================================
+ Coverage   99.24%   99.44%   +0.19%     
==========================================
  Files          29       30       +1     
  Lines        3330     3410      +80     
==========================================
+ Hits         3305     3391      +86     
+ Misses         25       19       -6     
Impacted Files Coverage Δ
pennylane_lightning/_version.py 100.00% <100.00%> (ø)
pennylane_lightning/lightning_qubit.py 100.00% <100.00%> (ø)
pennylane_lightning/src/simulator/Measures.hpp 100.00% <100.00%> (+2.66%) ⬆️
pennylane_lightning/src/util/Kokkos_Sparse.hpp 100.00% <100.00%> (ø)
...nnylane_lightning/src/simulator/StateVectorRaw.hpp 88.23% <0.00%> (-11.77%) ⬇️
pennylane_lightning/src/gates/GateUtil.cpp 100.00% <0.00%> (ø)
pennylane_lightning/src/gates/GateUtil.hpp 100.00% <0.00%> (ø)
pennylane_lightning/src/util/RuntimeInfo.cpp 100.00% <0.00%> (ø)
pennylane_lightning/src/util/RuntimeInfo.hpp 100.00% <0.00%> (ø)
...ennylane_lightning/src/algorithms/JacobianTape.hpp 100.00% <0.00%> (ø)
... and 9 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e4db7f1...ef86272. Read the comment docs.

@chaeyeunpark
Copy link
Contributor

Hi @AmintorDusko, I think Kokkos does not support MSVC. We may need to try clang-cl instead... I will ping you on slack.

@AmintorDusko
Copy link
Contributor Author

AmintorDusko commented Apr 21, 2022

Hi @AmintorDusko, I think Kokkos does not support MSVC. We may need to try clang-cl instead... I will ping you on slack.

Yes. Its looks like it! Thank you very much @chaeyeunpark!
Also, your add_kokkos branch was quite useful!
Thank you for looking into it before me!

Copy link
Member

@mlxd mlxd left a comment

Choose a reason for hiding this comment

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

Hey Amintor, I have a few more comments/questions.

@mlxd mlxd self-requested a review May 26, 2022 22:23
Copy link
Member

@mlxd mlxd left a comment

Choose a reason for hiding this comment

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

Awesome work on this Amintor! One last thing we need is to update the license statement at the end of the Lightning README to indicate we are using Kokkos under the BSD license (see Jet's statement here for an example).

@mlxd mlxd self-requested a review May 27, 2022 14:27
Copy link
Member

@mlxd mlxd left a comment

Choose a reason for hiding this comment

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

💯

@AmintorDusko AmintorDusko merged commit debd776 into master May 27, 2022
@AmintorDusko AmintorDusko deleted the feature/Kokkos-sparse branch May 27, 2022 14:31
Copy link
Member

@maliasadi maliasadi left a comment

Choose a reason for hiding this comment

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

Hey @AmintorDusko. great job! 💯 Sorry for this late review; I was thinking this one is still work-in-progress 🙁 As this one already merged and you also merged the follow-up PR (#296). I'll go with a few general comments to be applied for later...

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

Successfully merging this pull request may close these issues.

5 participants