From 8892636ddcb5937d2f103d2431c8c2dd0602f62d Mon Sep 17 00:00:00 2001 From: Craig Gidney Date: Tue, 24 Sep 2024 00:31:04 -0700 Subject: [PATCH] Tweak sinter's automatic detector error model computation (#832) Derived from https://github.com/quantumlib/Stim/pull/734 , adjusted for major code updates since then Co-Author: @inmzhang --- .../src/sinter/_collection/_collection_worker_state.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/glue/sample/src/sinter/_collection/_collection_worker_state.py b/glue/sample/src/sinter/_collection/_collection_worker_state.py index ba8967e6..378abf57 100644 --- a/glue/sample/src/sinter/_collection/_collection_worker_state.py +++ b/glue/sample/src/sinter/_collection/_collection_worker_state.py @@ -27,7 +27,10 @@ def _fill_in_task(task: Task) -> Task: try: dem = circuit.detector_error_model(decompose_errors=True, approximate_disjoint_errors=True) except ValueError: - dem = circuit.detector_error_model(approximate_disjoint_errors=True) + try: + dem = circuit.detector_error_model(approximate_disjoint_errors=True) + except ValueError: + dem = circuit.detector_error_model(approximate_disjoint_errors=True, flatten_loops=True) changed = True if not changed: return task