Extended Quantum Computing Patterns
Post-Selective Measurement
Aliases: –
Tags:
© Weigold, M., et al.: Encoding patterns for quantum algorithms. IET Quant. Comm. 1–12 (2021). https://doi.org/10.1049/qtc2.12032
Intent
Select one branch of a superposition to proceed with
Context
As quantum operations are unitary, they perform linear transformations. However, sometimes a non-linear transformation is desirable. For example, if the result of a computation is stored in one branch of the superposition, e.g.,
one would like to proceed with \(\newcommand{\state}[1]{{\left| #1 \right>}}\state{1}\state{f(x)}\) and discard the rest of the superposition.
Forces
–
Solution
Use measurement to force the quantum state to collapse into one of the two branches. For the example above, measuring the first qubit in the computational basis results in either \(\newcommand{\state}[1]{{\left| #1 \right>}}\state{0}\) or \(\newcommand{\state}[1]{{\left| #1 \right>}}\state{1}\). If the measurement indicates that the preferred branch was selected (i.e., \(\newcommand{\state}[1]{{\left| #1 \right>}}\state{1}\) for our example)), one can proceed with further calculations (shown in the pattern sketch). Otherwise, the current computation is discarded and restarted from the beginning, i.e., by first resetting each qubit to \(\newcommand{\state}[1]{{\left| #1 \right>}}\state{0}\) followed by the operations of the rest of the circuit.
Result
As the resulting approach is probabilistic, thus, the average number of iterations needed depends on the amplitude of the selected branch. In the example above, the algorithm proceeds with a probability of 50%.
Examples
–
Related Patterns
Amplitude Amplification can be used to increase the probability to select a particular branch.
Known Uses
A non-linear transformation can be favorable for designing quantum neural networks [Cao et al. 2017]. The HHL algorithm [Harrow, Hassidim and Lloyd 2009] and various other algorithms that build on it, for example, the Quantum Support Vector Machine Duan et al. 2020], use this technique.Post-Selective Measurements are also used in repeat-until-success circuits [Paetznick and Svore] that restore the state before the measurement via a recovery operation instead of restarting the whole computation. OpenQASM 3.0 introduces the functionality to explicitly model such an approach through the usage of measurements within a while loop [Cross et al. 2021].