# What is the meaning of "shots" and "rounds" in Stim?

I'm running simulations using Stim to get logical error rate vs. physical error rates of some quantum error correcting codes (QECC).

I looked into the documentation, but I'm confused about the meaning of "shots" and "rounds". I think I understand the meaning of "shots": repeat the state generation, add random noise at physical error rate, measure, decode, count logical errors. How would the "rounds" parameter enter the picture? Why would I need more than one round of measurement? (Assuming each round measures all stabilizers.)

Here a code sniplet of an example:

def Test():
num_shots = 1000
xs = []
ys = []
for noise in [0.1, 0.2, 0.3, 0.4, 0.5]:
circuit = stim.Circuit.generated("surface_code:rotated_memory_z",distance=3,rounds=1,before_round_data_depolarization=noise)
xs.append(noise)
ys.append(count_logical_errors(circuit, num_shots) / num_shots)
plt.plot(xs, ys)
plt.semilogy()
plt.xlabel("physical error rate")
plt.ylabel("logical error rate")
plt.show()

• PEP-8 (Python) says to use 4 space indent. From the Code Lay-out section: "Use 4 spaces per indentation level." Oct 21 at 15:38

A round is a concept used by the circuit generation methods to parameterize how deep you want the generated circuit to be. Each of the generated circuits repeatedly measures some set of local stabilizers by using ancillary measurement qubits. The number of rounds is defined to be the number of times each ancillary measurement qubit is measured. Concretely, these circuits all have a big REPEAT X { ... } block in the middle, and incrementing the number of rounds will increment X.