Skip to content

Commit 8832141

Browse files
committed
update week 11
1 parent dba51ee commit 8832141

7 files changed

Lines changed: 2092 additions & 242 deletions

File tree

doc/pub/week11/html/week11-bs.html

Lines changed: 285 additions & 24 deletions
Large diffs are not rendered by default.

doc/pub/week11/html/week11-reveal.html

Lines changed: 295 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
1010
<meta name="generator" content="DocOnce: https://github.com/doconce/doconce/" />
1111
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
12-
<meta name="description" content="April 1-5, 2024: Quantum Computing, Quantum Machine Learning and Quantum Information Theories">
13-
<title>April 1-5, 2024: Quantum Computing, Quantum Machine Learning and Quantum Information Theories</title>
12+
<meta name="description" content="Quantum Computing, Quantum Machine Learning and Quantum Information Theories">
13+
<title>Quantum Computing, Quantum Machine Learning and Quantum Information Theories</title>
1414

1515
<!-- reveal.js: https://lab.hakim.se/reveal-js/ -->
1616

@@ -168,7 +168,7 @@
168168
<section>
169169
<!-- ------------------- main content ---------------------- -->
170170
<center>
171-
<h1 style="text-align: center;">April 1-5, 2024: Quantum Computing, Quantum Machine Learning and Quantum Information Theories</h1>
171+
<h1 style="text-align: center;">Quantum Computing, Quantum Machine Learning and Quantum Information Theories</h1>
172172
</center> <!-- document title -->
173173

174174
<!-- author(s): Morten Hjorth-Jensen -->
@@ -184,7 +184,7 @@ <h1 style="text-align: center;">April 1-5, 2024: Quantum Computing, Quantum Mach
184184
</center>
185185
<br>
186186
<center>
187-
<h4>April 3, 2024</h4>
187+
<h4>April 2, 2025</h4>
188188
</center> <!-- date -->
189189
<br>
190190

@@ -195,7 +195,7 @@ <h4>April 3, 2024</h4>
195195
</section>
196196

197197
<section>
198-
<h2 id="plans-for-the-week-of-april-1-5-2024">Plans for the week of April 1-5, 2024 </h2>
198+
<h2 id="plans-for-the-week-of-march-31-april-4-2025">Plans for the week of March 31-April 4, 2025 </h2>
199199

200200
<div class="alert alert-block alert-block alert-text-normal">
201201
<b></b>
@@ -205,8 +205,8 @@ <h2 id="plans-for-the-week-of-april-1-5-2024">Plans for the week of April 1-5, 2
205205
<p><li> Quantum Fourier transforms (QFTs), basic mathematical expressions</li>
206206
<p><li> Setting up circuits for QFT</li>
207207
<p><li> Reading recommendation Hundt, Quantum Computing for Programmers, sections 6.1-6.4 on QFT.</li>
208-
<p><li> <a href="https://youtu.be/XxifXp4M2Fk" target="_blank">Video of lecture</a></li>
209-
<p><li> <a href="https://github.com/CompPhysics/QuantumComputingMachineLearning/blob/gh-pages/doc/HandWrittenNotes/2024/NotesApril3.pdf" target="_blank">Whiteboard notes</a></li>
208+
<p><li> <a href="https://youtu.be/" target="_blank">Video of lecture TBA</a>
209+
<!-- o <a href="https://github.com/CompPhysics/QuantumComputingMachineLearning/blob/gh-pages/doc/HandWrittenNotes/2024/NotesApril3.pdf" target="_blank">Whiteboard notes</a> --></li>
210210
</ol>
211211
</div>
212212
</section>
@@ -225,10 +225,9 @@ <h2 id="possible-paths-for-project-2">Possible paths for project 2 </h2>
225225
</ol>
226226
<p>
227227
<p><li> Study the solution of quantum mechanical eigenvalue problems with systems from atomic/molecular physics and quantum chemistry</li>
228-
<p><li> Quantum machine learning projects, quantum boltzmann machines or related topics</li>
228+
<p><li> Quantum machine learning projects, quantum boltzmann machines or related topics
229+
<!-- For project 2, in order to be time efficient, you can use software like Qiskit, Pennylane, qBraid and/or other --></li>
229230
</ul>
230-
<p>
231-
<p>For project 2, in order to be time efficient, you can use software like Qiskit, Pennylane, qBraid and/or other</p>
232231
</section>
233232

234233
<section>
@@ -1128,14 +1127,293 @@ <h2 id="proceeding">Proceeding </h2>
11281127
</section>
11291128

11301129
<section>
1131-
<h2 id="plans-for-the-week-of-april-8-12">Plans for the week of April 8-12 </h2>
1130+
<h2 id="qft">QFT </h2>
11321131

1133-
<ol>
1134-
<p><li> Finalize our discussion of QFTs</li>
1135-
<p><li> Implementing the QFT algorithm</li>
1136-
<p><li> Implementing the phase estimation algorithm for finding eigenvalues</li>
1137-
<p><li> Discussions of Simon's algorithm</li>
1138-
</ol>
1132+
<p>The Quantum Fourier Transform (QFT) has mathematically the same equation as starting point
1133+
but the notation is generally different. We generally compute the
1134+
quantum Fourier transform on a set of orthonormal basis state vectors
1135+
\(|0\rangle, |1\rangle, ..., |N-1\rangle\). The linear operator defining
1136+
the transform is given by the action on basis states
1137+
</p>
1138+
1139+
<p>&nbsp;<br>
1140+
$$
1141+
|j\rangle \mapsto \frac{1}{\sqrt{N}} \sum_{k=0}^{N-1} e^{2\pi ijk/N}|k\rangle.
1142+
$$
1143+
<p>&nbsp;<br>
1144+
</section>
1145+
1146+
<section>
1147+
<h2 id="in-terms-of-arbitrary-states">In terms of arbitrary states </h2>
1148+
1149+
<p>This can be written on arbitrary states,</p>
1150+
<p>&nbsp;<br>
1151+
$$
1152+
\sum_{j=0}^{N-1}x_j|j\rangle \mapsto \sum_{k=0}^{N-1} y_k|k\rangle
1153+
$$
1154+
<p>&nbsp;<br>
1155+
1156+
<p>where each amplitude \(y_k\) is the discrete Fourier transform of
1157+
\(x_j\).
1158+
</p>
1159+
</section>
1160+
1161+
<section>
1162+
<h2 id="unitarity">Unitarity </h2>
1163+
1164+
<p>The quantum Fourier transform is unitary. Taking \(N = 2^n\),
1165+
for \(n\) qubits gives us the orthonormal (computational) basis
1166+
</p>
1167+
<p>&nbsp;<br>
1168+
$$
1169+
|0\rangle, |1\rangle, ..., |2^{n}-1\rangle.
1170+
$$
1171+
<p>&nbsp;<br>
1172+
</section>
1173+
1174+
<section>
1175+
<h2 id="binary-representation">Binary representation </h2>
1176+
1177+
<p>Each of the computational basis states can be represented in binary</p>
1178+
<p>&nbsp;<br>
1179+
$$
1180+
j = j_1j_2 \cdots j_n
1181+
$$
1182+
<p>&nbsp;<br>
1183+
1184+
<p>where each \(j_k\) is either \(0\) or \(1\), and the corresponding
1185+
binary vector is \(|j_1j_2 \cdots j_n\rangle\).
1186+
</p>
1187+
</section>
1188+
1189+
<section>
1190+
<h2 id="rewriting-the-qft">Rewriting the QFT </h2>
1191+
1192+
<p>The quantum Fourier
1193+
transform on one of these \(n\)-qubit vectors can be written as,
1194+
</p>
1195+
1196+
<p>&nbsp;<br>
1197+
$$
1198+
\begin{align*}
1199+
|j_1j_2 \cdots j_n \rangle = \frac{\left(|0\rangle +e^{2\pi i0.j_n}|1\rangle\right) \otimes \left(|0\rangle +e^{2\pi i0.j_{n-1}j_n}|1\rangle\right) \otimes \cdots \otimes \left(|0\rangle +e^{2\pi i0.j_1j_2 \cdots j_n}|1\rangle\right)}{2^{n/2}}
1200+
\end{align*}
1201+
$$
1202+
<p>&nbsp;<br>
1203+
</section>
1204+
1205+
<section>
1206+
<h2 id="short-hand-notation">Short hand notation </h2>
1207+
1208+
<p>In the above, we use the notation</p>
1209+
1210+
<p>&nbsp;<br>
1211+
$$
1212+
0.j_lj_{l+1} \cdots j_n = \frac{j_l}{2} + \frac{j_{l+1}}{2^2} + \cdots + \frac{j_n}{2^{n-l+1}}
1213+
$$
1214+
<p>&nbsp;<br>
1215+
1216+
<p>If we start counting from zero, that is we have instead</p>
1217+
<p>&nbsp;<br>
1218+
$$
1219+
\begin{align*}
1220+
|j_0j_1 \cdots j_{n-1} \rangle = \frac{\left(|0\rangle +e^{2\pi i0.j_{n-1}}|1\rangle\right) \otimes \left(|0\rangle +e^{2\pi i0.j_{n-2}j_n}|1\rangle\right) \otimes \cdots \otimes \left(|0\rangle +e^{2\pi i0.j_0j_1 \cdots j_{n-1}}|1\rangle\right)}{2^{n/2}},
1221+
\end{align*}
1222+
$$
1223+
<p>&nbsp;<br>
1224+
1225+
<p>we get</p>
1226+
<p>&nbsp;<br>
1227+
$$
1228+
0.j_lj_{l+1} \cdots j_{n-1} = \frac{j_l}{2} + \frac{j_{l+1}}{2^2} + \cdots + \frac{j_{n-1}}{2^{n-l}}
1229+
$$
1230+
<p>&nbsp;<br>
1231+
</section>
1232+
1233+
<section>
1234+
<h2 id="four-qubit-system">Four qubit system </h2>
1235+
<p>The basis states are</p>
1236+
<p>&nbsp;<br>
1237+
$$
1238+
|j_1j_2j_3j_4 \rangle
1239+
$$
1240+
<p>&nbsp;<br>
1241+
1242+
<p>where \(j_k\) is either \(0\) or \(1\). We have</p>
1243+
1244+
<p>&nbsp;<br>
1245+
$$
1246+
\begin{align*}
1247+
0.j_3 &= \frac{j_3}{2} \\
1248+
0.j_2j_3 &= \frac{j_2}{2} + \frac{j_3}{4} \\
1249+
0.j_1j_2j_3 &= \frac{j_1}{2} + \frac{j_2}{4} + \frac{j_3}{8} \\
1250+
0.j_0j_1j_2j_3 &= \frac{j_0}{2} + \frac{j_1}{4} + \frac{j_2}{8} + \frac{j_3}{16} \\
1251+
\end{align*}
1252+
$$
1253+
<p>&nbsp;<br>
1254+
</section>
1255+
1256+
<section>
1257+
<h2 id="qft-acts-as-follows">QFT acts as follows </h2>
1258+
1259+
<p>The quantum Fourier transform acts as follows:</p>
1260+
1261+
<p>&nbsp;<br>
1262+
$$
1263+
\begin{align*}
1264+
|j_1j_2j_3j_4 \rangle \mapsto \frac{1}{\sqrt{2^{4/2}}}
1265+
\left(|0\rangle + e^{2 \pi i 0.j4}|1\rangle \right) \otimes
1266+
\left(|0\rangle + e^{2 \pi i 0.j_3j4}|1\rangle \right) \otimes
1267+
\left(|0\rangle + e^{2 \pi i 0.j_2j_3j4}|1\rangle \right) \otimes
1268+
\left(|0\rangle + e^{2 \pi i 0.j_1j_2j_3j4}|1\rangle \right)
1269+
\end{align*}
1270+
$$
1271+
<p>&nbsp;<br>
1272+
</section>
1273+
1274+
<section>
1275+
<h2 id="quantum-circuits">Quantum circuits </h2>
1276+
1277+
<p>To compose a quantum circuit that calculates the quantum Fourier
1278+
transform we use the operators
1279+
</p>
1280+
1281+
<p>&nbsp;<br>
1282+
$$
1283+
\begin{align*}
1284+
R_k =
1285+
\begin{bmatrix}
1286+
1 & 0 \\
1287+
0 & e^{2\pi i/2^k}
1288+
\end{bmatrix}.
1289+
\end{align*}
1290+
$$
1291+
<p>&nbsp;<br>
1292+
</section>
1293+
1294+
<section>
1295+
<h2 id="rotation-gates">Rotation gates </h2>
1296+
1297+
<p>In this example, the \(R_k\) gates are:</p>
1298+
<p>&nbsp;<br>
1299+
$$
1300+
\begin{align*}
1301+
R_1 = \begin{bmatrix}
1302+
1 & 0 \\
1303+
0 & e^{2 \pi i /2^0}
1304+
\end{bmatrix} =
1305+
\begin{bmatrix}
1306+
1 & 0 \\
1307+
0 & 1
1308+
\end{bmatrix}, \quad
1309+
R_2 = \begin{bmatrix}
1310+
1 & 0 \\
1311+
0 & e^{2 \pi i /2^2}
1312+
\end{bmatrix}, \quad
1313+
R_3 = \begin{bmatrix}
1314+
1 & 0 \\
1315+
0 & e^{2 \pi i /2^3}
1316+
\end{bmatrix}, \quad
1317+
R_4 = \begin{bmatrix}
1318+
1 & 0 \\
1319+
0 & e^{2 \pi i /2^4}
1320+
\end{bmatrix}.
1321+
\end{align*}
1322+
$$
1323+
<p>&nbsp;<br>
1324+
</section>
1325+
1326+
<section>
1327+
<h2 id="using-the-hadamard-gate">Using the Hadamard gate </h2>
1328+
<p>The Hadamard
1329+
gate on a single qubit creates an equal superposition of its basis
1330+
states, assuming it is not already in a superposition, such that
1331+
</p>
1332+
1333+
<p>&nbsp;<br>
1334+
$$
1335+
H\vert 0 \rangle = \frac{1}{\sqrt{2}} \left(\vert 0 \rangle + \vert 1\rangle\right), \quad H\vert 1\rangle = \frac{1}{\sqrt{2}} \left(\vert 0 \rangle - \vert 1\rangle\right)
1336+
$$
1337+
<p>&nbsp;<br>
1338+
1339+
<p>The \( R_k \)&#160;gate simply adds a phase if the qubit it acts on is in the state \( \vert 1\rangle \)</p>
1340+
<p>&nbsp;<br>
1341+
$$
1342+
R_k\vert 0 \rangle = \vert 0 \rangle, \quad R_k\vert 1\rangle = e^{2\pi i/2^{k}}\vert 1\rangle
1343+
$$
1344+
<p>&nbsp;<br>
1345+
1346+
<p>Since all this gates are unitary, the quantum Fourier transfrom is also unitary.</p>
1347+
</section>
1348+
1349+
<section>
1350+
<h2 id="algorithm">Algorithm </h2>
1351+
1352+
<p>Assume we have a quantum register of \( n \) qubits in the state \( \vert j_1 j_2 \dots j_n\rangle \).
1353+
Applying the Hadamard gate to the first qubit
1354+
produces the state
1355+
</p>
1356+
1357+
<p>&nbsp;<br>
1358+
$$
1359+
H\vert j_1 j_2 \dots j_n\rangle = \frac{\left(\vert 0 \rangle + e^{2\pi i 0.j_1}\vert 1\rangle\right)}{2^{1/2}} \vert j_2 \dots j_n\rangle.
1360+
$$
1361+
<p>&nbsp;<br>
1362+
</section>
1363+
1364+
<section>
1365+
<h2 id="binary-fraction">Binary fraction </h2>
1366+
1367+
<p>Here we have made use of the binary fraction to represent the action of the Hadamard gate </p>
1368+
<p>&nbsp;<br>
1369+
$$
1370+
\exp{2\pi i 0.j_1} = -1,
1371+
$$
1372+
<p>&nbsp;<br>
1373+
1374+
<p>if \( j_1 = 1 \) and \( +1 \) if \( j_1 = 0 \).</p>
1375+
</section>
1376+
1377+
<section>
1378+
<h2 id="controlled-rotation-gate">Controlled rotation gate </h2>
1379+
1380+
<p>Furthermore we can apply the controlled-\( R_k \)&#160;gate, with all the other qubits \( j_k \) for \( k>1 \) as control qubits to produce the state</p>
1381+
1382+
<p>&nbsp;<br>
1383+
$$
1384+
\frac{\left(\vert 0 \rangle + e^{2\pi i 0.j_1j_2\dots j_n}\vert 1\rangle\right)}{2^{1/2}} \vert j_2 \dots j_n\rangle
1385+
$$
1386+
<p>&nbsp;<br>
1387+
1388+
<p>Next we do the same procedure on qubit \( 2 \)&#160;producing the state</p>
1389+
1390+
<p>&nbsp;<br>
1391+
$$
1392+
\frac{\left(\vert 0 \rangle + e^{2\pi i 0.j_1j_2\dots j_n}\vert 1\rangle\right)\left(\vert 0 \rangle + e^{2\pi i 0.j_2\dots j_n}\vert 1\rangle\right)}{2^{2/2}} \vert j_2 \dots j_n\rangle
1393+
$$
1394+
<p>&nbsp;<br>
1395+
</section>
1396+
1397+
<section>
1398+
<h2 id="applying-to-all-qubits">Applying to all qubits </h2>
1399+
1400+
<p>Doing this for all \( n \) qubits yields state</p>
1401+
1402+
<p>&nbsp;<br>
1403+
$$
1404+
\frac{\left(\vert 0 \rangle + e^{2\pi i 0.j_1j_2\dots j_n}\vert 1\rangle\right)\left(\vert 0 \rangle + e^{2\pi i 0.j_2\dots j_n}\vert 1\rangle\right)\dots \left(\vert 0 \rangle + e^{2\pi i 0.j_n}\vert 1\rangle\right)}{2^{n/2}} \vert j_2 \dots j_n\rangle
1405+
$$
1406+
<p>&nbsp;<br>
1407+
1408+
<p>At the end we use swap gates to reverse the order of the qubits</p>
1409+
1410+
<p>&nbsp;<br>
1411+
$$
1412+
\frac{\left(\vert 0 \rangle + e^{2\pi i 0.j_n}\vert 1\rangle\right)\left(\vert 0 \rangle + e^{2\pi i 0.j_{n-1}j_n}\vert 1\rangle\right)\dots\left(\vert 0 \rangle + e^{2\pi i 0.j_1j_2\dots j_n}\vert 1\rangle\right) }{2^{n/2}} \vert j_2 \dots j_n\rangle
1413+
$$
1414+
<p>&nbsp;<br>
1415+
1416+
<p>This is just the product representation from earlier, obviously our desired output.</p>
11391417
</section>
11401418

11411419

0 commit comments

Comments
 (0)