Skip to content

Commit 7fef178

Browse files
Add test to check for correlated matching boundary component handling (#176)
Co-authored-by: oscarhiggott <[email protected]>
1 parent 23b3be9 commit 7fef178

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

tests/matching/decode_test.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,26 @@ def test_decode_to_edges_with_correlations():
400400
assert np.array_equal(edges, expected_edges)
401401

402402

403+
def test_correlated_matching_handles_single_detector_components():
404+
stim = pytest.importorskip("stim")
405+
p = 0.1
406+
circuit = stim.Circuit.generated(
407+
code_task="surface_code:rotated_memory_x",
408+
distance=5,
409+
rounds=5,
410+
before_round_data_depolarization=p,
411+
)
412+
circ_str = str(circuit).replace(
413+
f"DEPOLARIZE1({p})", f"PAULI_CHANNEL_1(0, {p}, 0)"
414+
)
415+
noisy_circuit = stim.Circuit(circ_str)
416+
dem = noisy_circuit.detector_error_model(
417+
decompose_errors=True, approximate_disjoint_errors=True
418+
)
419+
m = Matching.from_detector_error_model(dem, enable_correlations=True)
420+
assert m.num_detectors > 0
421+
422+
403423
def test_load_from_circuit_with_correlations():
404424
stim = pytest.importorskip("stim")
405425
circuit = stim.Circuit.generated(

0 commit comments

Comments
 (0)