By default, all qubits are initialized in the state. With the prep_z
instruction, qubits will be explicitly initialized in the state of the z-basis, i.e. in the same state as the default.
State initialization can be done at the beginning of an algorithm, but it can also be done during an algorithm (re-initialization). Be aware that re-initialization of a qubit will also reset the binary register entry for that qubit to zero.
The instructions prep_x
and prep_y
can be used to initialize qubits in other sets of basis states.