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’sissue-fixesseries, 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, tagv0.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, |
Yes |
Part A at |
Not recorded |
Tensor network, |
Yes |
The same run |
Not recorded |
Generated page, |
Yes, generated at |
Its own run is recorded (section 3) |
Not recorded |
Guide, |
Yes |
Tested on the nine tasks this branch’s changes bear on, before its edits and as it stands after them, judged on |
Not recorded |
Published benchmark tables |
Yes |
Every published sweep measured again at |
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 |
|---|---|---|---|---|---|
|
committed 2026-11-14 |
RTX 5090, CUDA-Q 0.16.0, torch 2.12.0+cu130 |
|
125 checks, 22 refusals, 7 probes, 3 child runs and 7 tripwires, none failed; stored in |
Every script under |
|
run 2026-11-27 |
RTX 5090, CUDA-Q 0.16.0, torch 2.12.0+cu130 |
The 14 scripts of procedure.md §A4, |
Pass: every script exited 0, none skipped or stopped early, |
|
|
run 2026-11-27 |
RTX 5090, CUDA-Q 0.16.0, torch 2.12.0+cu130 |
The 14 scripts of procedure.md §A4, |
Pass: every script exited 0, none skipped or stopped early, |
|
|
run 2026-12-01 |
RTX 5090, CUDA-Q 0.16.0, torch 2.12.0+cu130 |
The 14 scripts of procedure.md §A4, |
Pass: every script exited 0, none skipped or stopped early, |
|
|
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; |
Pass: every script exited 0, none was skipped or stopped early, and |
Nothing |
|
run 2026-12-02 |
RTX 5090, CUDA-Q 0.16.0, torch 2.12.0+cu130 |
|
126 checks, 22 refusals, 7 probes, 3 child runs and 7 tripwires, none failed; stored in |
Every script under |
|
run 2026-12-03 |
RTX 5090, CUDA-Q 0.16.0, torch 2.12.0+cu130 |
The 14 scripts of procedure.md §A4, |
Pass: every script exited 0, none was skipped or stopped early, and |
|
|
run 2026-12-03 |
RTX 5090, CUDA-Q 0.16.0, torch 2.12.0+cu130 |
The 14 scripts of procedure.md §A4, |
Pass: every script exited 0, none was skipped or stopped early, and |
|
|
run 2026-12-03 |
RTX 5090, CUDA-Q 0.16.0, torch 2.12.0+cu130 |
The 14 scripts of procedure.md §A4, |
Pass: every script exited 0, none was skipped or stopped early, and |
|
|
run 2026-12-03 |
RTX 5090, CUDA-Q 0.16.0, torch 2.12.0+cu130 |
The 14 scripts of procedure.md §A4, |
Pass: every script exited 0, none was skipped or stopped early, and |
|
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
cuqmlat 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.sampleon 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 ownAttributeError(“‘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
intorboolparameter 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
bb8a2d4does 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 abreak, acontinueor areturn, or after areturna 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, asangles = [t for t in theta], read past its end, is not judged either:observe_batch,get_state_batchandsample_batchanswer it on both targets at both precisions,TorchLayerrefuses it with aValueErrorof its own, that the kernel never readstheta[1], and known-limits.md’s list does not name it (found whenbb8a2d4was 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]forjinrange(i, i + 3)insiderange(60), read past the list’s end, is refused by theIndexErroron both targets at both precisions. Left unjudged are such a loop whose number of passes moves, asrange(i + 1), and one of 50 passes or more, asrange(i, i + 50)(found whenbb8a2d4was 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 theIndexErroron both targets at both precisions, wherecudaq.observeends the process with a segmentation fault at the first and raisesstd::bad_allocat the second (bb8a2d4’s message). No row ofverify/holds either:check_reads_past_a_listholds each of its cases to the premise thatcudaq.observeonqpp-cputakes the call, and here it does not (found whenbb8a2d4was reviewed; recorded only here).Two of the
IndexError’s messages. An empty list read attheta[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 whenbb8a2d4was reviewed; recorded only here).A captured
intpast 64 bits fails in MLIR’s ownTypeErroras 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 fixedintpast that range is refused by name since25298b3(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.pyfile, 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_batchwith 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 capturednp.float32in a computed angle’s arithmetic stays refused by name (api.md, line 316). At fp64,np.float32of a function’s value, such asnp.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)._buildlifts 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 capturednp.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 over2**22rows (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 of2**12to2**26amplitudes, 0.99 and 1.26 on 4 qubits over2**20rows, 1.14 and 1.19 on 2 qubits over2**22rows, and 0.90 and 0.94 on one state of2**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.observeoncuqml, 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) listscudaq.observeoncuqmlas supported, with no exception.Memory past the guard at one qubit. At fp32,
get_state_batchof a kernel that measures peaked at 4.12 states,sample_batchwith no collapse at 4.00 andsample_batchof a kernel that resets at 4.62, wherememory.GET_STATEandmemory.SAMPLEbudget 3. The last is past what the guard’s headroom covers, 3 overmemory.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 at2**24rows on the collapse commits as first built, and not measured again since.An empty batch given to
cuqml-tensornet’ssample_batchof a kernel with no reset, or toobserve_batchwithshots_count > 0on 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, whichverify/angles.pyholds refused (lines 8135 and 8147), a re-uploading layer round a controlledx’s target and a QAOA layer whoserzstands before and after its qubit controls anx; then constants after an argument’s rotation, or past az; triples across a gate CUDA-Q merges nothing across, such as a doubly controlledxwith its controls permuted, a controlledhor aczpair; 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 anrxbeside controlledexp_paulis; a choice stored beside a branch on a number a called kernel returns; anexp_pauliundercudaq.controlwhose 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, byobserve_batchand byTorchLayerwith observables, whatever it changes, wherecudaq.observecollapses the state call by call or, where nothing it returns changes, answers one value; and, wherecudaq.get_statereturns one state for such a kernel, its gradient and itscuqml-tensornetstate.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 besidecudaq.observeanswering it (its message). The rest of what it left undone, above, was refused before the series too, when every argument but alist[float]or afloatwas.Kept from before the series: on
cuqml,rx,ry,rz,r1andu3at an argument’s angle under five or more controls, whichcuqml-tensornetruns (c460b85); a loop CUDA-Q cannot count beside a computed angle (c097de0); arithmetic in a called kernel or beside a call, andU(a),U(b)undone on float arguments where their rotations meet (e9346ae); a captured list, NumPy array,np.float32, tuple, dataclass orcomplexin 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
6bbaee1adds. 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
bb8a2d4adds 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 firstobserve_batchat 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,c2e68d0andc460b85timed theirs on a GPU shared with other processes, the last two on a tree without the series’ commits before them;64ead89,00af320,be4d12eand676d383timed theirs built on an earlier form of6bbaee1, not on their own base.64ead89names as untimed a test its reading makes on that base (cuqml/_ir.py:1414), ande9346aedid not time apart the lift’s extra pass for a call.00af320andf928efegive 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 before6bbaee1and onb04ee2aanda25f872, 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.
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_prebuiltimportscuqml._C, which nothing builds.cuqml/cute/ops.py:377: the parametergate_typeis accepted and not used.cuqml/core/autograd.py:337: the parameterparamsof_compute_rzz_gradis accepted and not used. Its one call passes it by position, fourth of five (:1702-1703).cuqml/core/autograd.py:1037: the parametern_qubitsof_use_cute_mega_sweepis accepted and not used. Its one call passes it (:1426).cuqml/core/compiler.py:45and:47:_CUTE_AVAILABLEis set and never read;:47is the whole body of theexcept ImportErroraround the kernels’ import (:26-47). The onecuqml/core/autograd.pysets at:54and:56is read (:1045,:1080).cuqml/core/autograd.py:531and:799:MeasurementSpecand_accum_pauli_singleare reached only whenexecuteis called directly. The public calls pass Pauli strings;verify/gradients.pycalls 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:68and:1279,cuqml/core/compiler.py:196,cuqml/core/kernels/mega_backward.py:9,cuqml/cute/ops.py:871and: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 takeskind="cphase"(cuqml/cute/ops.py:828-845), which no caller passes and no script checks;verify/parity.py:229-230checks the forward kernel only.Two ops hold a rotation under a control at a row’s angle.
MultiControlledRotationOp(cuqml/core/compiler.py:168), whichc460b85added for a rotation under controls, stands besideTwoQubitParamGateOp, whichcrx,cryandcrzstill 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-34covers one of the four builds.verify/build_check.py:71-76compares 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.pyandverify/angles.pymost 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 aTorchLayerby 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.pyruns 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.bb8a2d4against01f45cethere, 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 changecuqml/betweenb75d836, which measured those tables, and01f45cemade it, this A/B does not separate.benchmarks/README.md:886says a slowtensornetcall is timed once “rather than twenty times”, where_bench.timedwith--iters 3makes five trials of three warm-up and three timed calls.:1011says 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.csvand 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 adefault.qubittape 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:24pins pytest “for the test suite” andpyproject.toml:22requires it. There is no test suite.pyproject.toml:11asks fortorch>=2.0; the kernels build against torch 2.12’s headers (cuqml/cute/ops.py:280).CLAUDE.md/AGENTS.mdare 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 since0101939the page cites known-limits.md, which records them (lines 110-135).c097de0’s “the two after it” ande9346ae’s “Commits 4, 5 and 6” count by the order before0af8474was put in at 6: the three they say revert last first arec097de0,e9346aeand6bbaee1, 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 capturednp.float32(recorded only here).procedure.md writes
2**25and2**23bare in §A4’s row forverify/equivalence.py(line 81), and api.md-2**63to2**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.mdrecords the 2026-12 rounds on the nine tasks this branch’s changes bear on, the edited round’s writers givenSKILL.mdas it stands, whole. Its other sixteen positive tasks were last run with an earlier text on8fd4077’s engine, and its three negative cases andevals/config.ymlhave never been run, as it andevals/EVAL.mdsay. The verdicts’ proposals to widen three cases,b07,n2ands8, to forms they found right are not taken intoevals/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 inBENCHMARK.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 reassigninglayer.argsbetween forwards, which the skill does not invite.SKILL.md’s frontmatter lists read-only tools (line 7), andevals/config.ymlsays the skill needs no setup (lines 14-15). Its Set up section gives commands to run.SKILL.mdstill callsREADME.mdthe reference (line 24); the reference is nowdocs/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 anintor 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 leaveSKILL.mdother than the text the edited round tested, whichBENCHMARK.mdsays it is, byte for byte, outside the two parts it names.evals/evals.json’s teleportation ground truth (line 125) says thatobserve_batch, “likecudaq.observe”, refuses any kernel that containsmz. Since676d383the two differ where a called kernel’smzruns; 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-fedexp_pauli, is answered since6bbaee1where 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 withcudaq.make_kernel, the known wrong answer, kernels CUDA-Q answers that are refused and fp32 sampling on a wide state vector; since0101939its 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=since0101939, 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 citesverify/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 byobserve_batchwherecudaq.observeanswers it, as the page’s section onobserve_batchsays.The generated page cites nine
README.mdsections that now point on todocs/api.mdorbenchmarks/README.md, in 20 citations: they resolve, and a reader follows the pointer. Citingdocs/api.mdinstead costs two characters a citation, and the template has 2 of its budget left (0101939’s message).
5. Next action
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, wherecudaq==0.16.0chose CUDA-Q’s CUDA 12 build; the kernels’ compiler chosen to match torch’s CUDA version, and named, where the host’s ownnvcconPATHwas taken; the NVQIR headers fetched in parallel, where 67 fetched one at a time took most of an 88.6 s first import.Decide what happens to the guide’s test files.
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 ascudaq.observepasses 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). Thecuqmltarget runs at fp64, selected withoption="fp64"(7290a90), and the sweeps with it (a2f870c). fp32 gradients repeat to the bit (edd9f98).get_state_batchrestores the phaser1andu3dropped (f0f8b5a). A batched angle that the state vector holds only in a fixed matrix is refused (2b42825).tensornet(564256d, 26 commits). Thecuqml-tensornettarget (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, againsttensornet(66cb4e9) and against cuTensorNet (d3e7cad). The design noteTENSORNET.mdwas 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 oncuqml-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_batchoncuqml-tensornetreturns a state whose chosen amplitudes are contracted (dc32a6a).TorchLayerreads 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 inmzorder, 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._dynamoaftercudaqraises anImportErrorwhere it aborted (8878581);a memory refusal is judged by one row, and
sample_batchruns 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.mdis reorganised: its API sections moved todocs/api.md, its benchmark summary tobenchmarks/README.md, its Verify section todocs/procedure.mdand its How it works section todocs/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 underdocs/:api.md,how-it-works.md,development.md,procedure.md,status.md,known-limits.md.skills/cuqml-guide/SKILL.mdgained Set up and Where to read more.CLAUDE.md/AGENTS.mdhave a new scope line and a closing pointer to the README’s table. Their working steps moved todocs/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,r1andu3take 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.adjointis 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_batchcollapses a qubit where the kernel measures it, ascudaq.get_statedoes (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]andfloatare 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 atbb8a2d4(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 bycudaq.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 asargs=(...)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
IndexErrorthat 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 ascudaq.get_stateruns it, the loop it runs shared withsample_batch, its check a chi-squared test, and aresetinget_state_batchstays 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:
d1feb61follows 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;c460b85read 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.
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 aCUTLASS_PATHcheckout,__sincosfand a pre-builtcuqml._C. CUTLASS comes from pip,csrc/precision.cuh:42-52replaced__sincosf, and nothing buildscuqml._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-231andcuqml/_bridge.py:611-613: say the probabilities are fused into the sampling kernel.sampling.py:199computes them as a tensor first.cuqml/core/compiler.py:460: citesapply_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 throughcute_fused_cnot_chain(compiler.py:847).cuqml/core/compiler.py:75-80: lists fivegate_typeaccess 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, andsample_batchtakes 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:184andcuqml/_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 plugincsrc/nvqir_cuqml.cpp. It iscuqml/cute/nvqir_cuqml.cpp.cuqml/cute/ops.py:469-470: says to gate the fused sweep onn_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).