Quantum Computing Asked on March 21, 2021
I’m looking at a circuit from this paper on quantum machine learning.
So to introduce my own notation:
The paper says that at the end we measure $|0⟩$ for the top qubit with the following probability:
$$
P(|0⟩_{psi_3}) = frac{1}{2} + frac{1}{2}|⟨a|b⟩|^2
$$
As I’m new to this I decided to do the expansion by hand.
The first two rows are grouped for $vert 0xxrangle$ and the second two rows are for $vert 1xxrangle$. As I understand, I can get $P(|0⟩_{psi_3})$ by summing the probability amplitudes for the first two rows.
Here’s what’s baffling me:
The first two rows are basically what you would get back if you skipped the controlled-swap. You’d just come back to $|psi_0⟩$. And as before, you’d get:
$$
P(|0⟩_{psi_0}) = |a_0b_0| + |a_0b_1| + |a_1b_0| + |a_1b_1|
$$
So that means the probability amplitudes of the first two rows sum up to 1. Which leaves me very confused because there are still two more rows to consider which would add on another $|a_0b_1| + |a_1b_0|$.
Thanks for your time!
For completeness i'm going to give the proof of the swap test:
The initial state is given as, where I will use a slight abuse of notation on the R.H.S ($|0rangle|arangle|brangle equiv |0rangle otimes|arangle otimes|brangle$, where $|arangle$ and $|brangle$ are states NOT bases).
$|phi_1 rangle = a_0b_0|000rangle + a_1b_0|010rangle + a_0b_1|001rangle + a_1b_1|011rangle = |0rangle|arangle|brangle$
applying $H$
$H|0rangle|arangle|brangle = frac{1}{sqrt{2}}|0rangle|arangle|brangle + frac{1}{sqrt{2}}|1rangle|arangle|brangle $,
Now, if we were to take the measurement of either $|0rangle$ or $|1rangle$ now the inner products of the measurements would give:
$P(0) = (frac{1}{sqrt{2}}langle b|langle a| langle 0|)(frac{1}{sqrt{2}}|0rangle|arangle|brangle) = frac{1}{2}$
Which isn't very useful, so by applying the swap:
$|phi_3rangle = frac{1}{sqrt{2}}|0rangle|arangle|brangle + frac{1}{sqrt{2}}|1rangle|brangle|arangle$
we will see that this changes the inner product of the measurements.
Applying the second $H$
$H|phi_3rangle = frac{1}{2}|0rangle|arangle|brangle + frac{1}{2}|1rangle|arangle|brangle + frac{1}{2}|0rangle|brangle|arangle - frac{1}{2}|1rangle|brangle|arangle = frac{1}{2}|0rangle left[|arangle|brangle + |brangle|arangleright] + frac{1}{2}|1rangle left[|arangle|brangle - |brangle|arangle right]$.
So first by inspection we can see with at least probability $frac{1}{2}$ that we will measure the first qubit in $|0rangle$.
Now we take the inner product for the $|0rangle$ measurement:
$P(0) = frac{1}{4}(langle a|langle b| + langle b|langle a|)langle 0 |0rangle(|arangle|brangle + |brangle|arangle) = frac{1}{4}(langle a| langle b| a rangle |brangle + langle a| langle b| b rangle |arangle + langle b| langle a| a rangle |brangle + langle b| langle a| b rangle |arangle) = frac{1}{2} + frac{1}{2}langle b| langle a| b rangle |arangle = frac{1}{2} + frac{1}{2}|langle a|brangle|^2 $
(remembering the abuse of notation s.t. $langle a | b rangle neq 0$ because it is the inner product of the states $|arangle = a_0|0rangle + a_1|1rangle$ and not the bases of type $|arangle$ and $|brangle$. However by completion we know that $langle a | a rangle = 1$)
Finally how can $langle b| langle a| b rangle |arangle)$ be the fidelity? We will use some rearranging and remeber that the inner product is a scalar, however we need to be careful because it is a complex scalar! So we can write
$langle b| langle a| b rangle |arangle = langle a| b ranglelangle b| a rangle$,
by shuffling the scalar terms, and we can also see that
$langle b| langle a| b rangle |arangle = langle a| b ranglelangle b| a rangle = langle a| langle b| a rangle |brangle$
However $ langle a| b rangle neq langle b| a rangle$ so we can't just square the inner product term. But we can use the relation via the complex conjugate:
$langle b| a rangle = langle a| b rangle^dagger$.
Hence we can write this as the modulus squared
$langle a| b ranglelangle b| a rangle = langle a| b ranglelangle a| b rangle^dagger = |langle a| b rangle|^2$
Correct answer by Sam Palmer on March 21, 2021
Found it! To me it actually feels very sneaky so I'll take the time to explain it.
Focussing on just the top two rows of my handwritten expansion:
I made the mistake of taking vertically adjacent pairs of coefficients, adding them together, and dividing by 2.
So from left to right in vertical pairs:
$$ frac{1}{2}big[2a_0b_0|0xx⟩big] + frac{1}{2}big[2a_0b_1|0xx⟩big] + frac{1}{2}big[2a_1b_0|0xx⟩big] + frac{1}{2}big[2a_1b_1|0xx⟩big] tag{1A} $$
Then I just cancelled the 2's and was left with:
$$ |a_0b_0| + |a_0b_1| + |a_1b_0| + |a_1b_1| = 1 tag{2A} $$
hence my confusion.
The mistake was made when I did the grouping for the first |0⟩ disregarding the rest of the state. But if we look at the columns 2 and 3 we see that the 2nd and 3rd qubits are inverted, so I can't do the grouping. The proper way of what I meant to do in (1A) would then be:
$$ frac{1}{2}big[2a_0b_0|000⟩big] + frac{1}{2}big[a_0b_1|001⟩big] + frac{1}{2}big[a_0b_1|010⟩big] + frac{1}{2}big[a_1b_0|010⟩big] + frac{1}{2}big[a_1b_0|001⟩big] + frac{1}{2}big[2a_1b_1|011⟩big] tag{1B} $$
And actually once you take the norms with these coefficients you get
$$ |a_0 b_0|^2 + frac{1}{2} | a_0 b_1 + a_1 b_0 |^2 + |a_1 b_1|^2 neq 1 tag{2B} $$
And that makes up the gap.
EDIT Also as pointed out in the comments, the whole point of this section in the paper is to express the result in terms of the fidelity $|⟨a|b⟩|$. This answer explains how to do that.
Answered by Alexander Soare on March 21, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP