# Direct Fidelity Estimation

This example method is used to certify than an experimental device prepares a desired quantum state. This is directly applicable to a pure quantum state and provides an estimate of the fidelity between the pure state and the actual arbitrary state in the lab, up to a constant additive error. The method requires measuring only a constant number of Pauli expectation values, selected at random according to an importance-weighting rule.

## Assumptions

• The quantum state to be prepared is a pure state. Any other additional structure or symmetry is not assumed.
• We can measure ${\displaystyle n}$-qubit Pauli observables, that is, tensor products of single-qubit Pauli operators. There is no need to perform any other operations.

## Outline

In this method, we want to compare the final state created in any experiment with the initial state and hence we use fidelity as a figure of merit for this. This method works by measuring a random subset of Pauli observables chosen according to an importance weighing rule. The Pauli observables selected are most likely to detect deviations from the desired state.

This method consists of the following steps:

• A system is considered of ${\displaystyle n}$ qubits with a certain space dimension and a pure quantum state is selected that is to be prepared. A group is formed of all possible Pauli operators. We have a final state, which has to be compared to the original pure quantum state.
• A Pauli observable is randomly selected from the group according to predefined importance weighing rule.
• A specific amount of copies of the final state are selected, where the amount depends on the selected Pauli observables.
• The Pauli observable is measured on each of these copies and the measurement outcome is received. An expectation value is calculated over all the random measurement outcome of all the copies.
• To estimate the fidelity with a fixed additive error and failure probability, the procedure from step 2 to step 4 is repeated ${\displaystyle l}$ times, which is a function of the additive error and failure probability.
• The average of all the calculated ${\displaystyle l}$ expectation values is taken which gives us the estimate of the fidelity.

## Hardware Requirements

• Trusted Measurement device.

## Notation

• ${\displaystyle d}$: Dimension of Hilbert space
• ${\displaystyle \rho }$: Original pure quantum state
• ${\displaystyle \sigma }$: Final quantum state which has to be compared to the original quantum state
• ${\displaystyle F(\rho ,\sigma )=}$tr(${\displaystyle \rho \sigma }$): Fidelity of the two quantum states ${\displaystyle \rho }$ and ${\displaystyle \sigma }$
• ${\displaystyle W_{k}(k=1,2,...,d^{2})}$: Denotes all possible Pauli operators, (${\displaystyle n}$-fold tensor products of ${\displaystyle I}$, ${\displaystyle \sigma _{x}}$, ${\displaystyle \sigma _{y}}$ and ${\displaystyle \sigma _{z}}$)
• ${\displaystyle \chi _{p}(k)}$: Characteristic function, ${\displaystyle \chi _{p}(k)=}$ tr(${\displaystyle {\frac {\rho W_{k}}{\sqrt {d}}}}$)
• Pr${\displaystyle (k)}$: Probability of selecting ${\displaystyle k}$ from ${\displaystyle \{1,..,d^{2}\}}$. This is the importance weighting rule, which is a natural probability distribution. Pr${\displaystyle (k)=(\chi _{p}(k))^{2}}$
• ${\displaystyle \epsilon }$: Additive Error
• ${\displaystyle \delta }$: Failure probability
• ${\displaystyle l}$: Number of times the process is repeated to obtain the average, ${\displaystyle l={\frac {1}{\epsilon ^{2}\delta }}}$
• ${\displaystyle m_{i}}$: Number of copies of ${\displaystyle \sigma }$ in a single process.
• ${\displaystyle A_{ij}}$: Measurement outcome, ${\displaystyle A_{ij}\in \{1,-1\}}$
• ${\displaystyle {\tilde {X}}}$: Expectation over all measurement outcomes
• ${\displaystyle {\tilde {Y}}}$: Average of all expectation values of all measurement outcomes
• ${\displaystyle E(m)}$: Expected number of copies of final quantum state

## Properties

• The figure of merit: Fidelity
• This protocol requires multiple copies of the final state. The expected numbers of copies are: ${\displaystyle E(m)\leq 1+{\frac {1}{\epsilon ^{2}\delta }}+{\frac {2d}{\epsilon ^{2}}}log(2/\delta )}$
• This protocol is applicable to a large class of quantum states and requires minimal experimental resources
• This protocol is faster than full tomography by a factor of $d$, the dimension of the state space
• Measurement of an only constant number of Pauli observables is required however each measurement needs to be repeated. The number of repetitions is ${\displaystyle O(d)}$ in the worst case, however, in many cases of practical interest, it is smaller.
• This protocol used a fixed number of Pauli observables, depending on the additive error and failure probability, and is independent of the size of the system
• This method allows one to directly measure the entanglement fidelity and average fidelity of the entire circuit, rather than inferring it from tomography performed on individual gates.

## Procedure Description

Input: copies of final quantum state

Output: Figure of merit: Fidelity, ${\displaystyle F(\rho ,\sigma )}$

• For ${\displaystyle i=1,2,...,l}$:
• Select ${\displaystyle k_{i}\in \{1,..,d^{2}\}}$ randomly, with probability Pr(${\displaystyle k_{i}}$)
• Determine ${\displaystyle m_{i}}$, ${\displaystyle m_{i}={\frac {2}{d(\chi _{p}(k_{i}))^{2}l\epsilon ^{2}}}}$ log${\displaystyle {\frac {2}{\delta }}}$
• Prepare ${\displaystyle m_{i}}$ copies of ${\displaystyle \sigma }$
• For ${\displaystyle j=1,2,...,m_{i}}$ sequences:
• Measure the Pauli observable ${\displaystyle W_{k_{i}}}$ on ${\displaystyle \sigma }$
• Get Measurement outcome ${\displaystyle A_{ij}}$
• Take estimate over all measurement outcomes to get ${\displaystyle {\tilde {X_{i}}}}$, ${\displaystyle {\tilde {X_{i}}}={\frac {1}{m_{i}{\sqrt {d}}\chi _{p}(k_{i})}}\sum _{j=1}^{m_{i}}A_{ij}}$
• Estimate ${\displaystyle {\tilde {Y}},}$ where ${\displaystyle {\tilde {Y}}={\frac {1}{l}}\sum _{i=i}^{l}{\tilde {X_{i}}}}$
• With probability ${\displaystyle \geq 1-2\delta ,F(\rho ,\sigma )}$ lies in the range ${\displaystyle [{\tilde {Y}}-2\epsilon ,{\tilde {Y}}+2\epsilon ]}$

## Further Information

• For stabilizer states, the number of repetitions is constant, independent of the size of the system; and for the W state, it is only quadratic in the number of qubits ${\displaystyle n}$.
• This method can certify Clifford circuits in constant time, independent of the number of qubits and gates.
• This method performs better under some mild assumptions on the noise in the system. If the noise is depolarizing or dephasing, then we get a favourable scaling of ${\displaystyle {\mathcal {O}}({\frac {log(1/\delta )}{\epsilon ^{2}}})}$
• If the nonzero Pauli expectations are only inverse polynomially small, then the number of copies is polynomial.
• By truncating negligibly small probabilities from the relevance distribution, we can improve the worst-case scaling at the cost of adding a tiny (also negligible) bias to our estimate.
• An analogous method can be used for certifying any unitary quantum channel by estimating the entanglement fidelity. Most of the analysis for channels is exactly analogous to the case of states. The main difference is that we may also input a state to the channel as well as choose how to measure at the output.

## Related Papers

• S.Flammia and Y.K. Liu (2011) arXiv:1104.4695v3: Direct Fidelity Estimation from Few Pauli Measurements
*contributed by Rhea Parekh