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

Clean-up Wires object usage across source code #6689

Merged
merged 53 commits into from
Dec 20, 2024
Merged

Conversation

andrijapau
Copy link
Contributor

@andrijapau andrijapau commented Dec 9, 2024

Context:

Follow up to #6713.

It is not possible to initialize a Wires object with wires=None after #6713. However, we should not be using wires=None in our code-base unless it's appropriate.

Description of the Change:

This PR reviews the code-base to ensure that wires=None does not occur where it is not applicable. When appropriate, it updates the default to wires=() or uses no default at all.

Benefits: Code clean-up.

Possible Drawbacks: None identified.

[sc-78998]

Copy link
Contributor

github-actions bot commented Dec 9, 2024

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.

Copy link

codecov bot commented Dec 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.60%. Comparing base (585767c) to head (7c3a7d9).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #6689   +/-   ##
=======================================
  Coverage   99.60%   99.60%           
=======================================
  Files         475      475           
  Lines       45102    45115   +13     
=======================================
+ Hits        44925    44938   +13     
  Misses        177      177           

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

@andrijapau andrijapau changed the title Remove wires=None Disallow wires=None Dec 9, 2024
@andrijapau andrijapau changed the title Disallow wires=None [WIP] Disallow wires=None Dec 12, 2024
@andrijapau andrijapau added the WIP 🚧 Work-in-progress label Dec 16, 2024
@andrijapau andrijapau removed the WIP 🚧 Work-in-progress label Dec 19, 2024
@andrijapau andrijapau changed the title Disallow wires=None across codebase when appropriate Clean-up Wires usage across source code Dec 19, 2024
@andrijapau andrijapau changed the title Clean-up Wires usage across source code Clean-up Wires object usage across source code Dec 19, 2024
Copy link
Contributor

@lillian542 lillian542 left a comment

Choose a reason for hiding this comment

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

I left a few small comments here and there, see what you think :)

pennylane/templates/subroutines/grover.py Outdated Show resolved Hide resolved
pennylane/ops/meta.py Outdated Show resolved Hide resolved
pennylane/ops/op_math/controlled.py Outdated Show resolved Hide resolved
pennylane/templates/subroutines/qft.py Outdated Show resolved Hide resolved
Copy link
Contributor

@PietropaoloFrisoni PietropaoloFrisoni left a comment

Choose a reason for hiding this comment

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

Thanks! Just one clarification from me.

Regarding the discussion about changelog entries, can we have a unique changelog entry for all the improvements you implemented regarding the tests?

pennylane/ops/meta.py Outdated Show resolved Hide resolved
pennylane/ops/channel.py Show resolved Hide resolved
Copy link
Contributor

@lillian542 lillian542 left a comment

Choose a reason for hiding this comment

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

Thanks for tidying this up :)

Copy link
Contributor

@PietropaoloFrisoni PietropaoloFrisoni left a comment

Choose a reason for hiding this comment

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

🚀

@andrijapau andrijapau merged commit 2f60fd5 into master Dec 20, 2024
46 checks passed
@andrijapau andrijapau deleted the remove-wires-eq-none branch December 20, 2024 18:57
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.

3 participants