I'm learning the Swap Test, a quantum circuit to calculate the inner product of two quantum states $|\langle \phi|\psi\rangle|^2 $: enter image description here

For the error analysis of this quantum circuit, according to Swap Test:

"This allows one to, for example, estimate the squared inner product between the two states, $|\langle \phi|\psi\rangle|^2 $, to $\epsilon$ additive error by taking the average over $O(\frac {1}{\varepsilon ^{2}})$ runs of the swap test."

What's the "additive error $\epsilon$ " from a statistical point of view? Is it MSE, RMSE, or Variance? Can RMSE serve as an additive error of the Swap Test?


1 Answer 1


Additive error $\epsilon$ means that, if the true value of the expectation value we are attempting to measure is $\langle \hat{O} \rangle_{\textrm{True}}$, then our estimate $\langle \hat{O} \rangle_{\textrm{Estimated}}$ falls within the range $\langle \hat{O} \rangle_{\textrm{Estimated}} \in [\langle \hat{O} \rangle_{\textrm{True}} - \epsilon, \langle \hat{O} \rangle_{\textrm{True}} + \epsilon]$. Conversely, a multiplicative error $\epsilon$ implies $\langle \hat{O} \rangle_{\textrm{Estimated}} \in [\langle \hat{O} \rangle_{\textrm{True}} (1 - \epsilon), \langle \hat{O} \rangle_{\textrm{True}} (1 + \epsilon)]$. See, e.g., this Theoretical Computer Science question for a more in-depth discussion of the differences between the two.

  • $\begingroup$ Thank you! I'm curious about the relationship between the additive error and RMSE, can RMSE serves as an additive error of the Swap Test? $\endgroup$ Jun 9, 2023 at 8:40
  • $\begingroup$ Yes, that is correct. The usual RMSE corresponds to the additive error. If you want to consider the estimation of the fidelity up to some multiplicative error, then you have to divide by the true fidelity. Essentially, the main difference between the additive and multiplicative errors arises when the fidelity is close to zero. In that case, achieving a multiplicative error $\epsilon$ takes more shots than achieving the same additive error $\epsilon$, because $\epsilon$ eventually becomes large compared to the true fidelity as it approaches zero. $\endgroup$
    – bm442
    Jun 9, 2023 at 13:33
  • $\begingroup$ Thank you so much! I'm very grateful for your help, have a nice day! $\endgroup$ Jun 9, 2023 at 15:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.