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

[Frontend] Add support for Hamiltonian with integer coefficients #248

Merged
merged 6 commits into from Aug 16, 2023

Conversation

maliasadi
Copy link
Member

@maliasadi maliasadi commented Aug 16, 2023

Context:
Catalyst doesn’t support Hamiltonians with integer coefficients (coeffs with int element type) while this is supported in PennyLane. There are more use cases for this type of Hamiltonians in particular for qml.sum where they're converted to PL Hamiltonian data-types with integer coefficients. (e.g., qml.PauliZ(0) + qml.PauliZ(1) is converted to H([1,1], [Z(0), Z(1)])).

This PR adds this support with updating the Hamiltonian primitive.

[sc-41351]

@maliasadi maliasadi requested a review from dime10 August 16, 2023 20:01
@codecov
Copy link

codecov bot commented Aug 16, 2023

Codecov Report

Merging #248 (51f0186) into main (0d97a18) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main     #248   +/-   ##
=======================================
  Coverage   99.24%   99.24%           
=======================================
  Files          38       38           
  Lines        6718     6724    +6     
  Branches      340      341    +1     
=======================================
+ Hits         6667     6673    +6     
  Misses         28       28           
  Partials       23       23           
Files Changed Coverage Δ
frontend/catalyst/jax_primitives.py 97.01% <100.00%> (+0.02%) ⬆️

Copy link
Collaborator

@dime10 dime10 left a comment

Choose a reason for hiding this comment

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

Thanks @maliasadi 💯

doc/changelog.md Outdated Show resolved Hide resolved
frontend/test/pytest/test_measurements_results.py Outdated Show resolved Hide resolved
maliasadi and others added 2 commits August 16, 2023 16:08
Co-authored-by: David Ittah <dime10@users.noreply.github.com>
@maliasadi maliasadi merged commit 8a3ab3a into main Aug 16, 2023
19 checks passed
@maliasadi maliasadi deleted the maa/i64-coeffs-hamiltonian branch August 16, 2023 20:47
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

2 participants