Skip to content

Commit 2c04c7a

Browse files
committed
update
1 parent 64b13ef commit 2c04c7a

File tree

8 files changed

+1045
-220
lines changed

8 files changed

+1045
-220
lines changed

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

Lines changed: 116 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,18 @@
199199
2,
200200
None,
201201
'the-code-for-the-one-qubit-case'),
202+
('Two-qubit Hamiltonian', 2, None, 'two-qubit-hamiltonian'),
203+
('Definitions', 2, None, 'definitions'),
204+
('The Hamiltonian in terms of Pauli-$\\boldsymbol{X}$ and '
205+
'Pauli-$\\boldsymbol{Z}$ matrices',
206+
2,
207+
None,
208+
'the-hamiltonian-in-terms-of-pauli-boldsymbol-x-and-pauli-boldsymbol-z-matrices'),
209+
('How do we perform measurements?',
210+
2,
211+
None,
212+
'how-do-we-perform-measurements'),
213+
('Explicit expressions', 2, None, 'explicit-expressions'),
202214
('Plans for the week of February March 1',
203215
2,
204216
None,
@@ -310,6 +322,11 @@
310322
<!-- navigation toc: --> <li><a href="#computing-quantum-gradients" style="font-size: 80%;">Computing quantum gradients</a></li>
311323
<!-- navigation toc: --> <li><a href="#a-smarter-way-of-doing-this" style="font-size: 80%;">A smarter way of doing this</a></li>
312324
<!-- navigation toc: --> <li><a href="#the-code-for-the-one-qubit-case" style="font-size: 80%;">The code for the one qubit case</a></li>
325+
<!-- navigation toc: --> <li><a href="#two-qubit-hamiltonian" style="font-size: 80%;">Two-qubit Hamiltonian</a></li>
326+
<!-- navigation toc: --> <li><a href="#definitions" style="font-size: 80%;">Definitions</a></li>
327+
<!-- navigation toc: --> <li><a href="#the-hamiltonian-in-terms-of-pauli-boldsymbol-x-and-pauli-boldsymbol-z-matrices" style="font-size: 80%;">The Hamiltonian in terms of Pauli-\( \boldsymbol{X} \) and Pauli-\( \boldsymbol{Z} \) matrices</a></li>
328+
<!-- navigation toc: --> <li><a href="#how-do-we-perform-measurements" style="font-size: 80%;">How do we perform measurements?</a></li>
329+
<!-- navigation toc: --> <li><a href="#explicit-expressions" style="font-size: 80%;">Explicit expressions</a></li>
313330
<!-- navigation toc: --> <li><a href="#plans-for-the-week-of-february-march-1" style="font-size: 80%;">Plans for the week of February March 1</a></li>
314331

315332
</ul>
@@ -351,7 +368,8 @@ <h2 id="plans-for-the-week-of-february-24-28-solving-quantum-mechanical-problems
351368
<!-- subsequent paragraphs come in larger fonts, so start with a paragraph -->
352369
<ol>
353370
<li> Repetition from last week on gates, measurements and one-qubit systems</li>
354-
<li> Introducing the Variational Quantum Eigensolver (VQE) and discussion of project 1
371+
<li> Introducing the Variational Quantum Eigensolver (VQE) and discussion of project 1</li>
372+
<li> Rewriting the two-qubit Hamiltonian in terms of Pauli matrices
355373
<!-- o <a href="https://youtu.be/" target="_self">Video of lecture to be added</a> -->
356374
<!-- o <a href="https://github.com/CompPhysics/QuantumComputingMachineLearning/blob/gh-pages/doc/HandWrittenNotes/2024/NotesFebruary21.pdf" target="_self">Whiteboard notes</a> --></li>
357375
</ol>
@@ -2070,6 +2088,102 @@ <h2 id="the-code-for-the-one-qubit-case" class="anchor">The code for the one qub
20702088
</div>
20712089

20722090

2091+
<!-- !split -->
2092+
<h2 id="two-qubit-hamiltonian" class="anchor">Two-qubit Hamiltonian </h2>
2093+
2094+
<p>We end this lecture with a discussion on how to rewrite the two-qubit Hamiltonian rom last week (and project 1)</p>
2095+
$$
2096+
\mathcal{H}=\begin{bmatrix} \epsilon_{1}+V_z & 0 & 0 & V_x \\
2097+
0 & \epsilon_{2}-V_z & V_x & 0 \\
2098+
0 & H_x & \epsilon_{3}-V_z & 0 \\
2099+
H_x & 0 & 0 & \epsilon_{4} +V_z \end{bmatrix}.
2100+
$$
2101+
2102+
<p>This Hamiltonian can be rewritten in terms of various one-qubit matrices.</p>
2103+
2104+
<!-- !split -->
2105+
<h2 id="definitions" class="anchor">Definitions </h2>
2106+
2107+
<p>We define</p>
2108+
$$
2109+
\epsilon_{II}=\frac{\epsilon_{1}+\epsilon_{2}+\epsilon_{3}+\epsilon_{4}}{4},
2110+
$$
2111+
2112+
$$
2113+
\epsilon_{ZI}=\frac{\epsilon_{1}+\epsilon_{2}-\epsilon_{3}-\epsilon_{4}}{4},
2114+
$$
2115+
2116+
$$
2117+
\epsilon_{IZ}=\frac{\epsilon_{1}-\epsilon_{2}+\epsilon_{3}-\epsilon_{4}}{4},
2118+
$$
2119+
2120+
$$
2121+
\epsilon_{ZZ}=\frac{\epsilon_{1}-\epsilon_{2}-\epsilon_{3}+\epsilon_{4}}{4}.
2122+
$$
2123+
2124+
2125+
<!-- !split -->
2126+
<h2 id="the-hamiltonian-in-terms-of-pauli-boldsymbol-x-and-pauli-boldsymbol-z-matrices" class="anchor">The Hamiltonian in terms of Pauli-\( \boldsymbol{X} \) and Pauli-\( \boldsymbol{Z} \) matrices </h2>
2127+
2128+
<p>With these definitions we can rewrite our two-qubit Hamiltonian as</p>
2129+
$$
2130+
\mathcal{H}=\mathcal{H}_0+\mathcal{H}_I
2131+
$$
2132+
2133+
<p>with</p>
2134+
$$
2135+
\mathcal{H}_0=\epsilon_{II}\boldsymbol{I}\otimes\boldsymbol{I}+\epsilon_{ZI}\boldsymbol{Z}\otimes\boldsymbol{I}+\epsilon_{IZ}\boldsymbol{I}\otimes\boldsymbol{Z}+\epsilon_{II}+\epsilon_{ZZ}\boldsymbol{Z}\otimes\boldsymbol{Z},
2136+
$$
2137+
2138+
<p>and</p>
2139+
$$
2140+
\mathcal{H}_I=V_z\boldsymbol{Z}\otimes\boldsymbol{Z}+V_x\boldsymbol{X}\otimes\boldsymbol{X}.
2141+
$$
2142+
2143+
2144+
<!-- !split -->
2145+
<h2 id="how-do-we-perform-measurements" class="anchor">How do we perform measurements? </h2>
2146+
2147+
<p>The above tensor products need to rewritten in terms of specific
2148+
transformations so that we can perform the measumrents in the basis of
2149+
the Pauli-\( \boldsymbol{Z} \) matrices. As we discussed earlier, we need to find
2150+
a transformation of the form
2151+
</p>
2152+
$$
2153+
\mathcal{P}=\boldsymbol{U}^{\dagger}\boldsymbol{M}\boldsymbol{U},
2154+
$$
2155+
2156+
<p>where \( \mathcal{P} \) represents some combination of the Pauli matrices and
2157+
the identity matrix, \( \boldsymbol{U} \) is a unitary matrix and \( \boldsymbol{M} \)
2158+
represents the gate/matrix which performs the measurements, often
2159+
represented by a Pauli-\( \boldsymbol{Z} \) gate/matrix.
2160+
</p>
2161+
2162+
<p>The implementation of these measurements will be discussed next week.</p>
2163+
2164+
<!-- !split -->
2165+
<h2 id="explicit-expressions" class="anchor">Explicit expressions </h2>
2166+
<p>In order to perform our measurements, will then need the following operators \( \boldsymbol{U} \)</p>
2167+
$$
2168+
\begin{align*}
2169+
\boldsymbol{Z}\otimes\boldsymbol{I} & \boldsymbol{U}=\boldsymbol{I}\otimes\boldsymbol{I}\\
2170+
\boldsymbol{I}\otimes\boldsymbol{Z} & \boldsymbol{U}=\text{SWAP}\\
2171+
\boldsymbol{Z}\otimes\boldsymbol{Z} & \boldsymbol{U}=CX_{10}\\
2172+
\boldsymbol{X}\otimes\boldsymbol{X} & \boldsymbol{U}=CX_{10}(\boldsymbol{H}\otimes\boldsymbol{H}\\
2173+
\end{align*}
2174+
$$
2175+
2176+
<p>where we have </p>
2177+
$$
2178+
\text{CX}_{10} = \begin{bmatrix}
2179+
0 & 1 & 0 & 0 \\
2180+
1 & 0 & 0 & 0 \\
2181+
0 & 0 & 1 & 0 \\
2182+
0 & 0 & 0 & 1
2183+
\end{bmatrix}.
2184+
$$
2185+
2186+
20732187
<!-- !split -->
20742188
<h2 id="plans-for-the-week-of-february-march-1" class="anchor">Plans for the week of February March 1 </h2>
20752189

@@ -2085,6 +2199,7 @@ <h2 id="plans-for-the-week-of-february-march-1" class="anchor">Plans for the wee
20852199
</div>
20862200
</div>
20872201

2202+
20882203
<!-- ------------------- end of main content --------------- -->
20892204
</div> <!-- end container -->
20902205
<!-- include javascript, jQuery *first* -->

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

Lines changed: 122 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ <h2 id="plans-for-the-week-of-february-24-28-solving-quantum-mechanical-problems
199199
<p>
200200
<ol>
201201
<p><li> Repetition from last week on gates, measurements and one-qubit systems</li>
202-
<p><li> Introducing the Variational Quantum Eigensolver (VQE) and discussion of project 1
202+
<p><li> Introducing the Variational Quantum Eigensolver (VQE) and discussion of project 1</li>
203+
<p><li> Rewriting the two-qubit Hamiltonian in terms of Pauli matrices
203204
<!-- o <a href="https://youtu.be/" target="_blank">Video of lecture to be added</a> -->
204205
<!-- o <a href="https://github.com/CompPhysics/QuantumComputingMachineLearning/blob/gh-pages/doc/HandWrittenNotes/2024/NotesFebruary21.pdf" target="_blank">Whiteboard notes</a> --></li>
205206
</ol>
@@ -2113,6 +2114,126 @@ <h2 id="the-code-for-the-one-qubit-case">The code for the one qubit case </h2>
21132114
</div>
21142115
</section>
21152116

2117+
<section>
2118+
<h2 id="two-qubit-hamiltonian">Two-qubit Hamiltonian </h2>
2119+
2120+
<p>We end this lecture with a discussion on how to rewrite the two-qubit Hamiltonian rom last week (and project 1)</p>
2121+
<p>&nbsp;<br>
2122+
$$
2123+
\mathcal{H}=\begin{bmatrix} \epsilon_{1}+V_z & 0 & 0 & V_x \\
2124+
0 & \epsilon_{2}-V_z & V_x & 0 \\
2125+
0 & H_x & \epsilon_{3}-V_z & 0 \\
2126+
H_x & 0 & 0 & \epsilon_{4} +V_z \end{bmatrix}.
2127+
$$
2128+
<p>&nbsp;<br>
2129+
2130+
<p>This Hamiltonian can be rewritten in terms of various one-qubit matrices.</p>
2131+
</section>
2132+
2133+
<section>
2134+
<h2 id="definitions">Definitions </h2>
2135+
2136+
<p>We define</p>
2137+
<p>&nbsp;<br>
2138+
$$
2139+
\epsilon_{II}=\frac{\epsilon_{1}+\epsilon_{2}+\epsilon_{3}+\epsilon_{4}}{4},
2140+
$$
2141+
<p>&nbsp;<br>
2142+
2143+
<p>&nbsp;<br>
2144+
$$
2145+
\epsilon_{ZI}=\frac{\epsilon_{1}+\epsilon_{2}-\epsilon_{3}-\epsilon_{4}}{4},
2146+
$$
2147+
<p>&nbsp;<br>
2148+
2149+
<p>&nbsp;<br>
2150+
$$
2151+
\epsilon_{IZ}=\frac{\epsilon_{1}-\epsilon_{2}+\epsilon_{3}-\epsilon_{4}}{4},
2152+
$$
2153+
<p>&nbsp;<br>
2154+
2155+
<p>&nbsp;<br>
2156+
$$
2157+
\epsilon_{ZZ}=\frac{\epsilon_{1}-\epsilon_{2}-\epsilon_{3}+\epsilon_{4}}{4}.
2158+
$$
2159+
<p>&nbsp;<br>
2160+
</section>
2161+
2162+
<section>
2163+
<h2 id="the-hamiltonian-in-terms-of-pauli-boldsymbol-x-and-pauli-boldsymbol-z-matrices">The Hamiltonian in terms of Pauli-\( \boldsymbol{X} \) and Pauli-\( \boldsymbol{Z} \) matrices </h2>
2164+
2165+
<p>With these definitions we can rewrite our two-qubit Hamiltonian as</p>
2166+
<p>&nbsp;<br>
2167+
$$
2168+
\mathcal{H}=\mathcal{H}_0+\mathcal{H}_I
2169+
$$
2170+
<p>&nbsp;<br>
2171+
2172+
<p>with</p>
2173+
<p>&nbsp;<br>
2174+
$$
2175+
\mathcal{H}_0=\epsilon_{II}\boldsymbol{I}\otimes\boldsymbol{I}+\epsilon_{ZI}\boldsymbol{Z}\otimes\boldsymbol{I}+\epsilon_{IZ}\boldsymbol{I}\otimes\boldsymbol{Z}+\epsilon_{II}+\epsilon_{ZZ}\boldsymbol{Z}\otimes\boldsymbol{Z},
2176+
$$
2177+
<p>&nbsp;<br>
2178+
2179+
<p>and</p>
2180+
<p>&nbsp;<br>
2181+
$$
2182+
\mathcal{H}_I=V_z\boldsymbol{Z}\otimes\boldsymbol{Z}+V_x\boldsymbol{X}\otimes\boldsymbol{X}.
2183+
$$
2184+
<p>&nbsp;<br>
2185+
</section>
2186+
2187+
<section>
2188+
<h2 id="how-do-we-perform-measurements">How do we perform measurements? </h2>
2189+
2190+
<p>The above tensor products need to rewritten in terms of specific
2191+
transformations so that we can perform the measumrents in the basis of
2192+
the Pauli-\( \boldsymbol{Z} \) matrices. As we discussed earlier, we need to find
2193+
a transformation of the form
2194+
</p>
2195+
<p>&nbsp;<br>
2196+
$$
2197+
\mathcal{P}=\boldsymbol{U}^{\dagger}\boldsymbol{M}\boldsymbol{U},
2198+
$$
2199+
<p>&nbsp;<br>
2200+
2201+
<p>where \( \mathcal{P} \) represents some combination of the Pauli matrices and
2202+
the identity matrix, \( \boldsymbol{U} \) is a unitary matrix and \( \boldsymbol{M} \)
2203+
represents the gate/matrix which performs the measurements, often
2204+
represented by a Pauli-\( \boldsymbol{Z} \) gate/matrix.
2205+
</p>
2206+
2207+
<p>The implementation of these measurements will be discussed next week.</p>
2208+
</section>
2209+
2210+
<section>
2211+
<h2 id="explicit-expressions">Explicit expressions </h2>
2212+
<p>In order to perform our measurements, will then need the following operators \( \boldsymbol{U} \)</p>
2213+
<p>&nbsp;<br>
2214+
$$
2215+
\begin{align*}
2216+
\boldsymbol{Z}\otimes\boldsymbol{I} & \boldsymbol{U}=\boldsymbol{I}\otimes\boldsymbol{I}\\
2217+
\boldsymbol{I}\otimes\boldsymbol{Z} & \boldsymbol{U}=\text{SWAP}\\
2218+
\boldsymbol{Z}\otimes\boldsymbol{Z} & \boldsymbol{U}=CX_{10}\\
2219+
\boldsymbol{X}\otimes\boldsymbol{X} & \boldsymbol{U}=CX_{10}(\boldsymbol{H}\otimes\boldsymbol{H}\\
2220+
\end{align*}
2221+
$$
2222+
<p>&nbsp;<br>
2223+
2224+
<p>where we have </p>
2225+
<p>&nbsp;<br>
2226+
$$
2227+
\text{CX}_{10} = \begin{bmatrix}
2228+
0 & 1 & 0 & 0 \\
2229+
1 & 0 & 0 & 0 \\
2230+
0 & 0 & 1 & 0 \\
2231+
0 & 0 & 0 & 1
2232+
\end{bmatrix}.
2233+
$$
2234+
<p>&nbsp;<br>
2235+
</section>
2236+
21162237
<section>
21172238
<h2 id="plans-for-the-week-of-february-march-1">Plans for the week of February March 1 </h2>
21182239

0 commit comments

Comments
 (0)