I'm learning Stim with the official tutorial and have a question. I made a small program:
for rounds in range(1, 20):
p = 0.001
circuit = stim.Circuit.generated(
'surface_code:rotated_memory_z',
rounds=rounds,
distance=5,
after_clifford_depolarization=p,
before_round_data_depolarization=p,
before_measure_flip_probability=p,
after_reset_flip_probability=p)
num_shots = 1_000_000
num_logical_errors = count_logical_errors(circuit, num_shots)
print("there were {} wrong predictions (logical errors) out of {} shots with {} rounds".format(num_logical_errors, num_shots, rounds))
I copied count_logical_errors
from the tutorial.
I expected that the number of logical errors with rounds=2
is less than that with rounds=1
, but the execution result said otherwise:
there were 18 wrong predictions (logical errors) out of 1000000 shots with 1 rounds
there were 49 wrong predictions (logical errors) out of 1000000 shots with 2 rounds
there were 75 wrong predictions (logical errors) out of 1000000 shots with 3 rounds
there were 94 wrong predictions (logical errors) out of 1000000 shots with 4 rounds
there were 127 wrong predictions (logical errors) out of 1000000 shots with 5 rounds
there were 168 wrong predictions (logical errors) out of 1000000 shots with 6 rounds
there were 179 wrong predictions (logical errors) out of 1000000 shots with 7 rounds
there were 221 wrong predictions (logical errors) out of 1000000 shots with 8 rounds
there were 235 wrong predictions (logical errors) out of 1000000 shots with 9 rounds
there were 248 wrong predictions (logical errors) out of 1000000 shots with 10 rounds
there were 299 wrong predictions (logical errors) out of 1000000 shots with 11 rounds
there were 344 wrong predictions (logical errors) out of 1000000 shots with 12 rounds
there were 386 wrong predictions (logical errors) out of 1000000 shots with 13 rounds
there were 382 wrong predictions (logical errors) out of 1000000 shots with 14 rounds
there were 400 wrong predictions (logical errors) out of 1000000 shots with 15 rounds
there were 448 wrong predictions (logical errors) out of 1000000 shots with 16 rounds
there were 471 wrong predictions (logical errors) out of 1000000 shots with 17 rounds
there were 541 wrong predictions (logical errors) out of 1000000 shots with 18 rounds
there were 557 wrong predictions (logical errors) out of 1000000 shots with 19 rounds
Is my expectation wrong, or is there anything wrong with the above code?
Thanks,