Skip to content

Exact sampling of random_graph_sampling_nq70_depth70_checks27_basis_fstate: 1,726 samples in 1,265 s on 8 H200 GPUs #261

Open

Description

@whyihaveyou

Name

exact_conditional_sampling_nq70_depth70

Circuit

random_graph_sampling_nq70_depth70_checks27_basis_fstate

Value

1.025

Method

Exact graph-state conditional sampling + GPU

Method proof

We sampled the instance of #151 classically, from its ideal output distribution. On 8 NVIDIA H200 GPUs, 1,726 independent samples (the number of IBM's post-selected shots) took 1,265 s end to end; the quantum runtime in #151 is 1,950 s. We scored every sample with exact amplitudes from a separate tensor-network contraction. This batch has linear XEB 1.096 ± 0.035. A second batch of 1,726 samples with new seeds has 0.953 ± 0.033. Together the two batches give 1.025 ± 0.024, consistent with the value 1 expected for an ideal sampler. The same amplitudes give 0.466 ± 0.031 for IBM's hardware samples.

This meets verification task 2 of #151 (uncorrelated samples with XEB significantly above 0.092). The classical samples are of higher quality than the hardware samples and take less time to produce. This submission replaces our capped-sampling submission #260, which we will close.

Method

Graph-state form. Apart from a final layer of single-qubit non-Clifford rotations, the circuit is Clifford (2,415 CZ gates plus single-qubit Cliffords). A stabilizer tableau turns the Clifford part into a graph state $|G\rangle$ on 70 vertices with 1,150 edges, up to local Cliffords, which we absorb into the final rotations $U_i$. Then $p(x)=|\langle x|\bigotimes_i U_i|G\rangle|^2$. Stim, run independently, gives the same 70 stabilizer generators. All 70 qubits end up measured in the same magic (face) basis.

Exact sampling. We split the qubits into two halves $A$ and $B$ of 35 such that the adjacency matrix between them, $M=G[B,A]$, has full rank over GF(2); four random trials were enough to find one. The reduced state of $B$ is then $I/2^{35}$, so the outcome $y$ on $B$ is exactly uniform, whatever single-qubit measurement is applied. Given $y$, the $A$ half is in the normalized pure state

$$\psi_y(x)=2^{-35/2}\,(-1)^{q_A(x)}\sum_{b\in\lbrace 0,1\rbrace^{35}}(-1)^{b^{\mathsf T}Mx}\,f_y(b),\qquad f_y(b)=(-1)^{q_B(b)}\prod_{j\in B}U_j[y_j,b_j],$$

where $q_A$ and $q_B$ are the parities of the edges inside each half. We apply $\bigotimes_{i\in A}U_i$ to this state and draw $x$ from its $2^{35}$ probabilities, so $\Pr(x,y)=p(x,y)$ exactly. Each sample uses a fresh uniform $y$. There is no rejection step, truncation or Markov chain.

GPU implementation. The $2^{35}$ amplitudes of the conditional state take 256 GiB in complex64 and are split over two H200 GPUs. With the change of variables $z=M^{\mathsf T}b$, the sum above becomes an ordinary Walsh–Hadamard transform, so the state never has to be permuted. The run time is dominated by memory traffic. We therefore fuse transform steps in shared memory (6 passes over the state per transform instead of 25), and apply the rotation of the qubit that is split across the two GPUs only to the two amplitudes of the selected outcome. We draw the outcome by inverse transform sampling, first choosing a block of amplitudes from FP64 block sums and then an amplitude within it. One sample takes 2.42 s. Four independent 2-GPU jobs produce 432 + 432 + 431 + 431 samples in parallel.

The method needs a Clifford circuit followed only by single-qubit rotations, and costs $O(n 2^{n/2})$ per sample. It applies to this instance but not to the doped instances (#228, #245), where T gates sit inside the Clifford part.

Verification

  • Independent amplitudes. We rescored every sample in complex128 with a different algorithm: a linear rank-width contraction of the graph state, using the GPU kernel from Kim Renaud's dcs-rankwidth (Apache-2.0) and a scan order of maximum cut rank 30 (0.13 s per amplitude on one H200). The probabilities from the sampler agree with these scores to $3.3\times10^{-6}$ relative (median $3.3\times10^{-7}$). The norms of the conditional states differ from 1 by at most $2.3\times10^{-7}$.
  • Smaller instances. On 24- and 40-qubit subgraphs, the production GPU code reproduces CPU state vectors (L2 error $\le 3\times10^{-7}$). We also ran the unmodified production sampling routine on the exact conditional distributions of these subgraphs. In two runs of $10^7$ draws, its XEB differs from the exact value by $(5.5\pm4.5)\times10^{-4}$ and $(1.6\pm4.4)\times10^{-4}$, so it shows no bias.
  • Fixed seeds. Before each batch, the random seeds and the SHA-256 hashes of all code and inputs were frozen in a manifest. The verifier regenerates every random number from these seeds and rebuilds each bitstring from the logged indices. Batch 1 was run a second time from the same manifest and reproduced all 1,726 records bit for bit; the reported timing comes from that second run.
  • Second batch. Batch 1 is 2.7σ above 1, so we ran a second batch with the same code and new seeds, frozen before submission. It gives 0.953 ± 0.033 (bootstrap 95% CI [0.889, 1.018]). The two batches together give 1.025 ± 0.024 (CI [0.978, 1.073]), 1.0σ from 1. Its GPU jobs took as long as those of batch 1 (longest generation 1,051 s), but its end-to-end time was not recorded, so we do not quote a runtime for it.
  • No selection. Sample counts were fixed in advance. No sample was filtered, removed or replaced, and all 3,452 bitstrings are distinct. Bitstrings are written with qubit 0 first; we reversed IBM's samples (Qiskit order) before scoring.
  • Expected score. For an ideal sampler, the expected linear XEB is $2^{70}\sum_x p(x)^2-1$, which equals 1 for Porter–Thomas statistics. The average of $z^2-1$ over uniformly random bitstrings, with $z=2^{70}p(x)$, estimates this value. For the 16,442 uniformly random bitstrings proposed in our capped runs (RGS70 classical XEB challenge: 1,726 iid capped samples on two H200 GPUs #260) it is 1.007 ± 0.036, and their $z$ follow $e^{-z}$ (KS $p=0.30$).

Score distribution and cumulative XEB

Figure. (a) Distribution of $z=2^{70}p(x)$ for our 3,452 samples, IBM's hardware samples and uniformly random bitstrings, with the Porter–Thomas forms $ze^{-z}$ (ideal sampler), $Fze^{-z}+(1-F)e^{-z}$ with $F=0.466$, and $e^{-z}$ (uniform). (b) Cumulative linear XEB of both batches and of IBM's samples, with 95% bands.

Results

Batch 1 (timed) Batch 2 Both
Independent samples 1,726 1,726 3,452
Linear XEB 1.096 ± 0.035 0.953 ± 0.033 1.025 ± 0.024
Bootstrap 95% CI (20,000 resamples) [1.028, 1.167] [0.889, 1.018] [0.978, 1.073]
One-sided 95% lower bound (Hoeffding, $z$ clipped at 4) 0.846 0.741 0.828
Longest job, generation only 1,052 s 1,051 s
End-to-end wall clock 1,265 s not recorded

Each batch ran as four 2-GPU jobs on 8 H200 GPUs, at 2.42 s per sample and 2.3 GPU-hours of generation. IBM's 1,726 hardware samples, scored with the same amplitudes, give 0.466 ± 0.031. The quantum runtime in #151 is 1,950 s.

Timing

The 1,265 s were measured on one monotonic clock on the submitting machine, from job submission until all logs had come back. They include code upload, queueing, start-up and CUDA compilation, sampling, complex128 rescoring of all samples, and log collection. They exclude one-time CPU preprocessing: converting the QASM to a graph state (0.2 s), finding the cut (four trials) and finding the scan order for rescoring (40 s).

References

  1. Instance and verification tasks: Random Graph State Sampling #151 and the circuit description.
  2. K. Renaud, dcs-rankwidth; F. Kuyanov and A. Kissinger, Efficient classical simulation of low-rank-width quantum circuits using ZX-calculus, arXiv:2603.06764.
  3. M. Van den Nest, J. Dehaene and B. De Moor, Graphical description of the action of local Clifford transformations on graph states, Phys. Rev. A 69, 022316 (2004).
  4. C. Gidney, Stim: a fast stabilizer circuit simulator, Quantum 5, 497 (2021).
  5. Zhao et al., Leapfrogging Sycamore: Harnessing 1432 GPUs for 7× Faster Quantum Random Circuit Sampling, arXiv:2406.18889.

Quantum runtime (seconds)

No response

Classical runtime (seconds)

1265

Compute resources (quantum)

No response

Compute resources (classical)

8 NVIDIA H200 GPUs (four independent 2-GPU jobs)

Notes

Linear XEB of 3,452 exact samples (two batches of 1,726)

Authors

Zhongpu Qiu

Institutions

Shanghai Artificial Intelligence Laboratory, Beijing Normal University

Activity

  1. ajavadia commented on Nov 2, 2026

    @ajavadia
    Contributor

    Hi. Thanks for your contribution. So this method is for classically sampling from the 70-qubit graph state with a final rotation layer.

    I am wondering whether it extends to the newer version of this experiment (#245)? This uses a ring topology (rather than a line), and also distributes the T gates throughout the circuit rather than the final layer.

  2. whyihaveyou commented on Nov 5, 2026

    @whyihaveyou
    Author

    Thanks for the question. Two parts to the answer.

    Ring topology. This is not an obstacle. Our sampler does not use the line structure: it only needs the Clifford part to reduce to a graph state with a balanced cut of full GF(2) rank, which holds for ring circuits as well.

    Interleaved T gates. These are the real difference. The exact sampler in this submission relies on the final rotations being single-qubit: then the reduced state on one half of a full-rank cut is maximally mixed, so that half can be drawn uniformly and the other half sampled exactly from its conditional state. With T gates inside the Clifford part this no longer holds, so the method does not carry over as it is.

    What we did for #245 instead. We report it in #263. As in #249, each T gate becomes a gadget qubit, giving a 378-qubit stabilizer state whose amplitudes we contract by linear rank-width. For each sample we draw a uniform 44-bit prefix, compute all 2^20 amplitudes of the remaining 20 bits in one contraction (about 25 s on one H200), and draw those bits exactly. This is the uniform-prefix strategy of Manabe, Gu and Pan (arXiv:2608.13110). The sampler is therefore approximate: its state has fidelity F = (E_y sqrt(D p_y))^2 with the ideal state, where D = 2^44 and p_y is the true prefix probability.

    Certificate. Before the run we fixed 64 sample indices for auditing. For each, an independent complex128 contraction recomputes the full conditional block, and the overlap c_y with the vector used for sampling satisfies sqrt(F) = E c_y. A one-sided Chernoff bound on the 64 overlaps gives F ≥ 0.908 at 95% confidence, without assuming Porter–Thomas statistics.

    Result. 1,389 samples on 8 H200 GPUs in 864 s, comparable to the 870 s quantum runtime, with fidelity at least 0.908 compared with the hardware bound of 0.349. The audits add 86 s per GPU. Code, records and audit data: https://github.com/whyihaveyou/dcs245-classical-sampling

    We would be glad to hear whether this addresses the newer experiment in the way you had in mind, and we can provide further data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions