EstimateFrequency operation

Warning

This documentation refers to the Classic QDK, which has been replaced by the Modern QDK.

Please see https://aka.ms/qdk.api for the API documentation for the Modern QDK.

Namespace: Microsoft.Quantum.Characterization

Package: Microsoft.Quantum.Standard

Given a preparation and measurement, estimates the frequency with which that measurement succeeds (returns Zero) by performing a given number of trials.

operation EstimateFrequency (preparation : (Qubit[] => Unit), measurement : (Qubit[] => Result), nQubits : Int, nMeasurements : Int) : Double

Input

preparation : Qubit[] => Unit

An operation $P$ that prepares a given state $\rho$ on its input register.

measurement : Qubit[] => Result

An operation $M$ representing the measurement of interest.

nQubits : Int

The number of qubits on which the preparation and measurement each act.

nMeasurements : Int

The number of times that the measurement should be performed in order to estimate the frequency of interest.

Output : Double

An estimate $\hat{p}$ of the frequency with which $M(P(\ket{00 \cdots 0}\bra{00 \cdots 0}))$ returns Zero, obtained using the unbiased binomial estimator $\hat{p} = n_{\uparrow} / n_{\text{measurements}}$, where $n_{\uparrow}$ is the number of Zero results observed.

This is particularly important on target machines which respect physical limitations, such that probabilities cannot be measured.