Repository navigation
Controlled regions keeps work_wire_type - #3366
Merged
Merged
Conversation
astralcai
commented
Oct 19, 2026
mudit2812
reviewed
Oct 20, 2026
mudit2812
reviewed
Oct 20, 2026
mudit2812
reviewed
Oct 20, 2026
mudit2812
left a comment
Contributor
There was a problem hiding this comment.
Looks great. Just one testing suggestion, otherwise ready to approve
This was referenced Oct 20, 2026
Co-authored-by: Mudit Pandey <18223836+mudit2812@users.noreply.github.com>
paul0403
approved these changes
Oct 21, 2026
) Remove the two xfails blocked by PennyLane #[10156](PennyLaneAI/pennylane#10156). Install its branch after each `make frontend` in CI to test the fix. Developed with assistance from OpenAI Codex. [[sc-130866](https://app.shortcut.com/xanaduai/story/130866)] --------- Co-authored-by: Astral Cai <astral.cai@xanadu.ai>
paul0403
approved these changes
Oct 21, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3366 +/- ##
=======================================
Coverage 96.14% 96.14%
=======================================
Files 177 177
Lines 21582 21582
Branches 2153 2153
=======================================
Hits 20751 20751
Misses 643 643
Partials 188 188 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
JerryChen97
added a commit
that referenced
this pull request
Oct 21, 2026
Fixes captured `qp.ctrl` callables with mixed static and runtime Boolean control values. The interpreter reads control values after the control wires, and lowering passes them to the existing SSA `ctrlvals`. Requires PennyLaneAI/pennylane#10356. The new operand layout also applies to static controls, so the two changes need coordinated merging and compatible dependency versions. This overlaps #3366's `work_wire_type` changes. Validation: - 21 targeted Catalyst tests passed with the matching PennyLane patch, including all four reported cases for both Boolean inputs against `default.qubit`. - SSA FileCheck passed, including existing static-control checks. - Formatting passed; Pylint has no new findings. Local execution used native artifacts from `aa5eb08a7`. The branch is now based on `631b95e4a`; the Python patch is unchanged, but the newer native passes were not rebuilt locally. [sc-133997] Assisted by Codex. WIP; human review is in progress. --------- Co-authored-by: paul0403 <paulhaochen.wang@gmail.com>
HelioXv022
pushed a commit
to HelioXv022/pennylane
that referenced
this pull request
Oct 22, 2026
## Context Under `qp.qjit(capture=True, skip_preprocess=True)`, `qp.ctrl` mishandles `control_values` that mix Python Booleans with traced values. Depending on the input form, PennyLane can select the wrong array interface, attempt to call `bool()` on a tracer, or store a tracer in static primitive metadata. ## Changes - Infer the array interface from all control values. - Preserve traced values when normalizing tuples. - Pass all callable control values as Boolean operands: ```text ctrl_transform(*consts, *args, *control_wires, *control_values, ...) ``` - Remove the static `control_values` primitive parameter. - Update the primitive implementation, interpreter, tape conversion, and regression tests. The public `qp.ctrl` API is unchanged. ## Compatibility and landing plan This changes the internal capture contract for callable controls. PennyLane and Catalyst therefore need coordinated updates; either new implementation is incompatible with the other repository's previous representation. Proposed order: 1. Land PennyLaneAI#10355 with [PennyLaneAI/catalyst#3366](PennyLaneAI/catalyst#3366). 2. Rebase and land this change with its matching Catalyst update and compatible dependency pins. [PennyLaneAI/catalyst#3350](PennyLaneAI/catalyst#3350) and [PennyLaneAI/catalyst#3365](PennyLaneAI/catalyst#3365) address separate decomposition issues and are outside this PR's scope. ## Validation - 20 targeted PennyLane tests passed, covering static and dynamic operand layouts, primitive execution, interpreter forwarding, tape conversion, dynamic shapes, constants, and mixed operator-instance lists. - 21 targeted Catalyst tests passed with the matching local change, including the four reported cases for both runtime Boolean values against `default.qubit`, plus static and nested controls. - Catalyst SSA FileCheck passed, including its existing static-control checks. - `TestDeviceLevelSpecs.test_complex` has a temporary strict `xfail` limited to the old Catalyst handler's missing-`control_values` error. It was verified as XFAIL with the upstream handler, strict XPASS with the companion change, and passing with the companion change under `--runxfail`. The marker can be removed once a compatible Catalyst nightly is available. - PennyLane source and test Pylint, formatting, `tach check`, and `git diff --check` passed. `tach` reported three pre-existing unused-ignore warnings. - Full local test suites were not run. ## Related issue [sc-133997] **AI assistance:** Prepared with AI assistance at the contributor's request. Human review remains in progress. --------- Co-authored-by: Christina Lee <christina@xanadu.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Context:
Follow-up to PennyLaneAI/pennylane#10355, adds
work_wire_typeto the controlled region primitive. Note that this change is purely in the frontend.Description of the Change:
Benefits:
Possible Drawbacks:
Related GitHub Issues:
[sc-134199]