3
$\begingroup$

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()
$\endgroup$
1
  • $\begingroup$ PEP-8 (Python) says to use 4 space indent. From the Code Lay-out section: "Use 4 spaces per indentation level." $\endgroup$ Oct 21 at 15:38
5
$\begingroup$

A shot is a full run of a circuit. If your circuit contains 100 measurements, sampling a shot from that circuit will produce 100 bits of measurement information.

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.

$\endgroup$
7
  • $\begingroup$ does the number of rounds need to match the number of stabilizers? so it would be code dependent? what happens if I enter more or less than that? $\endgroup$
    – unknown
    Oct 20 at 20:32
  • $\begingroup$ @unknown No. A code with 100 stabilizers and 2 rounds will measure each of the 100 stabilizers twice via the ancillary measurement qubit associated with that stabilizer. There is also a third implicit measurement of the stabilizer from the final measurement of the data qubits. $\endgroup$ Oct 20 at 20:43
  • $\begingroup$ since I don't have measurement noise now, setting rounds=1 should be ok right? $\endgroup$
    – unknown
    Oct 20 at 20:45
  • 1
    $\begingroup$ @unknown For modelling a communication channel where only the transmission is noisy, you will need to do something a bit custom. You want to measure the stabilizers once on the sender, and once at the receiver, with noise applied to the data qubits in between. You use comparisons between the before/after measurements as detectors, and use knowledge of the transmitted state vs noiseless data measurement at the end as the observable. Stim's generated circuits have pieces you can build from (e.g. blocks of instructions measuring all the stabilizers), but you have to customize them a bit. $\endgroup$ Oct 20 at 21:34
  • 1
    $\begingroup$ @unknown For example, generate a circuit with 100 rounds, and copy out the body of the REPEAT block. That's the stabilizer measurements. Do it once (without the detectors) then again (with the detectors). Add noise between the two. Then put noiseless initialization beforehand and noiseless measurement afterward, with an observable checking the end measurement agrees with the init. That's the circuit you want. $\endgroup$ Oct 20 at 21:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.