3

In connection to this question, I am wondering how to calculate value $\langle \psi|\phi \rangle$ for arbitrary quantum states $|\psi\rangle$ and $|\phi\rangle$.

A swap test is able to return only $|\langle \psi|\phi \rangle|^2$ which means that sign of the product is forgotten in case the inner product is real. Moreover, information about real and imaginary parts is lost in case of complex result.

Do you know about any more general method how to calculate the inner product than swap test?

Martin Vesely
  • 15,244
  • 4
  • 32
  • 75

1 Answers1

3

I doubt that this is possible. Given a state $|\phi\rangle$, we have no method for distinguishing it from $e^{i\varphi}|\phi\rangle$ for any phase $\varphi$. This means that we have no way of distinguishing between $$\langle\psi|\phi\rangle\qquad \mathrm{vs.}\qquad e^{i\varphi}\langle\psi|\phi\rangle.$$ Specifically, we can choose $\varphi$ such that $$e^{i\varphi}\langle\psi|\phi\rangle=|\langle\psi|\phi\rangle|.$$ We thus should be precluded from measuring anything other than this absolute value.


To get around this constraint, we would need to set up a superposition of $|\phi\rangle$ and $|\psi\rangle$ like $$|\Psi\rangle\propto |\psi\rangle+|\phi\rangle.$$ Only then could we get around the global phase problem. I would be interested in seeing a circuit that can take $$|0\rangle|\psi\rangle|\phi\rangle\to|\Psi\rangle|a\rangle|b\rangle$$ for any generalized ancilla $|0\rangle$ and final states $|a\rangle$ and $|b\rangle$. If I had to guess, I would say that it is impossible to perform this transformation with a fixed relative phase in $|\Psi\rangle$. We might be happy saying that $$|0\rangle|\psi\rangle|\phi\rangle\to\frac{|\psi\rangle+|\phi\rangle}{\mathcal{N}}|a\rangle|b\rangle$$ for some normalization constant $\mathcal{N}$, but then we would need to also be happy with the transformation $$|0\rangle|\psi\rangle e^{i\varphi}|\phi\rangle\to\frac{|\psi\rangle+e^{i\varphi}|\phi\rangle}{\mathcal{N}}|a\rangle|b\rangle,$$ but that is nonsensical for the same deterministic transformation, because the initial states $|0\rangle|\psi\rangle |\phi\rangle$ and $|0\rangle|\psi\rangle e^{i\varphi}|\phi\rangle$ are indistinguishable.

Quantum Mechanic
  • 4,719
  • 5
  • 26