Skip to content

Commit 4c44bf7

Browse files
committed
update week 13
1 parent 8a329b6 commit 4c44bf7

File tree

8 files changed

+213
-1024
lines changed

8 files changed

+213
-1024
lines changed

doc/pub/week13/html/week13-bs.html

Lines changed: 1 addition & 117 deletions
Original file line numberDiff line numberDiff line change
@@ -168,15 +168,6 @@
168168
2,
169169
None,
170170
'what-will-we-need-in-the-case-of-a-quantum-computer'),
171-
('The most general ansatz', 2, None, 'the-most-general-ansatz'),
172-
('Quantum SVM', 2, None, 'quantum-svm'),
173-
('Defining the Quantum Kernel',
174-
2,
175-
None,
176-
'defining-the-quantum-kernel'),
177-
('Side note', 2, None, 'side-note'),
178-
('Feature map', 2, None, 'feature-map'),
179-
('Classical functions', 2, None, 'classical-functions'),
180171
('Plans for next week', 2, None, 'plans-for-next-week')]}
181172
end of tocinfo -->
182173

@@ -271,12 +262,6 @@
271262
<!-- navigation toc: --> <li><a href="#back-to-the-more-realistic-cases" style="font-size: 80%;">Back to the more realistic cases</a></li>
272263
<!-- navigation toc: --> <li><a href="#quantum-svms" style="font-size: 80%;">Quantum SVMs</a></li>
273264
<!-- navigation toc: --> <li><a href="#what-will-we-need-in-the-case-of-a-quantum-computer" style="font-size: 80%;">What will we need in the case of a quantum computer?</a></li>
274-
<!-- navigation toc: --> <li><a href="#the-most-general-ansatz" style="font-size: 80%;">The most general ansatz</a></li>
275-
<!-- navigation toc: --> <li><a href="#quantum-svm" style="font-size: 80%;">Quantum SVM</a></li>
276-
<!-- navigation toc: --> <li><a href="#defining-the-quantum-kernel" style="font-size: 80%;">Defining the Quantum Kernel</a></li>
277-
<!-- navigation toc: --> <li><a href="#side-note" style="font-size: 80%;">Side note</a></li>
278-
<!-- navigation toc: --> <li><a href="#feature-map" style="font-size: 80%;">Feature map</a></li>
279-
<!-- navigation toc: --> <li><a href="#classical-functions" style="font-size: 80%;">Classical functions</a></li>
280265
<!-- navigation toc: --> <li><a href="#plans-for-next-week" style="font-size: 80%;">Plans for next week</a></li>
281266

282267
</ul>
@@ -319,7 +304,7 @@ <h2 id="plans-for-the-week-of-april-21-25" class="anchor">Plans for the week of
319304
<ol>
320305
<li> Introduction to QML</li>
321306
<li> Support Vector Machines (SVM, classical machine learning approach)</li>
322-
<li> Quantum Support Vector Machine Learning (QSVM)</li>
307+
<li> Quantum Support Vector Machine Learning (QSVM), short intro</li>
323308
<li> Video of lecture at <a href="https://youtu.be/C36Kg4eaO7A" target="_self"><tt>https://youtu.be/C36Kg4eaO7A</tt></a></li>
324309
<li> Whiteboard notes at <a href="https://github.com/CompPhysics/QuantumComputingMachineLearning/blob/gh-pages/doc/HandWrittenNotes/2025/NotesApril23.pdf" target="_self"><tt>https://github.com/CompPhysics/QuantumComputingMachineLearning/blob/gh-pages/doc/HandWrittenNotes/2025/NotesApril23.pdf</tt></a></li>
325310
</ol>
@@ -1883,107 +1868,6 @@ <h2 id="what-will-we-need-in-the-case-of-a-quantum-computer" class="anchor">What
18831868
</div>
18841869

18851870

1886-
<!-- !split -->
1887-
<h2 id="the-most-general-ansatz" class="anchor">The most general ansatz </h2>
1888-
1889-
<p>Following these steps we can define an ansatz for this kind of problem
1890-
which is
1891-
</p>
1892-
$$
1893-
W(\theta) \mathcal{U}_{\Phi}(\vec{x}) \vert 0 \rangle.
1894-
$$
1895-
1896-
<p>These kind of ansatzes are called quantum variational circuits.</p>
1897-
1898-
<!-- !split -->
1899-
<h2 id="quantum-svm" class="anchor">Quantum SVM </h2>
1900-
1901-
<p>In the case of a quantum SVM we will only use the quantum feature maps</p>
1902-
$$
1903-
\mathcal{U}_{\Phi(\vec{x})},
1904-
$$
1905-
1906-
<p>to translate the classical data into
1907-
quantum states and build the Kernel of the SVM out of these quantum
1908-
states. After calculating the Kernel matrix on the quantum computer we
1909-
can train the Quantum SVM the same way as the classical SVM.
1910-
</p>
1911-
1912-
<!-- !split -->
1913-
<h2 id="defining-the-quantum-kernel" class="anchor">Defining the Quantum Kernel </h2>
1914-
1915-
<p>The idea of the quantum kernel is exactly the same as in the classical
1916-
case. We take the inner product
1917-
</p>
1918-
$$
1919-
K(\vec{x}, \vec{z}) = \vert \langle \Phi (\vec{x}) \vert \Phi(\vec{z}) \rangle \vert^2 = \langle 0^n \vert \mathcal{U}_{\Phi(\vec{x})}^{t} \mathcal{U}_{\Phi(\vec{z})} \vert 0^n \rangle,
1920-
$$
1921-
1922-
<p>but now with the quantum feature maps</p>
1923-
$$
1924-
\mathcal{U}_{\Phi(\vec{x})}.
1925-
$$
1926-
1927-
<p>The idea is that if we choose a quantum feature maps that is not easy
1928-
to simulate with a classical computer we might obtain a quantum
1929-
advantage.
1930-
</p>
1931-
1932-
<!-- !split -->
1933-
<h2 id="side-note" class="anchor">Side note </h2>
1934-
1935-
<p>There is no proof yet that the QSVM brings a quantum
1936-
advantage, but the argument the authors of
1937-
<a href="https://arxiv.org/pdf/1804.11326.pdf" target="_self"><tt>https://arxiv.org/pdf/1804.11326.pdf</tt></a> make, is that there is
1938-
for sure no advantage if we use feature maps that are easy to simulate
1939-
classically, because then we would not need a quantum computer to
1940-
construct the Kernel.
1941-
</p>
1942-
1943-
<!-- !split -->
1944-
<h2 id="feature-map" class="anchor">Feature map </h2>
1945-
1946-
<p>For the feature maps we use the ansatz</p>
1947-
$$
1948-
\mathcal{U}_{\Phi(x)} = U_{\Phi(x)} \otimes H^{\otimes n},
1949-
$$
1950-
1951-
<p>where</p>
1952-
$$
1953-
U_{\Phi(x)} = \exp \left( i \sum_{S \in n} \phi_S(x) \prod_{i \in S} Z_i \right),
1954-
$$
1955-
1956-
<p>which simplifies a lot when we (like in <a href="https://arxiv.org/pdf/1804.11326.pdf" target="_self"><tt>https://arxiv.org/pdf/1804.11326.pdf</tt></a>) only consider
1957-
\(S \leq 2\) interactions, which means we only let two qubits interact
1958-
at a time. For \(S \leq 2\) the product \(\prod_{i \in S}\) only leads
1959-
to interactions \(Z_i Z_j\) and non interacting terms \(Z_i\). And the
1960-
sum \(\sum_{S \in n}\) over all these terms that are possible with \(n\)
1961-
qubits.
1962-
</p>
1963-
1964-
<!-- !split -->
1965-
<h2 id="classical-functions" class="anchor">Classical functions </h2>
1966-
1967-
<p>Finally we define the classical functions \(\phi_i(\vec{x}) = x_i\) and
1968-
\(\phi_{i,j}(\vec{x}) = (\pi - x_i)( \pi- x_j)\).
1969-
</p>
1970-
1971-
<p>If we write this ansatz for 2 qubits and \(S \leq 2\) we see how it
1972-
simplifies:
1973-
</p>
1974-
$$
1975-
U_{\Phi(x)} = \exp \left(i \left(x_1 Z_1 + x_2 Z_2 + (\pi - x_1)( \pi- x_2) Z_1 Z_2 \right) \right).
1976-
$$
1977-
1978-
<p>We won't get into details to much here, why we would take this ansatz.
1979-
It is simply an ansatz that is simple enough an leads to good results.
1980-
</p>
1981-
1982-
<p>Finally we can define a depth of these circuits. Depth 2 means we repeat
1983-
this ansatz two times. Which means our feature map becomes
1984-
\(U_{\Phi(x)} \otimes H^{\otimes n} \otimes U_{\Phi(x)} \otimes H^{\otimes n}\)
1985-
</p>
1986-
19871871
<!-- !split -->
19881872
<h2 id="plans-for-next-week" class="anchor">Plans for next week </h2>
19891873
<ol>

doc/pub/week13/html/week13-reveal.html

Lines changed: 1 addition & 122 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ <h2 id="plans-for-the-week-of-april-21-25">Plans for the week of April 21-25 </h
200200
<ol>
201201
<p><li> Introduction to QML</li>
202202
<p><li> Support Vector Machines (SVM, classical machine learning approach)</li>
203-
<p><li> Quantum Support Vector Machine Learning (QSVM)</li>
203+
<p><li> Quantum Support Vector Machine Learning (QSVM), short intro</li>
204204
<p><li> Video of lecture at <a href="https://youtu.be/C36Kg4eaO7A" target="_blank"><tt>https://youtu.be/C36Kg4eaO7A</tt></a></li>
205205
<p><li> Whiteboard notes at <a href="https://github.com/CompPhysics/QuantumComputingMachineLearning/blob/gh-pages/doc/HandWrittenNotes/2025/NotesApril23.pdf" target="_blank"><tt>https://github.com/CompPhysics/QuantumComputingMachineLearning/blob/gh-pages/doc/HandWrittenNotes/2025/NotesApril23.pdf</tt></a></li>
206206
</ol>
@@ -1937,127 +1937,6 @@ <h2 id="what-will-we-need-in-the-case-of-a-quantum-computer">What will we need i
19371937
</div>
19381938
</section>
19391939

1940-
<section>
1941-
<h2 id="the-most-general-ansatz">The most general ansatz </h2>
1942-
1943-
<p>Following these steps we can define an ansatz for this kind of problem
1944-
which is
1945-
</p>
1946-
<p>&nbsp;<br>
1947-
$$
1948-
W(\theta) \mathcal{U}_{\Phi}(\vec{x}) \vert 0 \rangle.
1949-
$$
1950-
<p>&nbsp;<br>
1951-
1952-
<p>These kind of ansatzes are called quantum variational circuits.</p>
1953-
</section>
1954-
1955-
<section>
1956-
<h2 id="quantum-svm">Quantum SVM </h2>
1957-
1958-
<p>In the case of a quantum SVM we will only use the quantum feature maps</p>
1959-
<p>&nbsp;<br>
1960-
$$
1961-
\mathcal{U}_{\Phi(\vec{x})},
1962-
$$
1963-
<p>&nbsp;<br>
1964-
1965-
<p>to translate the classical data into
1966-
quantum states and build the Kernel of the SVM out of these quantum
1967-
states. After calculating the Kernel matrix on the quantum computer we
1968-
can train the Quantum SVM the same way as the classical SVM.
1969-
</p>
1970-
</section>
1971-
1972-
<section>
1973-
<h2 id="defining-the-quantum-kernel">Defining the Quantum Kernel </h2>
1974-
1975-
<p>The idea of the quantum kernel is exactly the same as in the classical
1976-
case. We take the inner product
1977-
</p>
1978-
<p>&nbsp;<br>
1979-
$$
1980-
K(\vec{x}, \vec{z}) = \vert \langle \Phi (\vec{x}) \vert \Phi(\vec{z}) \rangle \vert^2 = \langle 0^n \vert \mathcal{U}_{\Phi(\vec{x})}^{t} \mathcal{U}_{\Phi(\vec{z})} \vert 0^n \rangle,
1981-
$$
1982-
<p>&nbsp;<br>
1983-
1984-
<p>but now with the quantum feature maps</p>
1985-
<p>&nbsp;<br>
1986-
$$
1987-
\mathcal{U}_{\Phi(\vec{x})}.
1988-
$$
1989-
<p>&nbsp;<br>
1990-
1991-
<p>The idea is that if we choose a quantum feature maps that is not easy
1992-
to simulate with a classical computer we might obtain a quantum
1993-
advantage.
1994-
</p>
1995-
</section>
1996-
1997-
<section>
1998-
<h2 id="side-note">Side note </h2>
1999-
2000-
<p>There is no proof yet that the QSVM brings a quantum
2001-
advantage, but the argument the authors of
2002-
<a href="https://arxiv.org/pdf/1804.11326.pdf" target="_blank"><tt>https://arxiv.org/pdf/1804.11326.pdf</tt></a> make, is that there is
2003-
for sure no advantage if we use feature maps that are easy to simulate
2004-
classically, because then we would not need a quantum computer to
2005-
construct the Kernel.
2006-
</p>
2007-
</section>
2008-
2009-
<section>
2010-
<h2 id="feature-map">Feature map </h2>
2011-
2012-
<p>For the feature maps we use the ansatz</p>
2013-
<p>&nbsp;<br>
2014-
$$
2015-
\mathcal{U}_{\Phi(x)} = U_{\Phi(x)} \otimes H^{\otimes n},
2016-
$$
2017-
<p>&nbsp;<br>
2018-
2019-
<p>where</p>
2020-
<p>&nbsp;<br>
2021-
$$
2022-
U_{\Phi(x)} = \exp \left( i \sum_{S \in n} \phi_S(x) \prod_{i \in S} Z_i \right),
2023-
$$
2024-
<p>&nbsp;<br>
2025-
2026-
<p>which simplifies a lot when we (like in <a href="https://arxiv.org/pdf/1804.11326.pdf" target="_blank"><tt>https://arxiv.org/pdf/1804.11326.pdf</tt></a>) only consider
2027-
\(S \leq 2\) interactions, which means we only let two qubits interact
2028-
at a time. For \(S \leq 2\) the product \(\prod_{i \in S}\) only leads
2029-
to interactions \(Z_i Z_j\) and non interacting terms \(Z_i\). And the
2030-
sum \(\sum_{S \in n}\) over all these terms that are possible with \(n\)
2031-
qubits.
2032-
</p>
2033-
</section>
2034-
2035-
<section>
2036-
<h2 id="classical-functions">Classical functions </h2>
2037-
2038-
<p>Finally we define the classical functions \(\phi_i(\vec{x}) = x_i\) and
2039-
\(\phi_{i,j}(\vec{x}) = (\pi - x_i)( \pi- x_j)\).
2040-
</p>
2041-
2042-
<p>If we write this ansatz for 2 qubits and \(S \leq 2\) we see how it
2043-
simplifies:
2044-
</p>
2045-
<p>&nbsp;<br>
2046-
$$
2047-
U_{\Phi(x)} = \exp \left(i \left(x_1 Z_1 + x_2 Z_2 + (\pi - x_1)( \pi- x_2) Z_1 Z_2 \right) \right).
2048-
$$
2049-
<p>&nbsp;<br>
2050-
2051-
<p>We won't get into details to much here, why we would take this ansatz.
2052-
It is simply an ansatz that is simple enough an leads to good results.
2053-
</p>
2054-
2055-
<p>Finally we can define a depth of these circuits. Depth 2 means we repeat
2056-
this ansatz two times. Which means our feature map becomes
2057-
\(U_{\Phi(x)} \otimes H^{\otimes n} \otimes U_{\Phi(x)} \otimes H^{\otimes n}\)
2058-
</p>
2059-
</section>
2060-
20611940
<section>
20621941
<h2 id="plans-for-next-week">Plans for next week </h2>
20631942
<ol>

0 commit comments

Comments
 (0)