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 control_flow module for for_loop and while_loop #7017

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

albi3ro
Copy link
Contributor

@albi3ro albi3ro commented Feb 27, 2025

Context:

for_loop and while_loop are currently located in qjit_api.py. This isn't an obvious location for these functions now that they have wider use and are "core" pennylane features.

Description of the Change:

Adds a control_flow module and places for_loop and while_loop into it.

Benefits:

Easier to find control flow code.

Possible Drawbacks:

Should consider moving qml.cond too, but it depends on Operator, queuing, MeasurementValue, etc.

Related GitHub Issues:

[sc-85453]

Copy link

codecov bot commented Feb 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.60%. Comparing base (2c3a11f) to head (c712562).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7017   +/-   ##
=======================================
  Coverage   99.60%   99.60%           
=======================================
  Files         484      487    +3     
  Lines       46249    46257    +8     
=======================================
+ Hits        46065    46073    +8     
  Misses        184      184           

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

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.

1 participant