@@ -549,3 +549,63 @@ ExplainedError {
549549}
550550)RESULT" );
551551}
552+
553+ TEST (ErrorMatcher, heralded_error) {
554+ Circuit circuit (R"CIRCUIT(
555+ HERALDED_ERASE(0.01) 0
556+ DETECTOR rec[-1]
557+ HERALDED_ERASE(0.01) 1 2
558+ )CIRCUIT" );
559+ DetectorErrorModel filter (R"MODEL(
560+ error(1) D0
561+ )MODEL" );
562+
563+ auto actual = ErrorMatcher::explain_errors_from_circuit (
564+ circuit,
565+ &filter,
566+ false );
567+ std::stringstream ss;
568+ for (const auto &match : actual) {
569+ ss << " \n " << match << " \n " ;
570+ }
571+ ASSERT_EQ (ss.str (), R"RESULT(
572+ ExplainedError {
573+ dem_error_terms: D0
574+ CircuitErrorLocation {
575+ flipped_measurement.measurement_record_index: 0
576+ Circuit location stack trace:
577+ (after 0 TICKs)
578+ at instruction #1 (HERALDED_ERASE) in the circuit
579+ at target #1 of the instruction
580+ resolving to HERALDED_ERASE(0.01) 0
581+ }
582+ CircuitErrorLocation {
583+ flipped_pauli_product: X0
584+ flipped_measurement.measurement_record_index: 0
585+ Circuit location stack trace:
586+ (after 0 TICKs)
587+ at instruction #1 (HERALDED_ERASE) in the circuit
588+ at target #1 of the instruction
589+ resolving to HERALDED_ERASE(0.01) 0
590+ }
591+ CircuitErrorLocation {
592+ flipped_pauli_product: Y0
593+ flipped_measurement.measurement_record_index: 0
594+ Circuit location stack trace:
595+ (after 0 TICKs)
596+ at instruction #1 (HERALDED_ERASE) in the circuit
597+ at target #1 of the instruction
598+ resolving to HERALDED_ERASE(0.01) 0
599+ }
600+ CircuitErrorLocation {
601+ flipped_pauli_product: Z0
602+ flipped_measurement.measurement_record_index: 0
603+ Circuit location stack trace:
604+ (after 0 TICKs)
605+ at instruction #1 (HERALDED_ERASE) in the circuit
606+ at target #1 of the instruction
607+ resolving to HERALDED_ERASE(0.01) 0
608+ }
609+ }
610+ )RESULT" );
611+ }
0 commit comments