Control lowering does not support quantum functions

Open
#3,384 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@rahulsjha is already working on this.

Since Nov 21, 2026.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
compilers

Research direction

Read the control-lowering behavior described in the issue and the referenced pull request #3330, then trace how calls inside quantum.ctrl regions are handled. Check the gridsynth path for calls that take or return qubits and identify how controlled operations can be decomposed before function calls are introduced. Done means control lowering supports the relevant quantum functions without dropping control or raising the reported error.

Written by the indexing model from the issue text.

Description

Detected in https://github.com/PennyLaneAI/catalyst/pull/3330:

The control lowering used to clone function calls inside quantum.ctrl regions as classical ops, which dropped the control on the callee. It now raises cannot control a function call inside a quantum.ctrl region; decompose the controlled operations before passes that introduce function calls, such as gridsynth for calls that take or return qubits.

Dominant language
Python
Stars
234
Forks
84
Avg merge
3d 11h
Merged PRs (30d)
78

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PennyLaneAI/catalyst

All issues in PennyLaneAI/catalyst

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.