That would be a reasonable method to have, but currently it does not exist.
The closest approximation would be to call stim.Circuit.detecting_regions
. This will return a dictionary that allows you to solve the problem for yourself more easily, by looking up detector sensitivities at given times and locations. But it requires a TICK to be present in the circuit at the location where you want the error to be.
An error will set off a detector if it anticommutes with the sensitivity region of a detector at that location and time. You may need to massage the returned data structure a bit more to get something truly fast to query.
import stim
circuit = stim.Circuit.generated(
"surface_code:rotated_memory_x",
rounds=5,
distance=4,
)
detecting_regions = circuit.detecting_regions(
targets=["L0", (2, 4), stim.DemTarget.relative_detector_id(5)],
ticks=range(5, 15),
)
for target, tick_regions in detecting_regions.items():
print("target", target)
for tick, sensitivity in tick_regions.items():
print(" tick", tick, "=", sensitivity)
target D1
tick 5 = +____________________X______________________
tick 6 = +____________________Z______________________
target D5
tick 5 = +______X____________________________________
tick 6 = +______Z____________________________________
target D14
tick 5 = +__________X_X______XXX_____________________
tick 6 = +__________X_X______XZX_____________________
tick 7 = +__________X_X______XZX_____________________
tick 8 = +__________X_X______XXX_____________________
tick 9 = +__________XXX_____XXX______________________
tick 10 = +__________XXX_______X______________________
tick 11 = +__________X_________X______________________
tick 12 = +____________________X______________________
tick 13 = +____________________Z______________________
target D29
tick 7 = +____________________Z______________________
tick 8 = +____________________X______________________
tick 9 = +____________________XX_____________________
tick 10 = +___________________XXX_______X_____________
tick 11 = +____________X______XXXX______X_____________
tick 12 = +__________X_X______XXX_____________________
tick 13 = +__________X_X______XZX_____________________
tick 14 = +__________X_X______XZX_____________________
target D44
tick 14 = +____________________Z______________________
target L0
tick 5 = +_X________X________X________X______________
tick 6 = +_X________X________X________X______________
tick 7 = +_X________X________X________X______________
tick 8 = +_X________X________X________X______________
tick 9 = +_X________X_______XX________X______________
tick 10 = +_X________X________X________X______________
tick 11 = +_X________XX_______X________XX_____________
tick 12 = +_X________X________X________X______________
tick 13 = +_X________X________X________X______________
tick 14 = +_X________X________X________X______________