Skip to content

Commit fe83636

Browse files
committed
update
1 parent 0838260 commit fe83636

File tree

8 files changed

+638
-1140
lines changed

8 files changed

+638
-1140
lines changed

doc/pub/week6/html/week6-bs.html

Lines changed: 69 additions & 135 deletions
Large diffs are not rendered by default.

doc/pub/week6/html/week6-reveal.html

Lines changed: 65 additions & 129 deletions
Large diffs are not rendered by default.

doc/pub/week6/html/week6-solarized.html

Lines changed: 67 additions & 131 deletions
Large diffs are not rendered by default.

doc/pub/week6/html/week6.html

Lines changed: 67 additions & 131 deletions
Large diffs are not rendered by default.
0 Bytes
Binary file not shown.

doc/pub/week6/ipynb/week6.ipynb

Lines changed: 311 additions & 516 deletions
Large diffs are not rendered by default.

doc/pub/week6/pdf/week6.pdf

-5.3 KB
Binary file not shown.

doc/src/week6/week6.do.txt

Lines changed: 59 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ We can then expand our state $|\psi(\theta)\rangle$ in terms of the eigenstates
296296
and insert this in the expression for the expectation value (note that we drop the denominator in the Rayleigh-Ritz ratio)
297297
!bt
298298
\[
299-
\langle\psi(\theta)\vert \mathcal{H}\vert\psi(\theta)\rangle=\sum_{nm}c^*_mc_n\langle m\vert\mathcal{H}\vertn \rangle
299+
\langle\psi(\theta)\vert \mathcal{H}\vert\psi(\theta)\rangle=\sum_{nm}c^*_mc_n\langle m\vert\mathcal{H}\vert n \rangle
300300
=\sum_{nm}c^*_mc_nE_n\langle m\vert n \rangle=\sum_{nm}\delta_{nm}c^*_mc_nE_n=\sum_{n}\vert c_n\vert^2E_n \geq E_0\sum_{n}\vert c_n\vert^2=E_0,
301301
\]
302302
!et
@@ -456,35 +456,36 @@ expectation values of operators can be estimated via quantum computers
456456
by post-processing measurements of quantum circuits in different
457457
basis sets. To rotate bases, one uses the basis rotator $R_\sigma$ which is
458458
defined for each Pauli gate $\sigma$ to be (using the Hadamard rotation $H$ and Phase rotation $S$)
459-
459+
for a Pauli-$X$ matrix
460460
!bt
461-
\begin{align}
462-
R_{\sigma} = H, & \text{if} \ \sigma = X,
463-
\end{align} label{eq:auto8}
461+
\[
462+
X=R_{\sigma}ZR_{\sigma} = HZH
463+
\]
464464
!et
465-
and
465+
for a Pauli-$Y$ matrix
466466
!bt
467-
\begin{align}
468-
HS^{\dagger}, & \text{if} \ \sigma = Y,
469-
\end{align}
467+
\[
468+
Y=R_{\sigma}ZR_{\sigma}=HS^{\dagger}ZHS,
469+
\]
470470
!et
471471
and
472472
!bt
473-
\begin{align}
474-
I, & \text{if} \ \sigma = Z.
475-
\end{align}
473+
\[
474+
Z=R_{\sigma}ZR_{\sigma}=\bm{I}Z\bm{I}=Z.
475+
\]
476476
!et
477477

478478
!split
479479
===== Measurements of eigenvalues of the Pauli operators =====
480+
480481
We can show that these rotations allow us to measure the eigenvalues of the Pauli operators. The eigenvectors of the Pauli $X$ gate are
481482
!bt
482483
\[
483484
\vert\pm\rangle = \frac{\vert 0\rangle \pm \vert 1\rangle}{\sqrt{2}},
484485
\]
485486
!et
486487
with eigenvalues $\pm 1$.
487-
Acting on the eigenstates with the rotation in eq. (ref{eq:auto8}) gives
488+
Acting on the eigenstates with the rotation gives
488489
!bt
489490
\[
490491
H\vert +\rangle = +1\vert 0\rangle,
@@ -513,7 +514,7 @@ We then have the following expectation value for the Pauli $X$ operator
513514
\langle \vert X\vert \rangle = \langle \psi\vert X \vert \psi\rangle = |\alpha|^2 - |\beta|^2.
514515
\]
515516
!et
516-
However, we can only measure the qubits in the computational basis. Applying the rotation in eq. (ref{eq:auto8}) to our state gives
517+
However, we can only measure the qubits in the computational basis. Applying the rotation to our state gives
517518
!bt
518519
\[
519520
H \vert \psi\rangle = \alpha \vert 0\rangle - \beta \vert 1\rangle.
@@ -525,7 +526,7 @@ H \vert \psi\rangle = \alpha \vert 0\rangle - \beta \vert 1\rangle.
525526

526527
This tells us that we are able to estimate $|\alpha|^2$ and
527528
$|\beta|^2$ (and hence the expectation value of the Pauli $X$
528-
operator) by using the rotation in eq. (ref{eq:auto8}) and measure the
529+
operator) by using a rotation and measure the
529530
resulting state in the computational basis. We can show this for the
530531
Pauli $Z$ and Pauli $Y$ similarly.
531532

@@ -548,14 +549,14 @@ which follows from the fact that $HZH=X$ and $SXS^\dagger=Y$.
548549
With this, we see that the expectation value of an arbitrary
549550
Pauli-gate $\sigma$ in the state $\vert\psi\rangle$ can be expressed as a linear combination of probabilities
550551
!bt
551-
\begin{align}
552+
\begin{align*}
552553
E_{\psi}(\sigma)
553554
&= \langle \psi\vert\sigma\vert\psi\rangle \nonumber \\
554555
&=\langle\psi\vert R_{\sigma}^{\dagger}ZR_{\sigma}\vert\psi\rangle =\langle \phi\vert Z\vert \phi\rangle \nonumber \\
555556
&=\langle\phi\vert\left(\sum_{x\in\{0,1\}}(-1)^x\vert x\rangle\langle x\vert\right)\vert\phi\rangle \nonumber \\
556557
&=\sum_{x\in\{0,1\}}(-1)^x\vert\langle x\vert \phi\rangle\vert^2\nonumber \\
557558
&=\sum_{x\in\{0,1\}}(-1)^xP(\vert \phi\rangle\to\vert x\rangle),
558-
\end{align}
559+
\end{align*}
559560
!et
560561

561562
where $\vert \phi\rangle=\vert R_\sigma\phi\rangle$ and
@@ -573,7 +574,7 @@ non-trivially on the set of qubits $Q$ which is a subset of the total
573574
set of $n$ qubits in the system. Then
574575

575576
!bt
576-
\begin{align}
577+
\begin{align*}
577578
E_{\psi}\left(P\right)
578579
&=\langle \psi\vert\left(\bigotimes_{p\in Q}\sigma_p\right)\vert \psi\rangle \nonumber \\
579580
&=\langle \psi\vert\left(\bigotimes_{p\in Q}\sigma_p\right)
@@ -585,14 +586,14 @@ E_{\psi}\left(P\right)
585586
\left(\bigotimes_{p \in Q}Z_p\right)
586587
\left(\bigotimes_{q\notin Q}I_q\right)
587588
\left(\bigotimes_{p \in Q}R_{\sigma_p}\right)\vert \psi\rangle \nonumber
588-
\end{align}
589+
\end{align*}
589590
!et
590591

591592
!split
592593
===== Which gives us =====
593594

594595
!bt
595-
\begin{align}
596+
\begin{align*}
596597
E_{\psi}\left(P\right)
597598
&=
598599
\langle \phi\vert
@@ -618,7 +619,7 @@ E_{\psi}\left(P\right)
618619
\\
619620
&=
620621
\sum_{x\in\{0,1\}^n}(-1)^{\sum_{p\in Q}x_p}P(\vert \phi\rangle\to\vert x\rangle),
621-
\end{align}
622+
\end{align*}
622623
!et
623624
where $\vert \phi\rangle=\vert \bigotimes_{p\in Q}R_{\sigma_p}\psi\rangle$.
624625

@@ -696,20 +697,20 @@ terms of Pauli $X$ and $Z$ matrices, as discussed in the project text.
696697
We define a symmetric matrix $H\in {\mathbb{R}}^{2\times 2}$
697698
!bt
698699
\[
699-
H = \begin{bmatrix} H_{11} & H_{12} \\ H_{21} & H_{22}
700+
\mathcal{H} = \begin{bmatrix} \mathcal{H}_{11} & \mathcal{H}_{12} \\ \mathcal{H}_{21} & \mathcal{H}_{22}
700701
\end{bmatrix},
701702
\]
702703
!et
703-
We let $H = H_0 + H_I$, where
704+
We let $\mathcal{H} = \mathcal{H}_0 + \mathcal{H}_I$, where
704705
!bt
705706
\[
706-
H_0= \begin{bmatrix} E_1 & 0 \\ 0 & E_2\end{bmatrix},
707+
\mathcal{H}_0= \begin{bmatrix} E_1 & 0 \\ 0 & E_2\end{bmatrix},
707708
\]
708709
!et
709710
is a diagonal matrix. Similarly,
710711
!bt
711712
\[
712-
H_I= \begin{bmatrix} V_{11} & V_{12} \\ V_{21} & V_{22}\end{bmatrix},
713+
\mathcal{H}_I= \begin{bmatrix} V_{11} & V_{12} \\ V_{21} & V_{22}\end{bmatrix},
713714
\]
714715
!et
715716
where $V_{ij}$ represent various interaction matrix elements.
@@ -720,15 +721,15 @@ where $V_{ij}$ represent various interaction matrix elements.
720721

721722
We can view $H_0$ as the non-interacting solution
722723
!bt
723-
\begin{equation}
724-
H_0\vert 0 \rangle =E_1\vert 0 \rangle,
725-
\end{equation}
724+
\[
725+
\mathcal{H}_0\vert 0 \rangle =E_1\vert 0 \rangle,
726+
\]
726727
!et
727728
and
728729
!bt
729-
\begin{equation}
730-
H_0\vert 1\rangle =E_2\vert 1\rangle,
731-
\end{equation}
730+
\[
731+
\mathcal{H}_0\vert 1\rangle =E_2\vert 1\rangle,
732+
\]
732733
!et
733734
where we have defined the orthogonal computational one-qubit basis states $\vert 0\rangle$ and $\vert 1\rangle$.
734735

@@ -737,22 +738,22 @@ where we have defined the orthogonal computational one-qubit basis states $\vert
737738
We rewrite $H$ (and $H_0$ and $H_I$) via Pauli matrices
738739
!bt
739740
\[
740-
H_0 = \mathcal{E} I + \Omega \sigma_z, \quad \mathcal{E} = \frac{E_1
741+
\mathcal{H}_0 = \mathcal{E} I + \Omega \sigma_z, \quad \mathcal{E} = \frac{E_1
741742
+ E_2}{2}, \; \Omega = \frac{E_1-E_2}{2},
742743
\]
743744
!et
744745
and
745746
!bt
746747
\[
747-
H_I = c \bm{I} +\omega_z\sigma_z + \omega_x\sigma_x,
748+
\mathcal{H}_I = c \bm{I} +\omega_z\sigma_z + \omega_x\sigma_x,
748749
\]
749750
!et
750751
with $c = (V_{11}+V_{22})/2$, $\omega_z = (V_{11}-V_{22})/2$ and $\omega_x = V_{12}=V_{21}$.
751752
We let our Hamiltonian depend linearly on a strength parameter $\lambda$
752753

753754
!bt
754755
\[
755-
H=H_0+\lambda H_\mathrm{I},
756+
\mathcal{H}=\mathcal{H}_0+\lambda \mathcal{H}_\mathrm{I},
756757
\]
757758
!et
758759

@@ -835,7 +836,7 @@ We have seen how to rewrite the above $2\times 2$ eiegenvalue problem in terms o
835836
and the identity matrix $\bm{I}$. Let us make this Hamiltonian that involves only one qubit somewhat more general
836837
!bt
837838
\[
838-
\left\langle H \right\rangle = \left\langle \psi \right| H \left| \psi \right\rangle = a \cdot \left\langle \psi \right| I \left| \psi \right\rangle + b \cdot \left\langle \psi \right| Z \left| \psi \right\rangle + c \cdot \left\langle \psi \right| X \left| \psi \right\rangle + d \cdot \left\langle \psi \right| Y \left| \psi \right\rangle.
839+
\left\langle \psi \right| \mathcal{H} \left| \psi \right\rangle = a \cdot \left\langle \psi \right| I \left| \psi \right\rangle + b \cdot \left\langle \psi \right| Z \left| \psi \right\rangle + c \cdot \left\langle \psi \right| X \left| \psi \right\rangle + d \cdot \left\langle \psi \right| Y \left| \psi \right\rangle.
839840
\]
840841
!et
841842

@@ -846,15 +847,15 @@ For the $I$ operator the expectation value is always unity:
846847

847848
!bt
848849
\[
849-
\left\langle \psi \right| \bm{I} \left| \psi \right\rangle = \left\langle \psi \right|\left| \psi \right\rangle = 1.
850+
\left\langle \psi \right| \bm{I} \left| \psi \right\rangle = 1.
850851
\]
851852
!et
852853
Its contribution to the overall expectaction value is thus given by the constant $a$.
853854

854855
!split
855856
===== The Pauli matrices =====
856857

857-
For rest of the Pauli operators, we should make the following remark:
858+
For rest of the Pauli operators, we make the following remark:
858859
every one qubit quantum state $\left| \psi \right\rangle$ can be
859860
represented via different sets of basis vectors:
860861

@@ -912,7 +913,16 @@ i
912913
===== Analyzing these equations =====
913914

914915

915-
The first presented eigenvectors for each Pauli has an eigenvalue equal to $+1$: $Z \left| 0 \right\rangle = +1\left| 0 \right\rangle$, $X \left| + \right\rangle = +1\left| + \right\rangle$, $Y \left| +i \right\rangle = +1\left| +i \right\rangle$. And the second presented eigenvectors for each Pauli has an eigenvalue equal to $-1$: $Z \left| 1 \right\rangle = -1\left| 1 \right\rangle$, $X \left| - \right\rangle = -1\left| - \right\rangle$, $Y \left| -i \right\rangle = -1\left| -i \right\rangle$. Now, let's calculate the expectation values of these Pauli operators:
916+
The first presented eigenvectors for each Pauli operator have eigenvalues equal to $+1$: $Z \left| 0 \right\rangle = +1\left| 0 \right\rangle$, $X \left| + \right\rangle = +1\left| + \right\rangle$, $Y \left| +i \right\rangle = +1\left| +i \right\rangle$, respectively.
917+
918+
919+
The second eigenvectors for each Pauli operator have eigenvalues equal to $-1$: $Z \left| 1 \right\rangle = -1\left| 1 \right\rangle$, $X \left| - \right\rangle = -1\left| - \right\rangle$, $Y \left| -i \right\rangle = -1\left| -i \right\rangle$, respectively
920+
921+
922+
!split
923+
===== Explicit eigenvalues =====
924+
925+
Now, let's calculate the expectation values of these Pauli operators:
916926

917927
!bt
918928
\begin{align*}
@@ -924,73 +934,24 @@ The first presented eigenvectors for each Pauli has an eigenvalue equal to $+1$:
924934
\end{align*}
925935
!et
926936

927-
!split
928-
===== Using the inner products =====
929-
Here we have taken into account that the inner product of orthonormal vectors is 0 (e.g. $\left\langle 0 \right| \left| 1 \right\rangle = 0$, $\left\langle + \right| \left| - \right\rangle = 0$, $\left\langle +i \right| \left| -i \right\rangle = 0$).
930-
931-
932-
But what are these $\left| c \right|^2$s? The ${\left| c_1^z
933-
\right|}^2$ and ${\left| c_2^z \right|}^2$ are by definition the
934-
probabilities that after Z basis measurement (measuring is it $\left|
935-
0 \right\rangle$ or is it $\left| 1 \right\rangle$) the quantum state
936-
$\left| \psi \right\rangle$ will become $\left| 0 \right\rangle$ or
937-
$\left| 1 \right\rangle$ respectively.
938-
939-
!split
940-
===== Rethinking the basis =====
941-
942-
In order to find that value, we should run our program with our trial
943-
$\left| \psi \right\rangle$ wavefunction and do $Z$ measurement on the
944-
qubit $N$ times (it is named *shots* in the code).
945-
946-
The probability
947-
of finding the qubit after measurment in $\left| 0 \right\rangle$
948-
state will be equal to ${\left| c_1^z \right|}^2 = \frac{n_0}{N}$,
949-
where $n_0$ is the number of the $\left| 0 \right\rangle$ state
950-
measurments. Similarly, ${\left| c_2^z \right|}^2 = \frac{n_1}{N}$,
951-
where $n_1$ is the number of the $\left| 1 \right\rangle$ state
952-
measurments.
953-
954-
Thus, the final expectation value will be $\left\langle Z\right\rangle = \frac{n_0 - n_1}{N}$.
955-
956-
957-
!split
958-
===== Measurements =====
959-
960-
For $\left\langle X \right\rangle = \frac{n_+ - n_-}{N}$ and
961-
$\left\langle Y \right\rangle = \frac{n_{+i} - n_{-i}}{N}$ the
962-
expectation value estimation procedure stays the same.
963-
964-
Here $n_+$ and $n_-$ are numbers of measurements in X basis that
965-
corresponds to $\left| + \right\rangle$ or $\left| - \right\rangle$
966-
outcomes respectively. And $n_{+i}$ and $n_{-i}$ are numbers of
967-
measurements in $Y$ basis that corresponds to $\left| +i
968-
\right\rangle$ or $\left| -i \right\rangle$ outcomes respectively.
969-
970937

971938
!split
972939
===== Computational basis =====
973940

974-
The difficulty comes from the fact that one may have the possibility
975-
to measure only in the $Z$ basis. To solve this difficulty we still do
976-
a $Z$ basis measurement, but, before that, we apply specific operators
977-
to the $\left| \psi \right\rangle$ state.
978-
979-
We try to apply such an
980-
operator that after measuring the probability of $\left| 0
981-
\right\rangle$ outcome will be equal to the probability of $\left| +
982-
\right\rangle$ $\left( \left| +i \right\rangle \right)$ outcome.
941+
The above equations require that we can make measurements in the chosen basis sets.
983942

984-
And the probability of $\left| 1 \right\rangle$ outcome will be equal to
985-
the probability of $\left| - \right\rangle$ $\left( \left| -i \right\rangle \right)$ outcome.
943+
However, this may not be possible. The difficulty comes from the fact that one may have the possibility
944+
to measure only in the $Z$-basis. To solve this difficulty we still do
945+
a $Z$-basis measurement, but, before that, we apply specific operators
946+
to the $\left| \psi \right\rangle$ state.
986947

987948
!split
988949
===== Unitary transformation of $\bm{X}$ =====
989950

990951
If we use the Hadamard gate
991952
!bt
992953
\[
993-
\bm{H} = \frac{1}{\sqrt{2}}\begin{pmatrix}
954+
H = \frac{1}{\sqrt{2}}\begin{pmatrix}
994955
1 & 1\\
995956
1 & -1
996957
\end{pmatrix},
@@ -999,7 +960,7 @@ If we use the Hadamard gate
999960
we can rewrite
1000961
!bt
1001962
\[
1002-
\bm{X}=\bm{H}\bm{Z}\bm{H}.
963+
X=HZH.
1003964
\]
1004965
!et
1005966

@@ -1012,15 +973,15 @@ For the one-qubit Hamiltonian we have toyed with till now, we can thus
1012973
rewrite in an easy way the Hamiltonian so that we can perform
1013974
measurements using our favorite computational basis.
1014975

1015-
The transformation of the Pauli $\bm{X}$ matrix can be generalized, as
1016-
we will see in more detail next week for the two-qubit Hamiltonian and
976+
The transformation of the Pauli-$\bm{X}$ matrix can be generalized, as
977+
we will see in more detail below for the two-qubit Hamiltonian and next week for
1017978
the Lipkin model, to the following expression
1018979
!bt
1019980
\[
1020-
{\cal P}=\bm{U}^{\dagger}\bm{M}\bm{U},
981+
\mathcal{P}=\bm{U}^{\dagger}\bm{M}\bm{U},
1021982
\]
1022983
!et
1023-
where ${\cal P}$ represents some combination of the Pauli matrices and
984+
where $\mathcal{P}$ represents some combination of the Pauli matrices and
1024985
the identity matrix, $\bm{U}$ is a unitary matrix and $\bm{M}$
1025986
represents the gate/matrix which performs the measurements, often
1026987
represented by a Pauli $\bm{Z}$ gate/matrix.

0 commit comments

Comments
 (0)