9

2

I found an algorithm that can compute the distance of two quantum states. It is based on a subroutine known as swap test (a fidelity estimator or inner product of two state, btw I don't understand what fidelity mean).

My question is about inner product. How can I calculate the inner product of two quantum registers which contains different number of qubits?

The description of the algorithm is found in this paper. Based on the 3rd step that appear on the image, I want to prove it by giving an example.

Let: $|a| = 5$, $|b| = 5 $, and $ Z = 50 $ $$|a\rangle = \frac{3}{5}|0\rangle + \frac{4}{5}|1\rangle$$ $$|b\rangle = \frac{4}{5}|0\rangle + \frac{3}{5}|1\rangle $$ All we want is the fidelity of the following two states $|\psi\rangle$ and $|\phi\rangle$ and to calculate the distance between $|a\rangle$ and $|b\rangle$is given as: $ {|a-b|}^2 = 2Z|\langle\phi|\psi\rangle|^2$ so $$|\psi\rangle = \frac{3}{5\sqrt{2}}|00\rangle + \frac{4}{5\sqrt{2}}|01\rangle+ + \frac{4}{5\sqrt{2}}|10\rangle + + \frac{3}{5\sqrt{2}}|11\rangle$$ $$|\phi\rangle = \frac{5}{\sqrt{50}} (|0\rangle + |1\rangle) $$ then how to compute $$\langle\phi|\psi\rangle = ??$$

1In a few words, you can't. The inner product is defined for 2 vectors of the same space (i.e. 2 vectors of the same dimension) whereas your vectors (or quantum states) don't have the same size. – Adrien Suau – 2018-08-07T12:47:03.297