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

Add TrotterProduct template #4661

Merged
merged 38 commits into from
Oct 19, 2023
Merged

Add TrotterProduct template #4661

merged 38 commits into from
Oct 19, 2023

Conversation

Jaybsoni
Copy link
Contributor

Context:
First of 3 PRs adding the new TrotterProduct template to allow for advanced Trotter methods in Pennylane

Description of the Change:

  • Implement the template
  • Add basic tests

@Jaybsoni Jaybsoni changed the title Add TrotterProduct template [WIP] Add TrotterProduct template Oct 10, 2023
@github-actions
Copy link
Contributor

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.

@Jaybsoni Jaybsoni added the WIP 🚧 Work-in-progress label Oct 10, 2023
@codecov
Copy link

codecov bot commented Oct 10, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (32a15ac) 99.64% compared to head (971d560) 99.64%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4661   +/-   ##
=======================================
  Coverage   99.64%   99.64%           
=======================================
  Files         376      377    +1     
  Lines       33788    33846   +58     
=======================================
+ Hits        33667    33725   +58     
  Misses        121      121           
Files Coverage Δ
pennylane/ops/functions/equal.py 98.55% <100.00%> (+0.02%) ⬆️
pennylane/templates/subroutines/__init__.py 100.00% <100.00%> (ø)
pennylane/templates/subroutines/trotter.py 100.00% <100.00%> (ø)

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

@Jaybsoni
Copy link
Contributor Author

[sc-44302]

Copy link
Contributor

@KetpuntoG KetpuntoG left a comment

Choose a reason for hiding this comment

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

Awesome job here! 😊
I've left out some silly questions but it's been a long time since I've done a code review and I want to understand some of the decisions. On the other hand, is there still a way to include the differentiability part? I have not been able to obtain the gradient with respect to time

pennylane/ops/functions/equal.py Show resolved Hide resolved
pennylane/templates/subroutines/trotter.py Outdated Show resolved Hide resolved
pennylane/templates/subroutines/trotter.py Show resolved Hide resolved
pennylane/templates/subroutines/trotter.py Show resolved Hide resolved
pennylane/templates/subroutines/trotter.py Show resolved Hide resolved
pennylane/templates/subroutines/trotter.py Show resolved Hide resolved
pennylane/templates/subroutines/trotter.py Outdated Show resolved Hide resolved
pennylane/templates/subroutines/trotter.py Outdated Show resolved Hide resolved
pennylane/templates/subroutines/trotter.py Show resolved Hide resolved
pennylane/templates/subroutines/trotter.py Outdated Show resolved Hide resolved
@Jaybsoni Jaybsoni changed the title [WIP] Add TrotterProduct template Add TrotterProduct template Oct 11, 2023
@Jaybsoni Jaybsoni added review-ready 👌 PRs which are ready for review by someone from the core team. and removed WIP 🚧 Work-in-progress labels Oct 11, 2023
Copy link
Contributor

@trbromley trbromley left a comment

Choose a reason for hiding this comment

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

Note that @isaacdevlugt has already added a changelog entry here, so no need to worry too much on that point.

@trbromley trbromley added this to the v0.33 milestone Oct 18, 2023
Copy link
Contributor

@soranjh soranjh left a comment

Choose a reason for hiding this comment

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

Thanks @Jaybsoni, looks good. Will approve when the minor comments and questions are addressed.

pennylane/templates/subroutines/trotter.py Outdated Show resolved Hide resolved
pennylane/templates/subroutines/trotter.py Outdated Show resolved Hide resolved
pennylane/templates/subroutines/trotter.py Outdated Show resolved Hide resolved
pennylane/templates/subroutines/trotter.py Show resolved Hide resolved
Jaybsoni and others added 3 commits October 18, 2023 14:40
**Context:**
This PR adds additional tests to the `TrotterProduct` class to ensure it
integrates well with
all interfaces and is fully differentiable.

**Description of the Change:**
- Add tests for interface execution
- Add tests for interface gradient computation

---------

Co-authored-by: soranjh <soran.jahangiri@gmail.com>
Jaybsoni and others added 3 commits October 18, 2023 16:35
Copy link
Contributor

@soranjh soranjh left a comment

Choose a reason for hiding this comment

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

Thanks @Jaybsoni! Please check the code example in usage details.

pennylane/templates/subroutines/trotter.py Outdated Show resolved Hide resolved
pennylane/templates/subroutines/trotter.py Outdated Show resolved Hide resolved
Copy link
Contributor

@trbromley trbromley left a comment

Choose a reason for hiding this comment

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

Thanks @Jaybsoni!

pennylane/templates/subroutines/trotter.py Show resolved Hide resolved
pennylane/templates/subroutines/trotter.py Outdated Show resolved Hide resolved
Jaybsoni and others added 3 commits October 19, 2023 09:53
Co-authored-by: Tom Bromley <49409390+trbromley@users.noreply.github.com>
Copy link
Contributor

@KetpuntoG KetpuntoG left a comment

Choose a reason for hiding this comment

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

🚀🚀🚀 Awesome

@Jaybsoni Jaybsoni merged commit 1cd1055 into master Oct 19, 2023
39 checks passed
@Jaybsoni Jaybsoni deleted the trotter_product branch October 19, 2023 15:34
mudit2812 pushed a commit that referenced this pull request Oct 20, 2023
**Context:**
First of 3 PRs adding the new TrotterProduct template to allow for
advanced Trotter methods in Pennylane

**Description of the Change:**
- Implement the template
- Add basic tests

---------

Co-authored-by: Tom Bromley <49409390+trbromley@users.noreply.github.com>
Co-authored-by: soranjh <soran.jahangiri@gmail.com>
Co-authored-by: soranjh <40344468+soranjh@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review-ready 👌 PRs which are ready for review by someone from the core team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants