6

There have been some questions discussing the Hadamard test and quantum phase estimation (QPE), but I did not find the answer to the following question. Suppose we are given $|\psi\rangle$, which is an eigenstate of $U$ such that $U|\psi\rangle = \exp(i\theta)|\psi\rangle$, and we are asked to estimate the phase $\theta$. Surely we can use QPE to estimate it, but can't we do the same with Hadamard test? In particular, my question consists of two parts

  1. Can we use Hadamard test to measure the real and imaginary part of $\langle\psi |U|\psi\rangle$ separately to find $\theta$? If the answer is yes, what is the advantage of QPE?

  2. How many measurements do I need in order to make sure the error of estimation is below $\epsilon$?

narip
  • 2,964
  • 2
  • 9
  • 32
fagd
  • 965
  • 4
  • 12
  • 1
    I consider that a Hadamard test is a QPE, with precisely $1$ qubit of precision. The overall precision of $\theta$ is given both by the number of qubits in your QPE (exponential in the number of times you can do $U$) and the amount of amplification or number of measurements you're able to do (linear in $U$). – Mark Spinelli Nov 19 '21 at 01:28
  • @MarkS I can see that QPE can be thought as multiple Hadamard tests for multiple bits, and I understand $\theta$ is encoded as a binary form in QPE, but I have trouble to understand "Hadamard test is a QPE, with precisely 1 qubit of precision". Since I can increase the number of measurement to increase the precision, what does the above statement mean? – fagd Nov 19 '21 at 01:36
  • @MarkS I add a second part for the first question, and my second question is regarding Hadamard test, instead of QPE. – fagd Nov 19 '21 at 01:39
  • You can do this, but it should be at least quadratically slower than QPE. Since you now need $1/\epsilon^2$ samples to get an $\epsilon$ error in the sample averages. The analogy with QPE would be the number of queries to $U$. QPE scales as $1/\epsilon$ in queries to $U$. – dylan7 Nov 19 '21 at 01:41
  • However there are versions of QPE that make use of multiple separate hadamard tests. See (1) iterative quantum phase estimation or (2) semi-classical quantum Fourier transform. This is different than what you are describing though – dylan7 Nov 19 '21 at 01:42
  • @dylan7 So suppose we aim to reach error below $\epsilon$, then the complexity of QPE would be roughly $\log(\epsilon^{-1})$ (Quote from Nielsen & Chuang), and with Hadamard test, it would be $\epsilon^{-2}$. Did I understand you correctly? – fagd Nov 19 '21 at 01:45
  • For QPE it would be $\frac{1}{\epsilon}$, no $log$. So quadratically faster than the hadamard test way you mentioned. Also the fact that you would now need to compute the arctan of the imaginary over the real part means the error is no longer additive like it is with QPE. The log in QPE is for number of qubits used. The correct metric to compare the hadamard test method and this is circuit depth (more specicallly query complexity in number of calls to $U$) – dylan7 Nov 19 '21 at 01:47
  • @dylan7 Oh yeah, you are right. We need around $t=\log(\epsilon^{-1})$ qubits, and $2^t$ operations of $U$, so it is $\epsilon^{-1}$. Let me figure out why Hadamard is $\epsilon^{-2}$. – fagd Nov 19 '21 at 01:52
  • 1
    The $\epsilon ^{-2}$ comes from the central limit theorem. – dylan7 Nov 19 '21 at 01:55
  • 1
    central limit theorem/some version of Chernoff's inequality – Mark Spinelli Nov 19 '21 at 01:55

1 Answers1

6

So QPE using $\mathcal{O}(1/\epsilon)$ queries to $U$ outputs an estimate of the eigenphase $\theta$ given a corresponding eigenvector with additive error and $\Omega(1)$ probability.

The method using separate Hadamard Tests, that you mentioned, works. However, it requires $\mathcal{O}(1/\epsilon^2)$ samples to just get $\epsilon$-estimates of the real and imaginary parts of the eigenvalue. These samples can be viewed as queries to $U$. This complexity is based off of the central limit theorem/law of large numbers or Chernoff bounds as @Mark S mentioned. Thus, the method you mentioned is at least quadratically slower, in query complexity, than QPE.

If the goal is to estimate $\theta$, you need to compute the $\arctan$ of the estimates of the imaginary and real parts. This makes the error for $\theta$ no longer additive and would need to be taken into account to determine the number of samples required for the desired error on $\theta$.

On another note, there are versions of QPE that make use of single Hadamard Tests and don't suffer from this problem: Iterative Quantum Phase Estimation, which performs multiple single qubit QPEs, or the semi-classical QFT method that uses a non-unitary variant of the inverse QFT.

dylan7
  • 324
  • 1
  • 9
  • 1
    Oh, I think I see. You can get $\mathrm{Re}\left\langle\psi\mid U\mid\psi\right\rangle$ and $\mathrm{Im}\left\langle\psi\mid U\mid\psi\right\rangle$ separately to the correct precision using the $H$ test and the $YH$ test, respectively, but when you take the $\arctan$ you lose additivity in your error. – Mark Spinelli Nov 19 '21 at 02:24
  • 1
    yeah exactly. This only if you want to the phase as the OP mentioned. – dylan7 Nov 19 '21 at 02:25
  • 1
    Actually, it should be an $S$ (phase) gate for the imaginary part, $H$ then $S$. – dylan7 Nov 19 '21 at 02:36