Skip to content

Commit 9e05924

Browse files
committed
week 2 update
1 parent 6904c37 commit 9e05924

File tree

8 files changed

+741
-876
lines changed

8 files changed

+741
-876
lines changed

doc/pub/week2/html/week2-bs.html

Lines changed: 118 additions & 107 deletions
Large diffs are not rendered by default.

doc/pub/week2/html/week2-reveal.html

Lines changed: 95 additions & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -219,16 +219,20 @@ <h2 id="this-week-s-plans">This week's plans </h2>
219219
<p><li> Bloch sphere and representation of qubits</li>
220220
<p><li> Spectral Decomposition (again), Measurements and Density matrices</li>
221221
<p><li> Wavefunction collapse as a result of measurement</li>
222+
<p><li> Entaglement and relations to density matrices</li>
222223
<p><li> <a href="https://youtu.be/" target="_blank">Video of lecture to be added</a>
223224
<!-- o <a href="https://github.com/CompPhysics/QuantumComputingMachineLearning/blob/gh-pages/doc/HandWrittenNotes/2024/NotesJanuary24.pdf" target="_blank">Whiteboard notes</a> --></li>
224225
</ol>
225226
</div>
227+
</section>
226228

227-
228-
<!-- * <b>Reading recommendation</b>: Scherer, Mathematics of Quantum Computations, chapter 3.1-3.3 and Hundt, Quantum Computing for Programmers, chapter 2.1-2.5. Hundt's text is relevant for the programming part where we build from scratch the ingredients we will need. -->
229-
229+
<section>
230+
<h2 id="readings">Readings </h2>
231+
<ul>
232+
<p><li> <b>Reading recommendation</b>: Scherer, Mathematics of Quantum Computations, parts of chapter 2 and sections 3.1-3.3 and Hundt, Quantum Computing for Programmers, chapter 2.1-2.5. Hundt's text is relevant for the programming part where we build from scratch the ingredients we will need.
230233
<!-- The code examples presented by Keran are at -->
231-
<!-- <a href="https://github.com/CompPhysics/QuantumComputingMachineLearning/blob/gh-pages/doc/pub/week2/ipynb/codeskeran.ipynb" target="_blank"><tt>https://github.com/CompPhysics/QuantumComputingMachineLearning/blob/gh-pages/doc/pub/week2/ipynb/codeskeran.ipynb</tt></a> -->
234+
<!-- <a href="https://github.com/CompPhysics/QuantumComputingMachineLearning/blob/gh-pages/doc/pub/week2/ipynb/codeskeran.ipynb" target="_blank"><tt>https://github.com/CompPhysics/QuantumComputingMachineLearning/blob/gh-pages/doc/pub/week2/ipynb/codeskeran.ipynb</tt></a> --></li>
235+
</ul>
232236
</section>
233237

234238
<section>
@@ -487,7 +491,8 @@ <h2 id="explicit-results">Explicit results </h2>
487491
</section>
488492

489493
<section>
490-
<h2 id="the-spectral-decomposition-from-last-week">The spectral decomposition, from last week </h2>
494+
<h2 id="the-spectral-decomposition">The spectral decomposition </h2>
495+
491496
<p>The results from the previous slide gives us
492497
the following spectral decomposition of \( \boldsymbol{A} \)
493498
</p>
@@ -509,10 +514,27 @@ <h2 id="the-spectral-decomposition-from-last-week">The spectral decomposition, f
509514

510515
<section>
511516
<h2 id="bloch-sphere">Bloch sphere </h2>
517+
518+
<p>Classically, in a binary system, the bits take only two distinct
519+
values, either \( 0 \) or \( 1 \). The quantum mechanical counterpart is
520+
given by two state vectors (our simple computational basis)
521+
\( \vert 0 \rangle \) and \( \vert 1\rangle \) which can be used to realize the
522+
superposition
523+
</p>
524+
<p>&nbsp;<br>
525+
$$
526+
\vert \psi \rangle = \alpha \vert 0 \rangle +\beta\vert 1\rangle,
527+
$$
528+
<p>&nbsp;<br>
529+
530+
<p>which can be represented using the so-called Bloch sphere, depicted on the next slide (best seen using the jupyter-notebook).</p>
512531
</section>
513532

514533
<section>
515534
<h2 id="meet-the-bloch-sphere">Meet the Bloch sphere </h2>
535+
<p>The Bloch shere gives a vialable way to visualize a qubit and itsv possible realizations in terms of the angles \( 0\le \theta \le \pi \) and
536+
\( 0\le \phi \le 2\pi \).
537+
</p>
516538

517539
<!-- code=python (!bc pycod) typeset with pygments style "perldoc" -->
518540
<div class="cell border-box-sizing code_cell rendered">
@@ -522,12 +544,31 @@ <h2 id="meet-the-bloch-sphere">Meet the Bloch sphere </h2>
522544
<div class="highlight" style="background: #eeeedd">
523545
<pre style="font-size: 80%; line-height: 125%;"><span style="color: #8B008B; font-weight: bold">import</span> <span style="color: #008b45; text-decoration: underline">numpy</span> <span style="color: #8B008B; font-weight: bold">as</span> <span style="color: #008b45; text-decoration: underline">np</span>
524546
<span style="color: #8B008B; font-weight: bold">from</span> <span style="color: #008b45; text-decoration: underline">qiskit.visualization</span> <span style="color: #8B008B; font-weight: bold">import</span> plot_bloch_vector
525-
526547
plot_bloch_vector([<span style="color: #B452CD">0</span>,<span style="color: #B452CD">1</span>,<span style="color: #B452CD">0</span>], title=<span style="color: #CD5555">&quot;New Bloch Sphere&quot;</span>)
548+
</pre>
549+
</div>
550+
</div>
551+
</div>
552+
</div>
553+
<div class="output_wrapper">
554+
<div class="output">
555+
<div class="output_area">
556+
<div class="output_subarea output_stream output_stdout output_text">
557+
</div>
558+
</div>
559+
</div>
560+
</div>
561+
</div>
527562

528-
<span style="color: #228B22"># You can use spherical coordinates instead of cartesian. </span>
563+
<p>You can use spherical coordinates instead of cartesian ones.</p>
529564

530-
plot_bloch_vector([<span style="color: #B452CD">1</span>, np.pi/<span style="color: #B452CD">2</span>, np.pi/<span style="color: #B452CD">3</span>], coord_type=<span style="color: #CD5555">&#39;spherical&#39;</span>)
565+
<!-- code=python (!bc pycod) typeset with pygments style "perldoc" -->
566+
<div class="cell border-box-sizing code_cell rendered">
567+
<div class="input">
568+
<div class="inner_cell">
569+
<div class="input_area">
570+
<div class="highlight" style="background: #eeeedd">
571+
<pre style="font-size: 80%; line-height: 125%;">plot_bloch_vector([<span style="color: #B452CD">1</span>, np.pi/<span style="color: #B452CD">2</span>, np.pi/<span style="color: #B452CD">3</span>], coord_type=<span style="color: #CD5555">&#39;spherical&#39;</span>)
531572
</pre>
532573
</div>
533574
</div>
@@ -542,6 +583,13 @@ <h2 id="meet-the-bloch-sphere">Meet the Bloch sphere </h2>
542583
</div>
543584
</div>
544585
</div>
586+
587+
<p>Using the Bloch sphere representation of the qubit \( \vert \psi \rangle = \alpha \vert 0 \rangle +\beta\vert 1\rangle \), we can rewrite it as</p>
588+
<p>&nbsp;<br>
589+
$$
590+
\vert \psi \rangle = \cos{(\frac{\theta}{2})} \vert 0 \rangle +\sin{(\frac{\theta}{2})}\exp{(\imath\phi)}\vert 1\rangle,
591+
$$
592+
<p>&nbsp;<br>
545593
</section>
546594

547595
<section>
@@ -652,7 +700,7 @@ <h2 id="binary-example-system">Binary example system </h2>
652700
</section>
653701

654702
<section>
655-
<h2 id="superposition-state">Superposition state </h2>
703+
<h2 id="superposition-of-states">Superposition of states </h2>
656704

657705
<p>Assume thereafter that we have a state \( \vert \psi\rangle \) which is a superposition of the above two qubit states</p>
658706
<p>&nbsp;<br>
@@ -749,11 +797,15 @@ <h2 id="computing-matrix-products">Computing matrix products </h2>
749797
<p>and computing the matrix product \( \boldsymbol{P}_0\vert\psi\rangle\langle \psi\vert \) gives</p>
750798
<p>&nbsp;<br>
751799
$$
752-
\boldsymbol{P}_0\vert\psi\rangle\langle \psi\vert=\begin{bmatrix} 1 & 0 \\ 0 & 0\end{bmatrix}\begin{bmatrix} \vert \alpha \vert^2 & \alpha\beta^* \\ \alpha^*\beta & \vert\beta\vert^2\end{bmatrix}=\begin{bmatrix} \vert \alpha \vert^2 & \alpha\beta^* \\ 0 & 0\end{bmatrix},
800+
\boldsymbol{P}_0\vert\psi\rangle\langle \psi\vert=\begin{bmatrix} 1 & 0 \\ 0 & 0\end{bmatrix}\begin{bmatrix} \vert \alpha \vert^2 & \alpha\beta^* \\ \alpha^*\beta & \vert\beta\vert^2\end{bmatrix}=\begin{bmatrix} \vert \alpha \vert^2 & \alpha\beta^* \\ 0 & 0\end{bmatrix}.
753801
$$
754802
<p>&nbsp;<br>
803+
</section>
804+
805+
<section>
806+
<h2 id="taking-the-trace">Taking the trace </h2>
755807

756-
<p>and taking the trace of this matrix, that is computing</p>
808+
<p>Taking the trace of the above matrix, that is computing</p>
757809
<p>&nbsp;<br>
758810
$$
759811
\mathrm{Prob}(\psi(0))=\mathrm{Tr}\left[\boldsymbol{P}_0^{\dagger}\boldsymbol{P}_0\vert \psi\rangle\langle \psi\vert\right]=\vert \alpha\vert^2,
@@ -786,6 +838,10 @@ <h2 id="outcome-probability">Outcome probability </h2>
786838
\boldsymbol{P}_{\psi(1)}=\langle \psi\vert \boldsymbol{P}_1^{\dagger}\boldsymbol{P}_1\vert \psi\rangle=\vert \beta\vert^2.
787839
$$
788840
<p>&nbsp;<br>
841+
</section>
842+
843+
<section>
844+
<h2 id="extending-the-expressions">Extending the expressions </h2>
789845

790846
<p>We can now extend these expressions to the complete ensemble of measurements. Using the spectral decomposition we have that the probability of an outcome \( p(x) \) is</p>
791847
<p>&nbsp;<br>
@@ -870,6 +926,7 @@ <h2 id="first-entanglement-encounter-two-qubit-system">First entanglement encoun
870926

871927
<section>
872928
<h2 id="computational-basis">Computational basis </h2>
929+
873930
<p>This leads to the many-body computational basis states</p>
874931

875932
<p>&nbsp;<br>
@@ -923,6 +980,7 @@ <h2 id="bell-states">Bell states </h2>
923980

924981
<section>
925982
<h2 id="the-next-two">The next two </h2>
983+
926984
<p>&nbsp;<br>
927985
$$
928986
\vert \Psi^+\rangle = \frac{1}{\sqrt{2}}\left[\vert 10\rangle +\vert 01\rangle\right]=\frac{1}{\sqrt{2}}\begin{bmatrix} 0 \\ 1 \\ 1 \\ 0\end{bmatrix},
@@ -942,6 +1000,7 @@ <h2 id="the-next-two">The next two </h2>
9421000

9431001
<section>
9441002
<h2 id="measurement">Measurement </h2>
1003+
9451004
<p>Measuring one of the qubits of one of the above Bell states,
9461005
automatically determines, as we will see below, the state of the
9471006
second qubit. To convince ourselves about this, let us assume we perform a measurement on the qubit in system \( A \) by introducing the projections with outcomes \( 0 \) or \( 1 \) as
@@ -1112,143 +1171,57 @@ <h2 id="maximally-entangled">Maximally entangled </h2>
11121171
</section>
11131172

11141173
<section>
1115-
<h2 id="two-qubit-system-and-calculation-of-density-matrices-and-exercise">Two-qubit system and calculation of density matrices and exercise </h2>
1116-
1117-
<b>This part is best seen using the jupyter-notebook</b>.
1118-
1119-
<p>The system we discuss here is a continuation of the two qubit example from week 2.</p>
1174+
<h2 id="second-exercise-set">Second exercise set </h2>
11201175

1121-
<p>This system can be thought of as composed of two subsystems
1122-
\( A \) and \( B \). Each subsystem has computational basis states
1123-
</p>
1124-
1125-
<p>&nbsp;<br>
1126-
$$
1127-
\vert 0\rangle_{\mathrm{A,B}}=\begin{bmatrix} 1 & 0\end{bmatrix}^T \hspace{1cm} \vert 1\rangle_{\mathrm{A,B}}=\begin{bmatrix} 0 & 1\end{bmatrix}^T.
1128-
$$
1129-
<p>&nbsp;<br>
1130-
1131-
<p>The subsystems could represent single particles or composite many-particle systems of a given symmetry.
1132-
This leads to the many-body computational basis states
1176+
<p>We bring back the last two exercises from last week as they are meant to build the basis for
1177+
the two projects we will work on during the semester. The first
1178+
project deals with implementing the so-called
1179+
<b>Variational Quantum Eigensolver</b> algorithm for finding the eigenvalues and eigenvectors of selected Hamiltonians.
11331180
</p>
1181+
</section>
11341182

1135-
<p>&nbsp;<br>
1136-
$$
1137-
\vert 00\rangle = \vert 0\rangle_{\mathrm{A}}\otimes \vert 0\rangle_{\mathrm{B}}=\begin{bmatrix} 1 & 0 & 0 &0\end{bmatrix}^T,
1138-
$$
1139-
<p>&nbsp;<br>
1140-
1141-
<p>and</p>
1142-
<p>&nbsp;<br>
1143-
$$
1144-
\vert 01\rangle = \vert 0\rangle_{\mathrm{A}}\otimes \vert 1\rangle_{\mathrm{B}}=\begin{bmatrix} 0 & 1 & 0 &0\end{bmatrix}^T,
1145-
$$
1146-
<p>&nbsp;<br>
1147-
1148-
<p>and</p>
1149-
<p>&nbsp;<br>
1150-
$$
1151-
\vert 10\rangle = \vert 1\rangle_{\mathrm{A}}\otimes \vert 0\rangle_{\mathrm{B}}=\begin{bmatrix} 0 & 0 & 1 &0\end{bmatrix}^T,
1152-
$$
1153-
<p>&nbsp;<br>
1154-
1155-
<p>and finally</p>
1156-
<p>&nbsp;<br>
1157-
$$
1158-
\vert 11\rangle = \vert 1\rangle_{\mathrm{A}}\otimes \vert 1\rangle_{\mathrm{B}}=\begin{bmatrix} 0 & 0 & 0 &1\end{bmatrix}^T.
1159-
$$
1160-
<p>&nbsp;<br>
1161-
1162-
<p>These computational basis states define also the eigenstates of the non-interacting Hamiltonian</p>
1163-
<p>&nbsp;<br>
1164-
$$
1165-
H_0\vert 00 \rangle = \epsilon_{00}\vert 00 \rangle,
1166-
$$
1167-
<p>&nbsp;<br>
1168-
1169-
<p>&nbsp;<br>
1170-
$$
1171-
H_0\vert 10 \rangle = \epsilon_{10}\vert 10 \rangle,
1172-
$$
1173-
<p>&nbsp;<br>
1174-
1175-
<p>&nbsp;<br>
1176-
$$
1177-
H_0\vert 01 \rangle = \epsilon_{01}\vert 01 \rangle,
1178-
$$
1179-
<p>&nbsp;<br>
1180-
1181-
<p>and</p>
1182-
<p>&nbsp;<br>
1183-
$$
1184-
H_0\vert 11 \rangle = \epsilon_{11}\vert 11 \rangle.
1185-
$$
1186-
<p>&nbsp;<br>
1187-
1188-
<p>The interacting part of the Hamiltonian \( H_{\mathrm{I}} \) is given by the tensor product of two \( \sigma_x \) and \( \sigma_z \) matrices, respectively, that is</p>
1189-
<p>&nbsp;<br>
1190-
$$
1191-
H_{\mathrm{I}}=H_x\sigma_x\otimes\sigma_x+H_z\sigma_z\otimes\sigma_z,
1192-
$$
1193-
<p>&nbsp;<br>
1194-
1195-
<p>where \( H_x \) and \( H_z \) are interaction strength parameters. Our final Hamiltonian matrix is given by</p>
1196-
<p>&nbsp;<br>
1197-
$$
1198-
\boldsymbol{H}=\begin{bmatrix} \epsilon_{00}+H_z & 0 & 0 & H_x \\
1199-
0 & \epsilon_{10}-H_z & H_x & 0 \\
1200-
0 & H_x & \epsilon_{01}-H_z & 0 \\
1201-
H_x & 0 & 0 & \epsilon_{11} +H_z \end{bmatrix}.
1202-
$$
1203-
<p>&nbsp;<br>
1183+
<section>
1184+
<h2 id="ex1-one-qubit-basis-and-pauli-matrices">Ex1: One-qubit basis and Pauli matrices </h2>
12041185

1205-
<p>The four eigenstates of the above Hamiltonian matrix can in turn be used to
1206-
define density matrices. As an example, the density matrix of the
1207-
first eigenstate (lowest energy \( E_0 \)) \( \Psi_0 \) is given by the outerproduct
1208-
</p>
1186+
<p>Write a function which sets up a one-qubit basis and apply the various Pauli matrices to these basis states.</p>
1187+
</section>
12091188

1210-
<p>&nbsp;<br>
1211-
$$
1212-
\rho_0=\left(\alpha_{00}\vert 00 \rangle+\alpha_{10}\vert 10 \rangle+\alpha_{01}\vert 01 \rangle+\alpha_{11}\vert 11 \rangle\right)\left(\alpha_{00}^*\langle 00\vert+\alpha_{10}^*\langle 10\vert+\alpha_{01}^*\langle 01\vert+\alpha_{11}^*\langle 11\vert\right),
1213-
$$
1214-
<p>&nbsp;<br>
1189+
<section>
1190+
<h2 id="ex2-hadamard-and-phase-gates">Ex2: Hadamard and Phase gates </h2>
12151191

1216-
<p>where the coefficients \( \alpha_{ij} \) are the eigenvector coefficients
1217-
resulting from the solution of the above eigenvalue problem.
1218-
</p>
1192+
<p>Apply the Hadamard and Phase gates to the same one-qubit basis states and study their actions on these states.</p>
1193+
</section>
12191194

1220-
<p>We can
1221-
then in turn define the density matrix for the subsets \( A \) or \( B \) as
1222-
</p>
1195+
<section>
1196+
<h2 id="ex3-traces-of-operators">Ex3: Traces of operators </h2>
12231197

1198+
<p>Prove that the trace is cyclic, that is for three operators \( \boldsymbol{A} \), \( \boldsymbol{B} \) and \( \boldsymbol{C} \), we have</p>
12241199
<p>&nbsp;<br>
12251200
$$
1226-
\rho_A=\mathrm{Tr}_B(\rho_{0})=\langle 0 \vert \rho_{0} \vert 0\rangle_{B}+\langle 1 \vert \rho_{0} \vert 1\rangle_{B},
1201+
\mathrm{Tr}\{\boldsymbol{ABC}\}=\mathrm{Tr}\{\boldsymbol{CAB}\}=\mathrm{Tr}\{\boldsymbol{BCA}\}.
12271202
$$
12281203
<p>&nbsp;<br>
1204+
</section>
12291205

1230-
<p>or</p>
1206+
<section>
1207+
<h2 id="ex4-exponentiated-operators">Ex4: Exponentiated operators </h2>
12311208

1209+
<p>Let \( \boldsymbol{A} \) be an operator on a vector space satisfying \( \boldsymbol{A}^2=1 \) and \( \alpha \) any real constant. Show that</p>
12321210
<p>&nbsp;<br>
12331211
$$
1234-
\rho_B=\mathrm{Tr}_A(\rho_0)=\langle 0 \vert \rho_{0} \vert 0\rangle_{A}+\langle 1 \vert \rho_{0} \vert 1\rangle_{A}.
1212+
\exp{\imath\alpha \boldsymbol{A}}=\sum_{n=0}^{\infty} \frac{(i\alpha)^n}{n!}\boldsymbol{A}^n=\boldsymbol{I}\cos{\alpha}+\imath\boldsymbol{A}\sin{\alpha}.
12351213
$$
12361214
<p>&nbsp;<br>
12371215

1238-
<p>The density matrices for these subsets can be used to compute the
1239-
so-called von Neumann entropy, which is one of the possible measures
1240-
of entanglement. A pure state has entropy equal zero while entangled
1241-
state have an entropy larger than zero. The von-Neumann entropy is
1242-
defined as
1243-
</p>
1216+
<p>Does this apply to the Pauli matrices?</p>
12441217
</section>
12451218

12461219
<section>
12471220
<h2 id="the-next-lecture">The next lecture </h2>
12481221

12491222
<p>In our next lecture, we will discuss</p>
12501223
<ol>
1251-
<p><li> Reminder and review of entropy and entanglement</li>
1224+
<p><li> Discussion of ntropy and entanglement</li>
12521225
<p><li> Gates and circuits and how to perform operations on states</li>
12531226
</ol>
12541227
<p>

0 commit comments

Comments
 (0)