You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# To enable sparse activation for high-degree DEMs:
230
+
config = tesseract.TesseractConfig(
231
+
dem=dem,
232
+
det_beam=50,
233
+
sparsify_errors=True,
234
+
sparsify_base_degree=3,
235
+
sparsify_reactivate_limit=-1, # Use the built-in heuristic, clamped to error count.
236
+
)
237
+
200
238
# 3. Create a decoder instance
201
239
decoder = config.compile_decoder()
240
+
print(
241
+
"Resolved sparsify reactivation limit:",
242
+
decoder.config.sparsify_reactivate_limit,
243
+
)
202
244
203
245
# 4. Simulate detector outcomes
204
246
syndrome = np.array([0, 1, 1], dtype=bool)
@@ -235,7 +277,13 @@ if __name__ == "__main__":
235
277
p =0.005
236
278
# These are the sensible defaults given by make_tesseract_sinter_decoders_dict().
237
279
# Note that `tesseract-short-beam` and `tesseract-long-beam` are the two sets of parameters used in the [Tesseract paper](https://arxiv.org/pdf/2503.10988).
@@ -20,6 +20,13 @@ Explanation of configuration arguments:
20
20
*`det_orders` - A list of lists of integers, where each inner list represents an ordering of the detectors. This is used for "ensemble reordering," an optimization that tries different detector orderings to improve the search's convergence. The default is an empty list, meaning a single, fixed ordering is used.
21
21
*`det_penalty` - A floating-point value that adds a cost for each residual detection event. This encourages the decoder to prioritize paths that resolve more detection events, steering the search towards more complete solutions. The default value is `0.0`, meaning no penalty is applied.
22
22
*`create_visualization` - A boolean flag that enables decoder visualization output when set to `True`. The default value is `False`.
23
+
*`sparsify_errors` - Enables per-shot sparse error activation. When enabled, all errors up to `sparsify_base_degree` are always active, and selected higher-degree errors are reactivated per shot.
24
+
*`sparsify_base_degree` - Required and positive when `sparsify_errors=True`. Errors with detector degree less than or equal to this value are always active.
25
+
*`sparsify_max_degree` - Optional maximum degree for reactivated errors. Use `-1` for no maximum degree cap.
26
+
*`sparsify_reactivate_limit` - Maximum number of optional high-degree errors to reactivate per shot. Use `-1` to apply the built-in heuristic, clamped to the number of errors in the compiled error model.
27
+
28
+
Module-level helper:
29
+
*`suggest_sparsify_reactivate_limit(num_detectors, sparsify_base_degree)` - Returns the suggested reactivation limit for a detector count and base degree. The decoder applies this suggestion, clamped to the compiled error count, when `sparsify_reactivate_limit == -1`.
0 commit comments