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

Support variable depth in user defined ResourceOperations #4033

Merged
merged 38 commits into from May 1, 2023

Conversation

Jaybsoni
Copy link
Contributor

Context:
PL now supports defining operations with custom resource requirements. Currently, tracking resources for operations with depth > 1 is not supported and yields a None value.

This PR adds support so that the depth is accurately computed for a workflow with custom operations.

Description of the Change:

  • Update circuit graph and get_depth() method

@Jaybsoni Jaybsoni added the WIP 🚧 Work-in-progress label Apr 24, 2023
@Jaybsoni
Copy link
Contributor Author

[sc-37602]

@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.

@codecov
Copy link

codecov bot commented Apr 24, 2023

Codecov Report

Merging #4033 (7ccbcff) into master (4c29082) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #4033   +/-   ##
=======================================
  Coverage   99.72%   99.72%           
=======================================
  Files         351      351           
  Lines       30867    30903   +36     
=======================================
+ Hits        30783    30819   +36     
  Misses         84       84           
Impacted Files Coverage Δ
pennylane/circuit_graph.py 100.00% <100.00%> (ø)
pennylane/resource/resource.py 100.00% <100.00%> (ø)
pennylane/tape/qscript.py 99.00% <100.00%> (+0.01%) ⬆️

@Jaybsoni Jaybsoni added review-ready 👌 PRs which are ready for review by someone from the core team. and removed WIP 🚧 Work-in-progress labels Apr 25, 2023
@Jaybsoni Jaybsoni requested a review from trbromley April 25, 2023 17:47
@Jaybsoni Jaybsoni requested review from soranjh and removed request for trbromley April 25, 2023 17:47
pennylane/circuit_graph.py Outdated Show resolved Hide resolved
pennylane/circuit_graph.py Show resolved Hide resolved
pennylane/circuit_graph.py Outdated Show resolved Hide resolved
tests/resource/test_resource.py Outdated Show resolved Hide resolved
pennylane/circuit_graph.py Show resolved Hide resolved
@Jaybsoni Jaybsoni requested a review from soranjh April 27, 2023 14:22
pennylane/circuit_graph.py Outdated Show resolved Hide resolved
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 for adding this.

pennylane/circuit_graph.py Outdated Show resolved Hide resolved
pennylane/circuit_graph.py Show resolved Hide resolved
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 to me! Tried it for a few custom operations with random resources and it worked well.

pennylane/resource/resource.py Show resolved Hide resolved
pennylane/circuit_graph.py Show resolved Hide resolved
pennylane/circuit_graph.py Show resolved Hide resolved
@Jaybsoni Jaybsoni merged commit f1ff4ea into master May 1, 2023
43 checks passed
@Jaybsoni Jaybsoni deleted the custom_depth_re branch May 1, 2023 20:57
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

5 participants