cudaq.draw raises IndexError (vector::_M_range_check) on kernels with mid-circuit measurement feedback
Maintainers usually reply within 1 day
@VaggelisGian is already working on this.
Since Aug 25, 2026.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 58/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- quantum-computing, tooling
Research direction
Start with the supplied cudaq.draw reproducer using the qpp-cpu target and inspect the drawing trace around mid-circuit measurement and classical feedback. Done means the reproducer produces a drawing or a clean documented error instead of the escaping C++ IndexError.
Written by the indexing model from the issue text.
Description
cudaq.draw crashes with a C++ IndexError on kernels containing mid-circuit measurement + classical feedback.
Reproducer (cudaq 0.15.1, PyPI wheels, qpp-cpu):
import cudaq
cudaq.set_target("qpp-cpu")
@cudaq.kernel
def erase_and(q: cudaq.qview):
h(q[2])
fired = mz(q[2])
if fired:
z.ctrl(q[0], q[1])
x(q[2])
@cudaq.kernel
def draw_me():
q = cudaq.qvector(3)
erase_and(q)
cudaq.draw(draw_me)
# IndexError: vector::_M_range_check: __n (which is 2) >= this->size() (which is 2)
Expected: a drawing (even one that renders the measurement and elides the classical branch), or a clean "cannot draw kernels with classical feedback" error. An IndexError escaping from the C++ layer suggests the trace walks a gate whose operands were registered inconsistently after the measurement.
Severity: crash, diagnostics-only impact — but it removes the most useful debugging tool exactly for the kernels that are hardest to debug.
- Dominant language
- C++
- Stars
- 1.2k
- Forks
- 508
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 100
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NVIDIA/cuda-quantum
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
NVIDIA/cuda-quantum#6035 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 77/100
NVIDIA/cuda-quantum#6034 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NVIDIA/cuda-quantum#6033 ·
Maintainers usually reply within 1 day
-
Point the CUDA-Q Pulse research preview docs to the released cudaq-pulse packagePossibly taken @fedonman claimed this 2 days ago. Open
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
NVIDIA/cuda-quantum#6031 ·
Maintainers usually reply within 1 day
-
Realtime fnv1a_hash sign-extends char, so a non-ASCII handler name gets a platform-dependent function idPossibly taken @fedonman claimed this 2 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
NVIDIA/cuda-quantum#6029 ·
Maintainers usually reply within 1 day
All issues in NVIDIA/cuda-quantum
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
Maintainers usually reply within 2 days
-
bug data-types
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
ClickHouse/clickhouse-cpp#645 ·
Maintainers usually reply within 1 day
-
bug compatibility difficulty:easy prio:normal
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NatronGitHub/openfx-misc#524 ·
Maintainers usually reply within 1 day
-
documentation enhancement help wanted P0
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Awesome-Embedded-Learning-Studio/Tutorial_AwesomeModernCPP#359 ·
Maintainers usually reply within 1 day
-
Type: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
openscad/openscad#7360 · 2 comments ·
Maintainers usually reply within 1 day