EstimateOverlapBetweenStates operation

Namespace: Microsoft.Quantum.Characterization

Package: Microsoft.Quantum.Standard

Given two operations which each prepare copies of a state, estimates the squared overlap between the states prepared by each operation.

operation EstimateOverlapBetweenStates (preparation1 : (Qubit[] => Unit is Adj), preparation2 : (Qubit[] => Unit is Adj), nQubits : Int, nMeasurements : Int) : Double

Input

preparation1 : Qubit[] => Unit is Adj

The first of the two state preparation operations to be compared.

preparation2 : Qubit[] => Unit is Adj

The second of the two state preparation operations to be compared.

nQubits : Int

The number of qubits on which commonPreparation, preparation1, and preparation2 all act.

nMeasurements : Int

The number of measurements to use in estimating the overlap.

Output : Double

Remarks

This operation uses the SWAP test to find $$ \begin{align} \left| \braket{00\cdots 0 | V^{\dagger} U | 00\cdots 0} \right|^2 \end{align} $$ where $U$ is the unitary representation of the action of preparation1, and where $V$ corresponds to preparation2.

See Also