Skip to content

qp.ctrl of qfuncs keeps work_wire_type - #10355

Merged
astralcai merged 5 commits into
mainfrom
ctrl-transform-work-wire-type
Oct 20, 2026
Merged

astralcai merged 5 commits into
mainfrom
ctrl-transform-work-wire-type

Conversation

@astralcai

Copy link
Copy Markdown
Contributor

Context:

import jax
import pennylane as qp

qp.capture.enable()

def f():
    qp.X(0)

def circuit():
    qp.ctrl(f, control=[1, 2], work_wires=[3, 4], work_wire_type='zeroed')()
>>> jax.make_jaxpr(circuit)()
{ lambda ; . let
    ctrl_transform[
      control_values=(True, True)
      jaxpr={ lambda ; . let
          _:AbstractOperator() = operator[
            adjoint=False
            forward_mask=()
            hybrid_lens=()
            hybrid_trees=()
            n_ctrls=0
            op_cls=<class 'pennylane.ops.qubit.non_parametric_ops.PauliX'>
            wire_lens=(1,)
          ] 0:i32[]
        in () }
      n_consts=0
      n_control=2
      work_wires=[3, 4]
    ] 1:i32[] 2:i32[]
  in () }

Description of the Change:

Benefits:

Possible Drawbacks:

Related GitHub Issues:
[sc-134199]

@codecov

codecov Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.43%. Comparing base (962a77d) to head (a30fd50).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10355      +/-   ##
==========================================
- Coverage   99.44%   99.43%   -0.01%     
==========================================
  Files         617      617              
  Lines       68032    68032              
==========================================
- Hits        67652    67651       -1     
- Misses        380      381       +1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JerryChen97

Copy link
Copy Markdown
Contributor

@astralcai, coordinating sc-133997 / PennyLane #10356 with your sc-134199 pair (PennyLane #10355 and Catalyst #3366), at Jerry's request.

Our revised capture contract always places Boolean control values after the wires and removes the control_values parameter. Your work_wire_type remains static metadata, so both changes should coexist.

Can we land your pair first, then rebase both dynamic-control branches over it, preserving work_wire_type, and land the dynamic-control pair together? The latter also needs compatible PennyLane/Catalyst pins and nightlies: mixing the old and new control-value contracts breaks even static callable controls.

The matching local implementations pass 20 targeted PennyLane tests, 21 Catalyst tests, and the SSA FileCheck. The two decomposition PRs are separate.

Codex-assisted coordination proposal; requesting merge order, not code review.

@astralcai
astralcai enabled auto-merge October 20, 2026 21:02
@astralcai
astralcai added this pull request to the merge queue Oct 20, 2026
Merged via the queue into main with commit 956370f Oct 20, 2026
54 checks passed
@astralcai
astralcai deleted the ctrl-transform-work-wire-type branch October 20, 2026 21:26
astralcai added a commit to PennyLaneAI/catalyst that referenced this pull request Oct 21, 2026
**Context:**

Follow-up to PennyLaneAI/pennylane#10355, adds
`work_wire_type` to 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]

---------

Co-authored-by: Mudit Pandey <18223836+mudit2812@users.noreply.github.com>
Co-authored-by: Andrija Paurevic <46359773+andrijapau@users.noreply.github.com>
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.

2 participants