4.1.5 Measuring all qubits
Once we are done with applying operations that transform our quantum bits, we would like to get some information out. As before, the only way of doing this is by measuring the qubits.
What are the rules for measuring a quantum state of qubits? If we measure all qubits then we obtain bits as the outcome, i.e., a bitstring . As before, the probability of obtaining any particular outcome is the squared amplitude:
In Quirky, we can measure all qubits as before, by adding one measurement box for each qubit. To view the probabilities of the measurement outcomes, we can add a probability display – but we have to make sure to resize it suitably so that it applies to all wires. Try reproducing the following example:
This sequence of Quirky operations prepares the state
and measures all three qubits. Can you see how this works?