Status

Where development stands, for whoever picks it up next. Read it before starting; bring it up to date before stopping (development.md §6). Last brought up to date on 2026-12-03.

1. Baseline

  • Branch from: main. Its first commit, bf5393a, imported as files the source repository’s issue-fixes series, which section 6 lists: sixteen commits that change code, which fix the six issues of the reviewer’s report of 2026-11 and what fixing them found, add one capability, fixed arguments, and delete five pieces of unused code, four of them listed in this file and the fifth in the report; then the guide, the generated page and the published tables brought up to date, and this file. The commits section 6 and section 3 cite are that repository’s, and are not in this one’s history.

  • Released: 04f0bfc, tag v0.1.0, cuqml 0.1.0 on PyPI.

2. State

Implemented means the change is made. Verified means the checks were run on that commit and the run is recorded in section 3. Accepted means the human approved it.

Area

Implemented

Verified

Accepted

State vector, cuqml, fp32 and fp64

Yes

Part A at 53385b0, whose cuqml/ and verify/ the commit after bf5393a holds unchanged: Pass (section 3)

Not recorded

Tensor network, cuqml-tensornet, fp32 and fp64

Yes

The same run

Not recorded

Generated page, docs/cuqml-beside-cudaq.md

Yes, generated at 0101939

Its own run is recorded (section 3)

Not recorded

Guide, skills/cuqml-guide/SKILL.md

Yes

Tested on the nine tasks this branch’s changes bear on, before its edits and as it stands after them, judged on f928efe’s engine; its scripts print the same lines on bb8a2d4’s, warnings aside (BENCHMARK.md, 1655e24). Its other sixteen positive tasks were last run with an earlier text, its three negative cases never

Not recorded

Published benchmark tables

Yes

Every published sweep measured again at bb8a2d4624d8003dfc16c7e1035eba686643623a, on RTX 5090, CUDA-Q 0.16.0, torch 2.12.0+cu130, 2026-12-02: every cell comparing cuqml with CUDA-Q or cuTensorNet agreed within its sweep’s bar; the 10 that printed MISMATCH are PennyLane’s against CUDA-Q at fp64, in hybrid_batch_sweep_fp64 and hybrid_qubit_sweep_fp64. PennyLane’s install line for hybrid_sweep.py now pulls custatevec-cu12 1.15.1, which the re-run used and benchmarks/README.md now names in place of 1.15.0

Not recorded

Every change in section 6 is on main, imported as files in bf5393a.

3. Verification runs

One row per run, added as procedure.md §A6 says.

Commit

Date

Machine

Ran

Result

Not run

4525444e013ae6bdc543c13a06332d0ab6fc9774

committed 2026-11-14

RTX 5090, CUDA-Q 0.16.0, torch 2.12.0+cu130

docs/src/sample.py

125 checks, 22 refusals, 7 probes, 3 child runs and 7 tripwires, none failed; stored in docs/src/run.json

Every script under verify/

b04ee2aaff9a70e11986e085c1ec0e84b78a04b2, an earlier form of 6bbaee1 (below)

run 2026-11-27

RTX 5090, CUDA-Q 0.16.0, torch 2.12.0+cu130

The 14 scripts of procedure.md §A4, build_check.py first, each in a container of its own of the project image; verify/qkan/cuqml_solver.py in the image verify/qkan/Dockerfile builds, on CUDA-Q 0.16.0 from its wheel, torch 2.13.0+cu132 and qkan 0.2.3

Pass: every script exited 0, none skipped or stopped early, git status clean before and after each; 3350 rows ok and none failed, 2425 of them angles.py’s; measure.py a timing. QKAN exited 0: its 6 solver cases, the layer and the fit agree, 8 rows ok

docs/src/sample.py, the generated page’s run, which sits beside the set

a25f872bb457cb27a9fa8f7a10c9307db6daf0c7, the last form of 6bbaee1 before this branch (below)

run 2026-11-27

RTX 5090, CUDA-Q 0.16.0, torch 2.12.0+cu130

The 14 scripts of procedure.md §A4, build_check.py first, each in a container of its own of the project image; verify/qkan/cuqml_solver.py in the image verify/qkan/Dockerfile builds, on CUDA-Q 0.16.0 from its wheel, torch 2.13.0+cu132 and qkan 0.2.3

Pass: every script exited 0, none skipped or stopped early, git status clean before and after each; 3350 rows ok and none failed, 2425 of them angles.py’s; measure.py a timing. tensornet.py ran three times, each exiting 0, and both outputs kept have 313 rows ok. QKAN exited 0: its 6 solver cases, the layer and the fit agree, 8 rows ok

docs/src/sample.py, the generated page’s run, which sits beside the set

f928efee6759bbe2ea5232e1ce1efacaea628b1a

run 2026-12-01

RTX 5090, CUDA-Q 0.16.0, torch 2.12.0+cu130

The 14 scripts of procedure.md §A4, build_check.py first, each in a container of its own of the project image; verify/qkan/cuqml_solver.py in the image verify/qkan/Dockerfile builds, on CUDA-Q 0.16.0 from its wheel, torch 2.13.0+cu132 and qkan 0.2.3

Pass: every script exited 0, none skipped or stopped early, git status clean before and after each; 4179 rows, 4172 ok and none failed, the other 7 judging nothing (measure.py’s 6 timings, and gate_support.py’s mid-circuit measurement, which qpp-cpu refuses too). QKAN exited 0: its 6 solver cases, the layer and the fit agree, 8 rows ok

docs/src/sample.py, the generated page’s run, which sits beside the set

bb8a2d4624d8003dfc16c7e1035eba686643623a

committed and run 2026-12-02

RTX 5090, CUDA-Q 0.16.0, torch 2.12.0+cu130

The 14 scripts of procedure.md §A4, each in a container of its own from the project image; verify/qkan/cuqml_solver.py in the image verify/qkan/Dockerfile builds (CUDA-Q 0.16.0 from its wheel, torch 2.13.0+cu132, qkan 0.2.3)

Pass: every script exited 0, none was skipped or stopped early, and git status was clean before and after each. 4225 rows ok, 0 failed; 8 judge nothing (measure.py’s 6 timings, and gate_support.py’s 2 measurement rows, one only run and one n/a). QKAN: 8 rows ok, 0 failed

Nothing

010193914df48047eddbfe246b5f8c8453d1eedd

run 2026-12-02

RTX 5090, CUDA-Q 0.16.0, torch 2.12.0+cu130

docs/src/sample.py

126 checks, 22 refusals, 7 probes, 3 child runs and 7 tripwires, none failed; stored in docs/src/run.json

Every script under verify/: this commit’s code is bb8a2d4’s, whose run is above

9a6c2339518d875102c2486899bd43983cadd58a, a first form of 53385b0 (below)

run 2026-12-03

RTX 5090, CUDA-Q 0.16.0, torch 2.12.0+cu130

The 14 scripts of procedure.md §A4, build_check.py first, each in its own container of the project image after §A3’s setup: pip install -e ., then python -c "import cuqml", which built the targets and installed them into /opt/nvidia/cudaq with sudo -n. Also verify/qkan/cuqml_solver.py, in the image verify/qkan/Dockerfile builds (CUDA-Q 0.16.0 from its wheel, torch 2.13.0+cu132, qkan 0.2.3), after python3 -c "import cuqml"

Pass: every script exited 0, none was skipped or stopped early, and git status was clean before and after each. 4229 rows ok and 0 failed. 8 rows judge nothing: measure.py’s 6 timings, and gate_support.py’s 2 measurement rows, one only run and one n/a. All four of build_check.py’s target checks were judged, the unwritable-tree check included. QKAN: 8 rows ok, 0 failed

docs/src/sample.py, the generated page’s run, which sits beside the set

a5b13f9eaf01d9fe3f99c12c3dcf147f47f17071, a second form of 53385b0 (below)

run 2026-12-03

RTX 5090, CUDA-Q 0.16.0, torch 2.12.0+cu130

The 14 scripts of procedure.md §A4, build_check.py first, each in its own container of the project image; verify/qkan/cuqml_solver.py in the image verify/qkan/Dockerfile builds (CUDA-Q 0.16.0 from its wheel, torch 2.13.0+cu132, qkan 0.2.3)

Pass: every script exited 0, none was skipped or stopped early, and git status was clean before and after each. 4230 rows ok, 0 failed; 8 judge nothing (measure.py’s 6 timings, and gate_support.py’s 2 measurement rows: one only run, one n/a). build_check.py: the kernel ran, and its target checks were 5 of 5 judged, all ok. QKAN: 8 rows ok, 0 failed

docs/src/sample.py, the generated page’s run, which sits beside the set

cd9f68b08aacab3f817e31056ea2918e62257aa2, a third form of 53385b0 (below)

run 2026-12-03

RTX 5090, CUDA-Q 0.16.0, torch 2.12.0+cu130

The 14 scripts of procedure.md §A4, build_check.py first, each in a container of its own from the project image; verify/qkan/cuqml_solver.py in the image verify/qkan/Dockerfile builds (CUDA-Q 0.16.0 from its wheel, torch 2.13.0+cu132, qkan 0.2.3)

Pass: every script exited 0, none was skipped or stopped early, and git status was clean before and after each. 4233 rows ok, 0 failed; 8 judge nothing (measure.py’s 6 timings, and gate_support.py’s 2 measurement rows, one only run and one n/a). build_check.py judged 8 of its 8 target checks, all ok. QKAN: 8 rows ok, 0 failed

docs/src/sample.py, the generated page’s run, which sits beside the set

53385b0220557ec5eb0f0fd9e04e43a39ff7d760

run 2026-12-03

RTX 5090, CUDA-Q 0.16.0, torch 2.12.0+cu130

The 14 scripts of procedure.md §A4, build_check.py first. Each ran in its own container of the project image, after §A3’s pip install -e . and python -c "import cuqml". verify/qkan/cuqml_solver.py ran in the image verify/qkan/Dockerfile builds (CUDA-Q 0.16.0 from its wheel, torch 2.13.0+cu132, qkan 0.2.3)

Pass: every script exited 0, none was skipped or stopped early, and git status was clean before and after each. 4233 rows ok, 0 failed. 8 judge nothing: measure.py’s 6 timings, and gate_support.py’s 2 measurement rows (one only run, one n/a). build_check.py judged 8 of its 8 target checks, all ok. QKAN: 8 rows ok, 0 failed

docs/src/sample.py, the generated page’s run, which sits beside the set. It was not asked for in this verification

b04ee2a and a25f872 are the last two forms of 6bbaee1, the fix of section 3.3 of the reviewer’s report, each verified by a fresh agent as it stood; neither is in this branch’s history. 6bbaee1’s tree is a25f872’s but for verify/angles.py, which holds the premise 0af8474 fixes and other comments, docstrings and printed labels; no file under cuqml/ differs. b04ee2a differs from a25f872 in cuqml/_ir.py and cuqml/_torch.py alone, where a25f872 reduced what the check costs a first call. bb8a2d4’s row counts gate_support.py’s mz row, printed alike in both runs, as judging nothing, where f928efe’s row and bb8a2d4’s message, 4226 rows ok, count it ok: the counters differ, not the results. What the other code commits’ messages say of their runs is their author’s: a claim, not a record. No run’s output is kept in the repository: these rows are the record.

53385b0, the commit that builds the CUDA-Q targets at the first import of cuqml, was squashed before anything was pushed, with the README, these rows and the documentation site, into the one commit that follows bf5393a, whose cuqml/ and verify/ are 53385b0’s, byte for byte. 9a6c233, a5b13f9 and cd9f68b are earlier forms of 53385b0, each amended after a review found gaps and each verified by a fresh agent as it stood. None of the four is in this repository’s history.

4. Open items

Line numbers are this branch’s tip’s, whose code is bb8a2d4’s. Where an item was measured or found on an earlier commit, it says which, or names the message it comes from.

Engine behaviour found before this series

Both were measured on the engine 01f45ce holds, in a private build, on an RTX PRO 4500, by tests that are not in verify/, and not measured again since.

  • Sampling on cuqml at fp32 loses accuracy as the state grows. On a product state, whose marginals are known exactly, the worst qubit’s sampled frequency was off by 0.2 to 0.3 percentage points at 23 and 24 qubits, by 1.6 to 1.7 at 25 and 26, and by 2.8 at 28, at one million shots. At fp64 every width from 20 to 28 stayed within about three standard errors. cudaq.sample on the target shows the same at 25 qubits. No script checks sampling at these widths. known-limits.md advises fp64 from 25 qubits.

  • The four batched calls fail on a kernel built with cudaq.make_kernel, with CUDA-Q’s own AttributeError (“‘signature’ is not supported on PyKernel”) in place of a refusal by name (CLAUDE.md/AGENTS.md §8). CUDA-Q’s own calls run such a kernel on both targets.

Engine behaviour this series leaves open

Where an item is recorded elsewhere, it says where.

  • A known wrong answer, and its cause. A kernel whose called kernel decides by an int or bool parameter whether rotations run, how often or on which qubit, where the side CUDA-Q takes sums constants to nothing into a rotation at an argument’s angle, is answered 1.2e-10 to 4.1e-10 from CUDA-Q at fp64 near 1e5 (6bbaee1’s message; known-limits.md, lines 136-155). The cause is two rules by which CUDA-Q evaluates what the reading, _ir.written, evaluates otherwise: it folds two booleans put in order as signed one-bit integers, true below false, and it wraps integer arithmetic past 64 bits. In this file’s judgement, refusing the kernels that meet either rule would be a small change of its own. By the human’s rule of 2026-11-26 the class was written down and not fixed, and it has not been put to the human again.

  • Reads outside a list that bb8a2d4 does not judge are answered as if the missing elements were about 0, or refused in other words, as before it: a read in a kernel the kernel calls; in a branch no number decides; in a loop CUDA-Q cannot count, or one that holds a break, a continue or a return, or after a return a branch takes; in a loop whose number of passes moves with the count of a loop of 50 passes or more; at an index computed from a loop’s count otherwise than as a multiple of it plus a number, or from the counts of two loops of 50 passes or more; at an index read from a list; and in an inner list of a captured list of lists (known-limits.md, lines 38-57). A list the kernel builds itself, as angles = [t for t in theta], read past its end, is not judged either: observe_batch, get_state_batch and sample_batch answer it on both targets at both precisions, TorchLayer refuses it with a ValueError of its own, that the kernel never reads theta[1], and known-limits.md’s list does not name it (found when bb8a2d4 was reviewed; recorded only here).

  • The bound by a loop’s count, and the unroll it replaced. In a loop of 50 passes or more, a read is held to the list by the loop’s passes, as the human chose on 2026-12-01, where the fix as first written unrolled every loop, at 24.19 and 24.92 ms more a build on the two kernels it was timed on (bb8a2d4’s message). By this file’s reasoning, not a measurement, the unroll would also have judged what the item above leaves out inside such a loop, an unrolled loop’s count being a number at every pass: a branch on its count, a loop whose number of passes moves with it, theta[i % 7], theta[50 * l + i]. If so, the bound judges fewer reads than the unroll would have, and a later commit could close the gap.

  • Three texts count as not judged a loop that the check judges. bb8a2d4’s message and known-limits.md (line 48) say a read is not judged in a loop whose start or bound moves with the count of a loop of 50 passes or more, and _ir.dependence’s docstring (cuqml/_ir.py:365) says it of one whose start or bound moves with another loop’s count. Such a loop is judged where its passes are fixed and fewer than 50, CUDA-Q’s passes unrolling it: theta[j] for j in range(i, i + 3) inside range(60), read past the list’s end, is refused by the IndexError on both targets at both precisions. Left unjudged are such a loop whose number of passes moves, as range(i + 1), and one of 50 passes or more, as range(i, i + 50) (found when bb8a2d4 was reviewed; recorded only here).

  • Two refusals no check holds. A read past the outer end of a captured list of lists, and one past the end of a list[cudaq.pauli_word], are refused by the IndexError on both targets at both precisions, where cudaq.observe ends the process with a segmentation fault at the first and raises std::bad_alloc at the second (bb8a2d4’s message). No row of verify/ holds either: check_reads_past_a_list holds each of its cases to the premise that cudaq.observe on qpp-cpu takes the call, and here it does not (found when bb8a2d4 was reviewed; recorded only here).

  • Two of the IndexError’s messages. An empty list read at theta[len(theta) - 1] is told to “Read at an index of 0 or more”, the remedy for a read before the start, though no index is inside it; a literal -1, which CUDA-Q reads as the same element, was not tried. A captured list’s refusal names “a list it captured from Python”, not the variable (found when bb8a2d4 was reviewed; recorded only here).

  • A captured int past 64 bits fails in MLIR’s own TypeError as it is written into the IR (cuqml/_ir.py:261), in no words of cuqml’s, from every batched call, as before the series. A fixed int past that range is refused by name since 25298b3 (its message).

  • A captured value that leaves a kernel no gate, such as a captured loop bound of 0 in a kernel with no fixed argument, still gets the message that blames recovering its source (cuqml/_torch.py:1852-1856), and api.md’s row for that message (line 333) says to define the kernel in a .py file, which does not help it. Beside fixed arguments the refusal names both (25298b3’s message).

  • From before the series, found by 6bbaee1 (its message): at fp32 a constant angle beyond fp32’s range gives NaN with no refusal; observe_batch with a spin operator on a qubit the kernel does not allocate raises “qubit out of range” in no words of cuqml’s.

  • Single precision (64ead89). A captured np.float32 in a computed angle’s arithmetic stays refused by name (api.md, line 316). At fp64, np.float32 of a function’s value, such as np.float32(np.sin(b)), is refused by name and answered at fp32 (known-limits.md, lines 156-165). The lift’s last check against capture’s probes holds a lifted angle to one part in a million at fp64 as at fp32 (_LIFT_TOL, cuqml/_torch.py:447, applied at :1289). _build lifts from the IR a slot the probes could not explain, whatever the IR makes of it (cuqml/_torch.py:2049-2053). In this file’s judgement, taking the captured np.float32, and refusing the kernel at such a slot instead, are each the human’s call, and tightening the check at fp64 would be a change of its own.

  • A computed sum that is one number at all three of capture’s probes is still filed as a constant, and, where nothing is read as negated, one that is a third argument’s value at both probes as that argument (e9346ae’s message).

  • Left undone by 25298b3, as its message lists them: folding a branch that a fixed or captured value takes beside a computed angle, which the human’s design answers of 2026-11-20 left for later; taking further types (the NumPy integer widths, np.float32, a dataclass, a tuple, nested lists, cudaq.State, a kernel), where those answers took only the types probed on CUDA-Q 0.16; and writing a fixed list’s elements into the IR, so that an element picking a qubit beside a computed angle, or arithmetic on one, is answered, where the design, which those answers left standing, writes in a list’s length alone. Each is refused by name now.

  • What a collapse costs (00af320). One reduction over both halves takes 1.23 to 1.28 times the time before at fp64 on large states, and 1.14 to 1.15 times at fp32 on 2 qubits over 2**22 rows (its message). A variant that reads the halves’ norms, torch.linalg.vector_norm, was timed beside it in one of the two runs the message draws on. There, against the collapse before, at fp32 and at fp64, the reduction took 1.01 to 1.05 and 1.25 to 1.28 times as long on states of 2**12 to 2**26 amplitudes, 0.99 and 1.26 on 4 qubits over 2**20 rows, 1.14 and 1.19 on 2 qubits over 2**22 rows, and 0.90 and 0.94 on one state of 2**10; the variant 0.64 to 0.79 and 0.77 to 0.82, 0.97 and 1.31, 1.43 and 1.37, and 1.08 and 1.06. On the large states the variant keeps no scratch the size of the state, where the reduction keeps half of one; on 2 qubits at fp32 it keeps 1.50 states of scratch, the reduction 1.31. It was not taken, the design decided being one reduction; weighing it is the human’s.

  • cudaq.observe on cuqml, of a kernel whose called kernel measures, raises in the plugin’s words, “cuqml target: initialising a simulation from user-provided state data is not supported yet” (676d383’s message), where api.md’s table of CUDA-Q’s own calls (line 818) lists cudaq.observe on cuqml as supported, with no exception.

  • Memory past the guard at one qubit. At fp32, get_state_batch of a kernel that measures peaked at 4.12 states, sample_batch with no collapse at 4.00 and sample_batch of a kernel that resets at 4.62, where memory.GET_STATE and memory.SAMPLE budget 3. The last is past what the guard’s headroom covers, 3 over memory.HEADROOM’s 0.70, 4.29, so a batch the guard admits whole can meet torch’s own out-of-memory error; none was driven to one, the GPU being shared. Measured at 2**24 rows on the collapse commits as first built, and not measured again since.

  • An empty batch given to cuqml-tensornet’s sample_batch of a kernel with no reset, or to observe_batch with shots_count > 0 on either target, raises torch’s own “max(): Expected reduction dim to be specified for input.numel() == 0”, where it should be answered or refused by name. Found on the collapse commits as first built; it predates them.

Decisions the human has not taken are marked “the human’s” above. Two more stay open from the commit messages: whether to spare e9346ae’s third capture on a sweep that binds a captured number anew at every call, and the cheaper reading of captured variables that d1feb61 left for later, comparing them as Python holds them before asking CUDA-Q’s resolver.

Kernels CUDA-Q answers that this series refuses

Each is refused by name. Each commit’s message lists its own, and api.md and known-limits.md say which.

  • 6bbaee1, where the angles CUDA-Q hands over cannot be lined up with the written ones for certain (known-limits.md, lines 110-135): first, two plausible layers, which verify/angles.py holds refused (lines 8135 and 8147), a re-uploading layer round a controlled x’s target and a QAOA layer whose rz stands before and after its qubit controls an x; then constants after an argument’s rotation, or past a z; triples across a gate CUDA-Q merges nothing across, such as a doubly controlled x with its controls permuted, a controlled h or a cz pair; constants across whole turns of another gate; a rotation and its adjoint at an argument’s angle before another; triples on a register after a called kernel’s ancilla; constants summed into an rx beside controlled exp_paulis; a choice stored beside a branch on a number a called kernel returns; an exp_pauli under cudaq.control whose hidden sum leaves the answer inside the bar; the sine of nothing written before an input’s rotation; an ancilla a called kernel prepares by two rotations CUDA-Q merges; a branch on two booleans of a captured value put in order; and 2 of 2,400 randomly generated kernels at fp64.

  • 64ead89: at fp64, a rounding to single precision of a value computed through a function other than +, -, *, /, sqrt, a sign, a magnitude, the larger or the smaller of two. fp32 answers it.

  • 676d383: a called kernel’s measurement that runs, by observe_batch and by TorchLayer with observables, whatever it changes, where cudaq.observe collapses the state call by call or, where nothing it returns changes, answers one value; and, where cudaq.get_state returns one state for such a kernel, its gradient and its cuqml-tensornet state.

  • 25298b3: fixed values that leave the kernel no gate, and a branch that a fixed or captured value takes beside a computed angle, each held refused beside cudaq.observe answering it (its message). The rest of what it left undone, above, was refused before the series too, when every argument but a list[float] or a float was.

  • Kept from before the series: on cuqml, rx, ry, rz, r1 and u3 at an argument’s angle under five or more controls, which cuqml-tensornet runs (c460b85); a loop CUDA-Q cannot count beside a computed angle (c097de0); arithmetic in a called kernel or beside a call, and U(a), U(b) undone on float arguments where their rotations meet (e9346ae); a captured list, NumPy array, np.float32, tuple, dataclass or complex in a computed angle’s arithmetic (d1feb61).

A read outside a list, which bb8a2d4 refuses, is not among them: CUDA-Q reads whatever lies past the list there, and has no answer to hold one to. Nor is theta[flag], a fixed bool used as an index, which bb8a2d4 refuses at True as a read before the list’s start: CUDA-Q’s passes widen the bool by its sign to -1, and cudaq.observe on qpp-cpu and nvidia reads element -1 too, giving 1.0 in 4 calls of 4 where theta[1] gives 0.4536 (bb8a2d4’s message). 25298b3’s message counted it among kernels cudaq.observe answers.

First-call costs

  • The check 6bbaee1 adds. On the kernels it reads, a first batched call took a mean of +1.17 ms over 11 timings, from -0.03 to +2.83 ms, 10 of them slower and none outside the spread of the engine before it, against first calls of 25 to 162 ms; on 26 timings of kernels it does not read, a mean of -0.06 ms. Timed at fp32, batch 64, on an idle GPU (its message). Asked on 2026-11-27 to accept it, the human had it reduced first, and accepted what remains on 2026-11-30.

  • The check bb8a2d4 adds grows with the reads it follows: 1.37 to 1.91 us a read on _ir.dependence, between a 12-qubit ansatz of 8 layers and one of 49. On the 49-layer ansatz, 588 reads, a whole first observe_batch at 64 rows took +0.910 to +1.012 ms on 36.74 to 36.87 ms; a later call reads no IR, and took 0.998 to 1.003 times the commit before’s (its message).

  • The other commits that change the engine give their cost in their messages, with these limits. d1feb61, c2e68d0 and c460b85 timed theirs on a GPU shared with other processes, the last two on a tree without the series’ commits before them; 64ead89, 00af320, be4d12e and 676d383 timed theirs built on an earlier form of 6bbaee1, not on their own base. 64ead89 names as untimed a test its reading makes on that base (cuqml/_ir.py:1414), and e9346ae did not time apart the lift’s extra pass for a call. 00af320 and f928efe give the generic case’s cost as none without a timing of it: a kernel that does not measure does not collapse, and no call ran what is deleted.

  • Costs from before the series, which Nsight Systems showed while 6bbaee1’s cost was being reduced, and which its message names and leaves as they were. On a 12-qubit kernel of 99 layers, a first call took 151.5 to 157.7 ms under Nsight Systems, the medians of eight runs on the engine before 6bbaee1 and on b04ee2a and a25f872, and 152.1 to 160.0 ms in eighteen runs without it. Of that:

    • _precompute_fused_bufs (cuqml/core/compiler.py:621) builds each fused layer’s buffer on the CPU, a torch call for each element: 63.6 to 66.1 ms;

    • the first forward moves each fused layer’s buffer and qubit list to the GPU one at a time, in synchronous copies from pageable memory (cuqml/core/compiler.py:832-833), and copies each qubit list back for its descriptor (cuqml/cute/ops.py:353): 41.5 to 41.9 ms; on another kernel of that shape, each first forward made 2,376 copies up and 1,188 back;

    • _PROGRAMS (cuqml/_torch.py:295) keeps every kernel’s program, about 5.3 MB of the process and one live MLIR module each, so a process that builds kernels afresh grows by that much a build.

Comments and docstrings that no longer match the code

Fixing these changes code files, so it is a change of its own, with its own verification run.

  • cuqml/cute/ops.py:1-24: the header describes a CUTLASS_PATH checkout, __sincosf and a pre-built cuqml._C. CUTLASS comes from pip, csrc/precision.cuh:42-52 replaced __sincosf, and nothing builds cuqml._C.

  • cuqml/cute/csrc/bindings.cu:1-5: says <torch/extension.h> is confined to this file. Six other sources include it.

  • cuqml/core/sampling.py:230-231 and cuqml/_bridge.py:611-613: say the probabilities are fused into the sampling kernel. sampling.py:199 computes them as a tensor first.

  • cuqml/core/compiler.py:460: cites apply_gate.py:584. That file has 60 lines.

  • cuqml/core/compiler.py:535-543: describes a swap kernel and a “~50x” gain. The layer runs through cute_fused_cnot_chain (compiler.py:847).

  • cuqml/core/compiler.py:75-80: lists five gate_type access patterns. The value is passed down and not used (cuqml/cute/ops.py:377).

  • cuqml/__init__.py:32: says “all three” cost one adjoint sweep. The lines above it list four calls, and sample_batch takes no gradient.

  • verify/gate_support.py:13: says the README table is a copy of its output. The README has no such table.

  • cuqml/cute/csrc/layout.cuh:27-28: says the kernels stride over the batch. Past 65,535 rows the host launches again from an offset (cuqml/cute/csrc/masked.cu:86-93).

  • cuqml/core/compiler.py:184 and cuqml/_bridge.py:141-143: say a CNOT layer is one fused launch, or a single pass. It is one launch per CNOT (cuqml/cute/csrc/masked.cu:118-128).

  • cuqml/_torch.py:101-102: says probe values are drawn once, at import. The generator is made at import; the values are drawn at each build (cuqml/_torch.py:393-398).

  • cuqml/_bridge.py:3: names the plugin csrc/nvqir_cuqml.cpp. It is cuqml/cute/nvqir_cuqml.cpp.

  • cuqml/cute/ops.py:469-470: says to gate the fused sweep on n_qubits >= 12. There is no such bound (cuqml/core/autograd.py:1037-1047).

  • cuqml/_ir.py:365: _ir.dependence’s docstring leaves unjudged a loop whose start or bound moves with another loop’s count. The check judges such a loop where its passes are fixed and fewer than 50 (Engine behaviour this series leaves open).

Code that is unused, or done twice

Removing or merging any of these is the human’s decision (CLAUDE.md/AGENTS.md §9), followed by a full verification run. The human decided, for f928efe, that six items of the reviewer’s report of 2026-11 stay listed, each needing care: the first five below, and the pytest pin under Repository.

  • cuqml/cute/ops.py:180: _load_prebuilt imports cuqml._C, which nothing builds.

  • cuqml/cute/ops.py:377: the parameter gate_type is accepted and not used.

  • cuqml/core/autograd.py:337: the parameter params of _compute_rzz_grad is accepted and not used. Its one call passes it by position, fourth of five (:1702-1703).

  • cuqml/core/autograd.py:1037: the parameter n_qubits of _use_cute_mega_sweep is accepted and not used. Its one call passes it (:1426).

  • cuqml/core/compiler.py:45 and :47: _CUTE_AVAILABLE is set and never read; :47 is the whole body of the except ImportError around the kernels’ import (:26-47). The one cuqml/core/autograd.py sets at :54 and :56 is read (:1045, :1080).

  • cuqml/core/autograd.py:531 and :799: MeasurementSpec and _accum_pauli_single are reached only when execute is called directly. The public calls pass Pauli strings; verify/gradients.py calls it directly.

  • Memory is sized by three rules: 70% of what is free or cached by torch (cuqml/core/memory.py:32), 75% of what is free (cuqml/core/compiler.py:743), and 40% of what is free over a multiplier of 4 (cuqml/core/autograd.py:618-619).

  • The code 0, 1, 2 for RX, RY, RZ is defined at least eight times: cuqml/core/autograd.py:68 and :1279, cuqml/core/compiler.py:196, cuqml/core/kernels/mega_backward.py:9, cuqml/cute/ops.py:871 and :872, cuqml/cute/csrc/rotation.cuh:13, cuqml/cute/csrc/cute_bwdsweep.cu:49. Several kernels compare with the bare numbers.

  • The CPHASE layer’s gradient exists twice. The sweep uses a torch loop (cuqml/core/autograd.py:91, called at :1721). The diagonal gradient kernel also takes kind="cphase" (cuqml/cute/ops.py:828-845), which no caller passes and no script checks; verify/parity.py:229-230 checks the forward kernel only.

  • Two ops hold a rotation under a control at a row’s angle. MultiControlledRotationOp (cuqml/core/compiler.py:168), which c460b85 added for a rotation under controls, stands beside TwoQubitParamGateOp, which crx, cry and crz still build (cuqml/core/circuit.py:217-233): c460b85’s message says they keep their own op, their general case.

Verification

  • The 14 scripts are run by hand. There is no runner and no CI, and no run’s output is kept in the repository.

  • verify/verify_backend_selection.py:32-34 covers one of the four builds.

  • verify/build_check.py:71-76 compares with a value written by hand.

  • Each acceptance bar is set inside its script, most as a constant at the top. procedure.md names them; no specification sets them.

  • Several checks reach into the engine’s private names, verify/gradients.py, verify/tensornet.py, verify/arguments.py and verify/angles.py most of all, so an internal rename can fail a check. procedure.md §A4’s Note column says where this series added such reads.

  • verify/tensornet.py’s row “fp64: grouped launches vs replay” failed once, in a first pass while other containers shared the GPU, its comparison without a gradient unequal; run again, it passed (676d383’s message). A call with no gradient runs its terms in runs that fit memory (the check’s docstring); this file reads that as letting the row depend on what else holds the GPU.

  • What the series’ checks do not reach, the commit messages say, most under Not to be assumed: among them a kernel linked from C++, whose path a stand-in holds (d1feb61); rotations under four controls at the launch limit’s seam, or in a TorchLayer by parameter shift (c460b85); a loop past 1,500 turns (c097de0); and the refusal of a called kernel’s measurement recorded at one of capture’s probes and not the other, which nothing reaches (676d383).

Benchmarks

  • No sweep writes the commit, the library versions or the date into its output; section 2 records the commit measured (procedure.md §B4).

  • The agreement bar differs between sweeps, and kernel_form_sweep.py runs at fp32 only (procedure.md §B3).

  • The first-call costs above are not in the state-vector tables: those sweeps time calls after three warm-up calls (procedure.md §B2).

  • The tensor-network tables’ earlier run, at b75d836, was on another host. 01f45ce, run on this branch’s machine, differs from its own published tables by a median of x1.07 in the one-layer qubit sweep’s gradient and x1.15 to x1.17 on one stream in the cuTensorNet sweeps. bb8a2d4 against 01f45ce there, four runs of each in turn, is x1.000 at the median of 172 cells, x0.995 to x1.019, with one outside the runs’ own spread. The series adds nothing to the shift. Whether the host or the 24 commits that change cuqml/ between b75d836, which measured those tables, and 01f45ce made it, this A/B does not separate.

  • benchmarks/README.md:886 says a slow tensornet call is timed once “rather than twenty times”, where _bench.timed with --iters 3 makes five trials of three warm-up and three timed calls. :1011 says the forward’s gap along cuTensorNet’s own plans is “as wide or wider in every cell”, where at fp64 the QAOA forward is 26.52x on its own plan and 27.12x on ours at n=12, and 38.67x and 40.20x at n=20 (cutensornet_qaoa_qubit_sweep_fp64.csv and its _ours). Both predate this branch; found when its re-run was reviewed, and recorded only here.

  • procedure.md §B2’s quiet rule watches the GPU alone. In this branch’s re-run, the first four state-vector sweeps ran while another process loaded the host, and CUDA-Q’s side was slowed; they were run again with the host’s 1-minute load under 1.0 before each sweep and other processes’ CPU under one core during it, as the sweeps’ commit says. Whether §B2 asks for a quiet host too is the human’s call.

  • benchmarks/hybrid_sweep.py:176, in _backprop_fits, judges a default.qubit tape against the host’s free memory without its page cache (SC_AVPHYS_PAGES), so at n=18 it declined a tape that would have fitted (benchmarks/README.md:1357). Reading the available memory instead is a change to the sweep, the human’s call, after which the two hybrid qubit sweeps would run again.

Repository

  • requirements.txt:24 pins pytest “for the test suite” and pyproject.toml:22 requires it. There is no test suite.

  • pyproject.toml:11 asks for torch>=2.0; the kernels build against torch 2.12’s headers (cuqml/cute/ops.py:280).

  • CLAUDE.md/AGENTS.md are one text in two files, kept identical by hand.

  • Commit messages cite a roadmap, items 01, 05 and 06, and pull requests by number, and this series’ cite the reviewer’s report of 2026-11 by section. None of them is in the repository.

  • Three of this series’ messages say of other commits what no longer holds, and stay as written. 6bbaee1’s says that a later commit brings the guide and the generated page up to date on the refusals it adds. The guide’s commit, 1655e24, leaves them out, none of its nine tasks meeting them, as its message says, and since 0101939 the page cites known-limits.md, which records them (lines 110-135). c097de0’s “the two after it” and e9346ae’s “Commits 4, 5 and 6” count by the order before 0af8474 was put in at 6: the three they say revert last first are c097de0, e9346ae and 6bbaee1, now 4, 5 and 7.

Documentation

  • api.md’s row for an argument of a type no batched call takes yet (line 328), among them np.float32, gives capturing the value from Python as the remedy, where line 316 refuses an angle computed from a captured np.float32 (recorded only here).

  • procedure.md writes 2**25 and 2**23 bare in §A4’s row for verify/equivalence.py (line 81), and api.md -2**63 to 2**63 - 1 (line 334): CommonMark renders what lies between each pair of asterisks bold, “25 and 2” and “63 to 2” (recorded only here).

  • known-limits.md (line 48) leaves unjudged a read in a loop whose start or bound moves with the count of a loop of 50 passes or more. The check judges such a loop where its passes are fixed and fewer than 50 (Engine behaviour this series leaves open).

Guide and generated page

  • skills/cuqml-guide/BENCHMARK.md records the 2026-12 rounds on the nine tasks this branch’s changes bear on, the edited round’s writers given SKILL.md as it stands, whole. Its other sixteen positive tasks were last run with an earlier text on 8fd4077’s engine, and its three negative cases and evals/config.yml have never been run, as it and evals/EVAL.md say. The verdicts’ proposals to widen three cases, b07, n2 and s8, to forms they found right are not taken into evals/evals.json (1655e24’s message).

  • What the edited round found unsaid in SKILL.md, none of it costing a script a right number, is listed in BENCHMARK.md › What the skill does not say. 1655e24’s message names two more things the skill leaves out: the refusals the series added beside a computed angle, which none of the nine tasks meets, and reassigning layer.args between forwards, which the skill does not invite.

  • SKILL.md’s frontmatter lists read-only tools (line 7), and evals/config.yml says the skill needs no setup (lines 14-15). Its Set up section gives commands to run.

  • SKILL.md still calls README.md the reference (line 24); the reference is now docs/api.md. 1655e24’s message names it among what that commit left out, as outside the series.

  • SKILL.md’s row for a tensor handed to an int or other fixed argument (line 97) gives one remedy, one plain value; api.md’s (line 329) also gives the one for a value per row, a call per value with the rows that share it (found when the guide’s commit was reviewed; recorded only here). Either edit, this one or the one above, would leave SKILL.md other than the text the edited round tested, which BENCHMARK.md says it is, byte for byte, outside the two parts it names.

  • evals/evals.json’s teleportation ground truth (line 125) says that observe_batch, “like cudaq.observe”, refuses any kernel that contains mz. Since 676d383 the two differ where a called kernel’s mz runs; the case’s own kernel measures in its own body, so its expectations stand.

  • The generated page lacks four rows and two keywords that the commit which added it names (fe5c7e0), and does not link the files in this folder. One of the four, an argument-fed exp_pauli, is answered since 6bbaee1 where its rotations line up, and refused in a kernel that calls another (api.md, line 319). Its section 2 has no row either for the limits known-limits.md records beyond it, among them a kernel built with cudaq.make_kernel, the known wrong answer, kernels CUDA-Q answers that are refused and fp32 sampling on a wide state vector; since 0101939 its preface says so, and cites that file (0101939’s message).

  • The page’s list of what its run does not exercise names a layer’s args= since 0101939, and neither the collapse nor a called kernel’s measurement, though no record of the run holds either to CUDA-Q: of a collapse it prints what came back and no more, and the page cites verify/ for both, in its sections 5 and 6 (0101939’s message).

  • The generated page holds “a measuring kernel’s refusal” identical to CUDA-Q’s (docs/src/template.md:28). That is true of a kernel that measures in its own body; one whose called kernel measures is refused by observe_batch where cudaq.observe answers it, as the page’s section on observe_batch says.

  • The generated page cites nine README.md sections that now point on to docs/api.md or benchmarks/README.md, in 20 citations: they resolve, and a reader follows the pointer. Citing docs/api.md instead costs two characters a citation, and the template has 2 of its budget left (0101939’s message).

5. Next action

  1. The 0.1.1 candidates that installing 0.1.0 from PyPI in a clean venv found, each on the human’s yes: README’s pip route naming cuda-quantum-cu13==0.16.0, where cudaq==0.16.0 chose CUDA-Q’s CUDA 12 build; the kernels’ compiler chosen to match torch’s CUDA version, and named, where the host’s own nvcc on PATH was taken; the NVQIR headers fetched in parallel, where 67 fetched one at a time took most of an 88.6 s first import.

  2. Decide what happens to the guide’s test files.

  3. Fix the comments listed above, as a change of its own with a verification run.

6. Changes since main, by branch

Oldest first. Each branch holds the one before it.

  • qkan-test (69cda74, 4 commits). A batch past 65,535 rows runs (3f2cc26). QKAN is checked on this backend (b4934ca).

  • batch-limits (ef85e89, 7 commits). The batched calls take a kernel’s arguments as cudaq.observe passes them (f847267). An angle computed from the arguments is lifted from the kernel’s IR into torch (3ea1b8a, abe7534). A fifth sweep, kernel_form_sweep.py (55a0fc6).

  • precision (2b42825, 16 commits). The cuqml target runs at fp64, selected with option="fp64" (7290a90), and the sweeps with it (a2f870c). fp32 gradients repeat to the bit (edd9f98). get_state_batch restores the phase r1 and u3 dropped (f0f8b5a). A batched angle that the state vector holds only in a fixed matrix is refused (2b42825).

  • tensornet (564256d, 26 commits). The cuqml-tensornet target (1d12eda): expectation values and gradients by contraction (c7dfde6), past 63 qubits (c0eafc1), sampling (5173fe3), replay of a repeated call (0291ce3), a reverse sweep of its own (a237c21). Four plugins are built side by side (b3e284c). Two sweeps measure it, against tensornet (66cb4e9) and against cuTensorNet (d3e7cad). The design note TENSORNET.md was folded into the README and deleted (3720248).

  • container (461cf66, 2 commits). CUDA-Q 0.16, with the NVQIR headers fetched where its wheel does not ship them (461cf66). Installing in a CUDA container of one’s own is documented (fb3c431).

  • review-fixes (0d707c7, 6 commits). Parameter shift on cuqml-tensornet (70b3fab).

  • bench-016 (30c7f25, 2 commits). Every benchmark measured again on CUDA-Q 0.16 (30c7f25).

  • tn-cute-tiling (b12558c, 6 commits). A tensor-network step that is a large matrix product runs in a tiled kernel (7a1349f), and independent steps are launched together (a566e64). The tensor-network tables were measured again (b75d836).

  • tn-amplitudes (726c617, 7 commits). get_state_batch on cuqml-tensornet returns a state whose chosen amplitudes are contracted (dc32a6a). TorchLayer reads amplitudes on either target (3219518). A basis state is read as bits and anything else is refused (80c754e).

  • engine-fixes (8fd4077, 17 commits). Behaviour that changed:

    • the adjoint gradient is carried through fixed gates under controls, where it had been wrong with nothing said (6294f02);

    • a kernel whose circuit follows an argument’s value is refused (21f43ae);

    • a noise model is refused on every batched call (be74887);

    • sample_batch(explicit_measurements=True) keys an outcome in mz order, or refuses (c294494);

    • a second derivative of the state vector’s gradient, and of parameter shift, is refused (434c57a), and so is forward-mode AD (7abdb1a);

    • import torch._dynamo after cudaq raises an ImportError where it aborted (8878581);

    • a memory refusal is judged by one row, and sample_batch runs in slices (dc7348b, 0f90962);

    • controls are taken in any order (1877e4a);

    • a CPU tensor, an array and a list of operators are refused at the boundary (be74887);

    • a kernel’s gates no longer run ahead of the next kernel (24f031e);

    • a run of more than 32 rotations on one wire is cut, not refused (8fd4077).

  • standalone-doc (fe5c7e0, 2 commits). docs/, with the generated page and what generates it.

  • agent-skill (8e6d1c3, 1 commit). skills/cuqml-guide/.

  • docs-restructure (01f45ce, 3 commits). Documentation only; no code changed. README.md is reorganised: its API sections moved to docs/api.md, its benchmark summary to benchmarks/README.md, its Verify section to docs/procedure.md and its How it works section to docs/how-it-works.md. That last one was rewritten with schematics and checked against the code, which corrected three things the old text had wrong: the backward sweep stores or recomputes the states it needs and does not undo gates, a CNOT layer is a launch per gate, and the three primitives are a given matrix, a rotation from its angle and a phase. New under docs/: api.md, how-it-works.md, development.md, procedure.md, status.md, known-limits.md. skills/cuqml-guide/SKILL.md gained Set up and Where to read more. CLAUDE.md/AGENTS.md have a new scope line and a closing pointer to the README’s table. Their working steps moved to docs/development.md, which they now point to: how a new folder is proposed, how a check is added or fixed, and when a clean-up is raised and re-verified. No rule changed in what it requires.

  • issue-fixes (this branch). The six issues of the reviewer’s report of 2026-11, its sections 3.1 to 3.6, and what fixing them found; one new capability, fixed arguments, which the human chose to add after the issue fixes; and five pieces of unused code, four of them listed in this file and the fifth in the report. Behaviour that changed:

    • a kernel’s captured Python variables are read again at every batched call, as CUDA-Q binds them (d1feb61);

    • a custom operation is taken by its matrix, whatever it is called, on both targets (c2e68d0);

    • on cuqml, rx, ry, rz, r1 and u3 take a row’s angle under up to four controls (c460b85);

    • any loop CUDA-Q can count runs beside an angle a kernel computes (c097de0);

    • a kernel that calls another and undoes it with cudaq.adjoint is answered (e9346ae);

    • a kernel CUDA-Q hands over in other gates than it writes is answered, its written angles lined up with the ones handed over, or refused by name (6bbaee1);

    • an angle a kernel rounds to single precision is rounded where CUDA-Q rounds it (64ead89);

    • a collapse weighs both outcomes (00af320); get_state_batch collapses a qubit where the kernel measures it, as cudaq.get_state does (be4d12e); and a called kernel’s measurement is read by what runs, collapsed for a state and refused by name for an expectation (676d383);

    • the new capability: arguments of other types than list[float] and float are taken as fixed, one value for every row, the circuit captured at it (25298b3);

    • a read outside a list a kernel is handed is refused by name, with an IndexError (bb8a2d4).

    Three commits change checks alone, each fixed in place with the reason beside it: a called kernel’s measurement premise taken at a quarter turn (0af8474), a rounded argument’s fp64 values held to fp64’s bar (4e21e52), and a collapse’s frequencies held to CUDA-Q’s by a seeded chi-squared test (c015f24). Five pieces of code nothing calls were deleted (f928efe). Then the guide was brought up to date and tested on nine tasks before and after (1655e24); the generated page’s sources were brought to the series, citing where the README’s sections went (0101939), and the page generated again (c6e4473); and every published sweep was measured again at bb8a2d4 (d43e8db).

    The human’s decisions, by date, and the commit each bears on; the words in quotation marks are the human’s own answers:

    • 2026-11-17: how a captured variable is read again, “do it later”, read as CUDA-Q’s resolver at every call, the cheaper comparison left for a later change (d1feb61); a bound on a loop’s length, “No limit” (c097de0); a kernel undone by cudaq.adjoint, “Accept a negated argument” (e9346ae); the written angles paired with the ones handed over by value, not the IR reduced by CUDA-Q’s launch passes (6bbaee1).

    • 2026-11-20: one more adversarial round on that pairing, under a rule fixed beforehand, that a silent wrong answer at ordinary sizes means refusing such kernels outright (6bbaee1); and the design of fixed arguments: a commit of their own after the issue fixes, only the types probed on CUDA-Q 0.16, TorchLayer’s given as args=(...) at construction, a clearer refusal of a branch beside a computed angle with folding it left for later, and the sweeps run again once, at the tip of the series, on a quiet GPU (25298b3).

    • 2026-11-21: “fix the problems”, keeping the outright refusal (6bbaee1).

    • 2026-11-26: “Self-check + 1 attack”, and a silent wrong answer that attack still found written down in known-limits.md, with no further round (6bbaee1).

    • 2026-11-27: “try to reduce the overhead by also investigating with nsight system”; on 2026-11-30 the first-call cost that remains was accepted (6bbaee1).

    • 2026-11-30: “Nine tasks, before+after”, for the guide (1655e24).

    • 2026-12-01: “Fix it, own commit”, after the clean-up; “Bound by the loop count”, for a read a long loop’s count indexes; and an IndexError that names the element and the list’s length (bb8a2d4, whose message puts the first two in its own words).

    • 2026-12-02: “Refuse both ends”: a read before a list’s start is refused as well (bb8a2d4).

    • Undated in their messages: the five pieces go, in a commit of their own, and the six items of unused code that need care stay listed (f928efe); a kernel that measures takes a second build, captured as cudaq.get_state runs it, the loop it runs shared with sample_batch, its check a chi-squared test, and a reset in get_state_batch stays refused (be4d12e); a called kernel’s measurement that runs is refused for an expectation, and the chain of kernels that reaches it is named (676d383).

    • Read, not asked: d1feb61 follows a captured number that changed, as CUDA-Q does, where the report left the human the choice of refusing the kernel instead, and that choice was not put to the human in those words; c460b85 read the request to fix the report’s issues as the human’s decision to build rotations under controls at all, which the report left to the human.