PennyLaneAI / pennylane

PennyLane is a cross-platform Python library for quantum computing, quantum machine learning, and quantum chemistry. Train a quantum computer the same way as a neural network.
https://pennylane.ai
Apache License 2.0
2.36k stars 604 forks source link

FermiWord and FermiSentence to_mat() method optionally return sparse matrices #6173

Closed willjmax closed 2 months ago

willjmax commented 2 months ago

This PR adds an optional flag to the FermiWord and FermiSentence methods to_mat which when set will return a sparse matrix. Both are used in the following way: mat = fw.to_mat(format="csr"). This PR addresses [sc-72169].

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 99.63%. Comparing base (0b8877e) to head (214d0d7). Report is 2 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #6173 +/- ## ======================================= Coverage 99.63% 99.63% ======================================= Files 445 445 Lines 42388 42391 +3 ======================================= + Hits 42232 42235 +3 Misses 156 156 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

obliviateandsurrender commented 2 months ago

Remember to add a changelog entry and a merge-ready label when you get another approval.