From 0ce7c5871d3f5c58020cdc1ce1814be4c9968f69 Mon Sep 17 00:00:00 2001 From: ddri Date: Sun, 4 Jan 2026 12:47:26 -0800 Subject: [PATCH] docs: fix decoherence noise example missing wrap_in_numshots_loop Fixes #1402 The "Adding Decoherence Noise" example was missing a call to wrap_in_numshots_loop(1000) before executing the quantum program. Without it, the program runs with only 1 shot (the default), making the statistical calculations (np.mean over bitstrings) meaningless. This fix adds the missing line, matching the pattern used in all other examples in the same documentation file (amplitude damping, dephased CZ, readout noise examples). The T2 parameter is left as T2=t1/2, which: - Matches the documented intent (line 670: "By default, T2 = T1 / 2") - Satisfies the physics constraint (T2 <= 2*T1) - Is more realistic than T2=2*t1 (theoretical maximum) --- docs/source/noise.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/source/noise.rst b/docs/source/noise.rst index f307745f8..5bc97c397 100644 --- a/docs/source/noise.rst +++ b/docs/source/noise.rst @@ -702,6 +702,7 @@ gate noise, respectively. MEASURE(0, ("ro", 0)), MEASURE(1, ("ro", 1)), ]) + noisy.wrap_in_numshots_loop(1000) bitstrings = qc.run(noisy).get_register_map().get("ro") # Expectation of Z0 and Z1