Skip to content

Commit 2bafc96

Browse files
committed
Add clarifications for Hadamard test
1 parent 81c6b7d commit 2bafc96

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

intro.Rmd

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -578,10 +578,9 @@ Can you tell what is the expected value of the observable $Z$ of the ancilla qub
578578

579579
<!-- Solution: it's just $\braket{\psi U \psi}$ -->
580580

581-
However, we might be interested in the imaginary part of
582-
$\braket{\psi|U|\psi}$. To estimate that, we need to slightly change the
581+
With the method described we can estimate the real part of $\braket{\psi|U|\psi}$ however, being it a complex number, in order to fully describe it we need a procedure to estimate also its imaginary part. To estimate that, we need to slightly change the
583582
circuit. After the first Hadamard gate, we apply on the ancilla qubit a
584-
phase gate $S$, which gives to the state $\ket{1}$ a phase of $-i$. To get
583+
phase gate $S$, which gives to the state $\ket{1}$ a phase of $-i$. This operation may be interpreted as a 90 degrees rotation, enabling us to swap the real and imaginary axis to then make a measurement on the imaginary one. To get
585584
the intuition behind this, let's recall that the imaginary part of a
586585
complex number $z=(a+ib)$ is defined as:
587586
$\text{Im}(z)= \frac{z-z^\ast}{2i}=\frac{i(z-z^\ast)}{-2}= \frac{-2b}{-2} =b$,
@@ -609,8 +608,7 @@ Note that when taking the conjugate of our state, we changed the sign of
609608
$i$. We now have only to convince ourselves that
610609
$-i\braket{\psi|U|\psi} + i \braket{\psi|U^\dagger|\psi} = i\braket{\psi|U^\dagger -U|\psi}$
611610
is indeed the real number corresponding to
612-
$2\text{Im}(\braket{\psi| U|\psi})$, and thus the whole equation can be a
613-
probability.
611+
$2\text{Im}(\braket{\psi| U|\psi})$, and thus the probability of state 0 is expressed in function of the imaginary part of $\braket{\psi| U|\psi}$.
614612

615613
::: {.exercise}
616614
Can you check if the $S$ gate that we do after the first Hadamard can be performed before the last Hadamard gate instead?

0 commit comments

Comments
 (0)