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

Remove input arg control wires of MultiControlledX #6832

Merged

Conversation

JerryChen97
Copy link
Contributor

@JerryChen97 JerryChen97 commented Jan 14, 2025

Context:
Years ago we deprecated some features inside MultiControlledX but they were forgotten for a while, among which we have the argument control_wires to remove today.

Description of the Change:
Remove the input control_wires along with tests
Benefits:

Possible Drawbacks:

Related GitHub Issues:
[sc-81795]

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.

@JerryChen97 JerryChen97 marked this pull request as ready for review January 14, 2025 22:00
Copy link

codecov bot commented Jan 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.60%. Comparing base (5aab723) to head (0d3ddfd).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6832      +/-   ##
==========================================
- Coverage   99.60%   99.60%   -0.01%     
==========================================
  Files         476      476              
  Lines       45183    45177       -6     
==========================================
- Hits        45006    45000       -6     
  Misses        177      177              

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

@JerryChen97 JerryChen97 changed the title Remove str init arg control wires of multi controlled x Remove arg control wires of multi controlled x Jan 15, 2025
@JerryChen97 JerryChen97 changed the title Remove arg control wires of multi controlled x Remove input arg control wires of multi controlled x Jan 15, 2025
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.

🚀

doc/development/deprecations.rst Outdated Show resolved Hide resolved
doc/releases/changelog-dev.md Outdated Show resolved Hide resolved
JerryChen97 and others added 2 commits January 15, 2025 15:30
Co-authored-by: lillian542 <38584660+lillian542@users.noreply.github.com>
@JerryChen97 JerryChen97 enabled auto-merge (squash) January 15, 2025 20:34
@JerryChen97 JerryChen97 disabled auto-merge January 15, 2025 20:46
@JerryChen97
Copy link
Contributor Author

Spotted deprecated usages in lightning https://github.com/PennyLaneAI/pennylane-lightning/pull/1040/files
I guess we better hold on until that side things are fixed

@JerryChen97 JerryChen97 self-assigned this Jan 15, 2025
@JerryChen97 JerryChen97 added the do not merge ⚠️ Do not merge the pull request until this label is removed label Jan 15, 2025
@JerryChen97
Copy link
Contributor Author

Another open PR from qml used deprecated interface, although it seems long time unmaintained. PennyLaneAI/qml#386 (comment)

@JerryChen97 JerryChen97 changed the title Remove input arg control wires of multi controlled x Remove input arg control wires of MultiControlledX Jan 15, 2025
@JerryChen97
Copy link
Contributor Author

Lightning fix merged. We set this removal as auto-merge now.

@JerryChen97 JerryChen97 added merge-ready ✔️ All tests pass and the PR is ready to be merged. and removed do not merge ⚠️ Do not merge the pull request until this label is removed labels Jan 17, 2025
@JerryChen97 JerryChen97 enabled auto-merge (squash) January 17, 2025 22:48
@JerryChen97 JerryChen97 merged commit d7490d4 into master Jan 17, 2025
45 checks passed
@JerryChen97 JerryChen97 deleted the Remove-init-arg-`control_wires`-of-MultiControlledX branch January 17, 2025 22:53
joeycarter added a commit to PennyLaneAI/catalyst that referenced this pull request Jan 20, 2025
**Context:** The input argument `control_wires` was recently removed
from
[`qml.MultiControlledX`](https://docs.pennylane.ai/en/stable/code/api/pennylane.MultiControlledX.html)
in PennyLaneAI/pennylane#6832. This API change
resulted in a failure in the Catalyst test
`TestGateAliases.test_control_aliases` in the "Check CPL
latest/latest/latest" workflow.

For reference, the call signature of `qml.MultiControlledX` changed from

```python
qml.MultiControlledX(control_wires, wires, control_values, work_wires)
```

to

```python
qml.MultiControlledX(wires, control_values, work_wires)
```

**Description of the Change:** Update the failing test to use the new
call signature of `qml.MultiControlledX`. Also, prefer to explicitly
pass in the wire index or list of wire indices by keyword argument with
`wires=...`, rather than as positional arguments, to hopefully avoid
similar issues in the future.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge-ready ✔️ All tests pass and the PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants