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

Hamiltonian support for Circuit Cutting #4642

Merged
merged 24 commits into from Oct 11, 2023

Conversation

obliviateandsurrender
Copy link
Contributor

@obliviateandsurrender obliviateandsurrender commented Oct 3, 2023

Context: qml.cut_circuit does not work for quantum circuits which computes the expectation values of Hamiltonians with more than one term.

Description of the Change: Use qml.transforms.hamiltonian_expand to extend support for Hamiltonians.

Benefits: Circuit cutting could be used on more realistic circuits.

Possible Drawbacks: The Number of tapes to be computed increases and might give rise to possible overhead in the new scenario.

Related GitHub Issues: #3672

@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2023

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.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.

@codecov
Copy link

codecov bot commented Oct 4, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (2086ce8) 99.63% compared to head (bef7757) 99.63%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4642   +/-   ##
=======================================
  Coverage   99.63%   99.63%           
=======================================
  Files         376      376           
  Lines       33663    33672    +9     
=======================================
+ Hits        33539    33548    +9     
  Misses        124      124           
Files Coverage Δ
pennylane/transforms/qcut/cutcircuit.py 100.00% <100.00%> (ø)

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

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 @obliviateandsurrender
I have a few small requests here

tests/transforms/test_qcut.py Show resolved Hide resolved
pennylane/transforms/qcut/cutcircuit.py Outdated Show resolved Hide resolved
Copy link
Contributor

@rmoyard rmoyard left a comment

Choose a reason for hiding this comment

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

Thanks, it looks good! Just a recommendation for the patch

pennylane/transforms/qcut/cutcircuit.py Outdated Show resolved Hide resolved
@mlxd mlxd requested a review from albi3ro October 6, 2023 17:04
@obliviateandsurrender
Copy link
Contributor Author

[sc-32504]

Copy link
Contributor

@albi3ro albi3ro left a comment

Choose a reason for hiding this comment

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

👍

Might be worth updating Issue #3672 . Might actually be closed now.

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.

Circuit Cutting: extend fragment_tape to work for Hamiltonians with more than one term
5 participants