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 resources() to qml.TrotterProduct class #5680

Merged
merged 8 commits into from
Jun 10, 2024
Merged

Conversation

Jaybsoni
Copy link
Contributor

Context:
qml.TrotterProduct() now has error tracking functionality, but ins't compatible with resource tracking. This bug fix adds native resource tracking functionality to allow for compatibility with both pipelines.

image

Description of the Change:
Inherit from ResourcesOperation class as well and directly implement the resource method.

Benefits:
Allows for tracking resources without decomposing the template.

Possible Drawbacks:
If we change the target gate-set or want to decompose further, then this method is no longer accurate.

Related GitHub Issues:
Replicating most of this PR post release.

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 requested a review from trbromley May 10, 2024 21:19
@Jaybsoni
Copy link
Contributor Author

[sc-62523]

Copy link

codecov bot commented May 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.66%. Comparing base (2100476) to head (1e5e001).
Report is 255 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5680      +/-   ##
==========================================
+ Coverage   99.51%   99.66%   +0.14%     
==========================================
  Files         415      415              
  Lines       39985    39505     -480     
==========================================
- Hits        39791    39372     -419     
+ Misses        194      133      -61     

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

Co-authored-by: Utkarsh <utkarshazad98@gmail.com>
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 note my minor comments before merging.

tests/templates/test_subroutines/test_trotter.py Outdated Show resolved Hide resolved
doc/releases/changelog-dev.md 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!

Copy link
Contributor

@obliviateandsurrender obliviateandsurrender 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 to me! Optionally, you might want to add an integration test with qml.Tracker too.

@Jaybsoni Jaybsoni requested a review from trbromley June 7, 2024 21:55
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!

@Jaybsoni Jaybsoni enabled auto-merge (squash) June 10, 2024 13:26
@Jaybsoni Jaybsoni merged commit 879c1e4 into master Jun 10, 2024
40 checks passed
@Jaybsoni Jaybsoni deleted the trotter_w_resources branch June 10, 2024 13:53
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.

4 participants