Number of shots

Each quantum algorithm that is executed is repeated a number of times (the number of shots).

Measurement in quantum mechanics are non-deterministic. If the system consists of a single qubit in the state a0+b1a \left\lvert 0 \right\rangle + b \left\lvert 1 \right\rangle> then a measurement in the zz-basis results in a value 0 with probability a2|a|^2 and a value 1 with probability b2|b|^2. It is therefore not possible to gain full information about a quantum system with a single measurement. Also physical systems have noise so our measurement result might be corrupted.

For example if we have the following quantum algorithm

and the algorithm is executed perfectly, the state of the system after the Hadamard gate would be

12(0+1)\frac{1}{\sqrt{2}} \left( \left\lvert 0 \right\rangle + \left\lvert 1 \right\rangle \right)

The outcome of a single measurement is either 0 or 1. When we perform the quantum algorithm with 20 shots, then a typical measurement outcome would be:

data=0,1,1,0,1,1,0,1,0,1,0,0,1,0,0,1,1,0,1,1