Skip to content

Reject multi-qubit arms under controlled(par) - #531

Merged
cursor[bot] merged 1 commit into
mainfrom
cursor/controlled-par-multiqubit-arm-6d39
Oct 1, 2026
Merged

cursor[bot] merged 1 commit into
mainfrom
cursor/controlled-par-multiqubit-arm-6d39

Conversation

@arniber21

Copy link
Copy Markdown
Owner

controlled(par { CNOT @(0, 1) }) @(0, (1, 2)) names three wires, so the typechecker accepted it and elaboration then stopped in controlled_named_gate (controlled() of a multi-qubit gate).

The checker now reports that same diagnostic for a multi-qubit gate in a par arm (par { … } and par { c } * k) before placement. Width-1 arms (H @0) are unchanged.

QASM and NA stay partial: there is still no test/lit OpenQASM fixture and no neutral-atom fixture. This does not finish the rest of the controlled-par gap.

Refs #369.

Open in Web Open in Cursor 

controlled(par { CNOT @(0, 1) }) @(0, (1, 2)) matched the wire count, so
the typechecker accepted it and elaboration then failed in
controlled_named_gate. Report that same diagnostic at typecheck.

Width-1 arms are unchanged. QASM and NA stay partial. Refs #369.

Co-authored-by: Arnab Ghosh <ag2583@cornell.edu>
@vercel

vercel Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
quon Ready Ready Preview Oct 1, 2026 7:36am UTC

@cursor

cursor Bot commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Approved. I would merge 46120431.

controlled(par { CNOT @(0, 1) }) @(0, (1, 2)) and controlled(par { CNOT @(0, 1) } * 2) fail in synth_controlled as ControlledMultiQubitGate, before a circuit type is produced. The message is elaboration is not implemented for controlled() of a multi-qubit gate``, the same text as controlled_named_gate's `ElabError`. Width-1 `H @0` arms are not flagged, and the lowering test for `@(0, (1, 2))`, `@(0, 1, 2)`, and `@(0, 1)` is unchanged. QASM and NA stay partial (`◐`). The body and commit say `Refs #369`.

Not merging.

@arniber21
arniber21 marked this pull request as ready for review October 1, 2026 07:39
@cursor
cursor Bot merged commit 7fd7eb6 into main Oct 1, 2026
21 of 22 checks passed

This branch was successfully deployed

1 active deployment
Preview — 46120431 Deployed Oct 1, 2026 by vercel[bot]
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