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

Upgrade qml.lie_closure to handle dense matrices #6811

Open
wants to merge 39 commits into
base: master
Choose a base branch
from

Conversation

Qottmann
Copy link
Contributor

@Qottmann Qottmann commented Jan 13, 2025

Upgrading from labs functionality

labs.dla.lie_closure_dense is integrated into the logic of qml.lie_closure

Also adding qml.pauli.trace_inner_product as a utility function for Pauli matrices and operators.

Integrate lie closure dense to qml lie closure [sc-81965]

Copy link

codecov bot commented Jan 13, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.60%. Comparing base (90dc57c) to head (5bec7cd).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6811   +/-   ##
=======================================
  Coverage   99.59%   99.60%           
=======================================
  Files         476      477    +1     
  Lines       45193    45262   +69     
=======================================
+ Hits        45012    45081   +69     
  Misses        181      181           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Qottmann Qottmann requested a review from dwierichs January 20, 2025 17:12
Copy link
Contributor

@DSGuala DSGuala left a comment

Choose a reason for hiding this comment

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

Looks good! Left a few comments about doc readability and arguments/UI

pennylane/pauli/dla/lie_closure.py Outdated Show resolved Hide resolved
pennylane/pauli/dla/lie_closure.py Outdated Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we usually avoid having a "utils" submodule if we can name it something more specific or group functions by their usage.

Since we only have one function in here for now (trace_inner_product), does it still make sense to add the util.py file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm expecting there to be more "utility functions", see e.g. here

Copy link
Contributor Author

@Qottmann Qottmann Jan 20, 2025

Choose a reason for hiding this comment

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

Surely not all of them, but some might make sense to keep public because they are used in different places and might be handy for users

pennylane/pauli/dla/lie_closure.py Outdated Show resolved Hide resolved
Copy link
Contributor

@dwierichs dwierichs left a comment

Choose a reason for hiding this comment

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

Nice and thorough job, @Qottmann 🎉
This basically looks good to go for me, just with the change dense -> matrix pending on the earlier files (by order of git diff :D)

I am wondering whether the trace inner product should be a qml.math feature?

pennylane/labs/dla/structure_constants_dense.py Outdated Show resolved Hide resolved
pennylane/labs/dla/structure_constants_dense.py Outdated Show resolved Hide resolved
pennylane/labs/tests/dla/test_variational_kak.py Outdated Show resolved Hide resolved
pennylane/pauli/dla/lie_closure.py Outdated Show resolved Hide resolved

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Co-authored-by: David Wierichs <[email protected]>
Qottmann and others added 2 commits January 21, 2025 10:42

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Copy link
Contributor

@JerryChen97 JerryChen97 left a comment

Choose a reason for hiding this comment

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

Right now the expected fails caused by the removal of the control_wires arg of MultiControlledX have been cleaned. But there are still multiple fails which require the following changes according to the context here.

pennylane/labs/tests/dla/test_variational_kak.py Outdated Show resolved Hide resolved
pennylane/labs/tests/dla/test_variational_kak.py Outdated Show resolved Hide resolved
pennylane/labs/tests/dla/test_variational_kak.py Outdated Show resolved Hide resolved
pennylane/labs/tests/dla/test_dense_utils.py Outdated Show resolved Hide resolved
Qottmann and others added 11 commits January 22, 2025 14:53

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Co-authored-by: Yushao Chen (Jerry) <[email protected]>
…o dla_lie_closure_dense
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants