Skip to content

Commit f45d3d4

Browse files
committed
Create quantum_boltzmann_machines.tex
1 parent 1cb51ae commit f45d3d4

1 file changed

Lines changed: 137 additions & 0 deletions

File tree

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
2+
\documentclass[12pt]{article}
3+
\usepackage[utf8]{inputenc}
4+
\usepackage{amsmath, amssymb, amsthm}
5+
\usepackage{graphicx}
6+
\usepackage{hyperref}
7+
\usepackage{physics}
8+
\usepackage{listings}
9+
\usepackage{xcolor}
10+
\usepackage{geometry}
11+
\geometry{margin=1in}
12+
13+
\definecolor{codebg}{rgb}{0.95,0.95,0.95}
14+
\lstset{
15+
backgroundcolor=\color{codebg},
16+
basicstyle=\ttfamily\footnotesize,
17+
breaklines=true,
18+
frame=single,
19+
postbreak=\mbox{\textcolor{red}{$\hookrightarrow$}\space}
20+
}
21+
22+
\title{Lecture Notes on Quantum Boltzmann Machines}
23+
\author{Prepared for Graduate Physics Students}
24+
\date{\today}
25+
26+
\begin{document}
27+
28+
\maketitle
29+
30+
\tableofcontents
31+
\newpage
32+
33+
\section{Introduction}
34+
35+
Quantum Boltzmann Machines (QBMs) are quantum generalizations of classical Boltzmann machines—stochastic neural networks used for modeling probability distributions. They aim to exploit quantum phenomena such as superposition and entanglement to potentially outperform their classical counterparts.
36+
37+
\section{Classical Boltzmann Machines}
38+
39+
\subsection{Energy-Based Models}
40+
41+
A classical Boltzmann machine is defined by an energy function:
42+
\[
43+
E(v, h) = -\sum_i b_i v_i - \sum_j c_j h_j - \sum_{i,j} v_i W_{ij} h_j
44+
\]
45+
where \( v \) are visible units, \( h \) are hidden units, \( W \) are weights, and \( b_i, c_j \) are biases.
46+
47+
\subsection{Probability Distribution}
48+
49+
The probability of a state is given by the Boltzmann distribution:
50+
\[
51+
P(v, h) = \frac{e^{-E(v,h)}}{Z}, \quad Z = \sum_{v,h} e^{-E(v,h)}
52+
\]
53+
54+
\section{Quantum Boltzmann Machines}
55+
56+
\subsection{Quantum Generalization}
57+
58+
In the quantum case, the state of the system is described by a density matrix \( \rho \), and the energy is defined via a Hamiltonian \( H \):
59+
\[
60+
\rho = \frac{e^{-\beta H}}{Z}, \quad Z = \Tr(e^{-\beta H})
61+
\]
62+
63+
\subsection{Hamiltonian Formulation}
64+
65+
We define a Hamiltonian over qubits:
66+
\[
67+
H = -\sum_i b_i Z_i - \sum_{i<j} W_{ij} Z_i Z_j + \sum_i \Delta_i X_i
68+
\]
69+
where \( Z_i, X_i \) are Pauli operators. The transverse field term \( \Delta_i X_i \) introduces quantum effects.
70+
71+
\section{Training Quantum Boltzmann Machines}
72+
73+
\subsection{Objective Function}
74+
75+
Training aims to minimize the KL divergence between the model distribution and data:
76+
\[
77+
\mathcal{L} = D_{KL}(P_{\text{data}} || P_{\text{model}})
78+
\]
79+
80+
\subsection{Gradient Estimation}
81+
82+
The gradient of the loss involves expectation values:
83+
\[
84+
\partial_\theta \mathcal{L} = \expval{\partial_\theta H}_{\text{data}} - \expval{\partial_\theta H}_{\text{model}}
85+
\]
86+
87+
\section{Implementation with PennyLane}
88+
89+
\subsection{Quantum Circuit Ansatz}
90+
91+
A variational circuit can be used to simulate the thermal state of the QBM. Here's a basic setup using PennyLane:
92+
93+
\begin{lstlisting}[language=Python]
94+
import pennylane as qml
95+
from pennylane import numpy as np
96+
97+
n_qubits = 4
98+
dev = qml.device("default.qubit", wires=n_qubits)
99+
100+
@qml.qnode(dev)
101+
def qbm_ansatz(params):
102+
for i in range(n_qubits):
103+
qml.RY(params[i], wires=i)
104+
for i in range(n_qubits - 1):
105+
qml.CNOT(wires=[i, i+1])
106+
return qml.expval(qml.PauliZ(0))
107+
\end{lstlisting}
108+
109+
\subsection{Training Loop}
110+
111+
\begin{lstlisting}[language=Python]
112+
from pennylane.optimize import GradientDescentOptimizer
113+
114+
params = np.random.randn(n_qubits, requires_grad=True)
115+
opt = GradientDescentOptimizer(stepsize=0.1)
116+
117+
for i in range(100):
118+
params = opt.step(lambda p: -qbm_ansatz(p), params)
119+
\end{lstlisting}
120+
121+
\section{Quantum Sampling}
122+
123+
Sampling from a quantum Boltzmann distribution is nontrivial. One approach is to use Quantum Annealing or Quantum Imaginary Time Evolution.
124+
125+
\section{Applications and Research Directions}
126+
127+
\begin{itemize}
128+
\item Quantum-enhanced generative modeling
129+
\item Quantum unsupervised learning
130+
\item Quantum advantage in statistical modeling
131+
\end{itemize}
132+
133+
\section{Conclusion}
134+
135+
Quantum Boltzmann Machines represent a promising frontier in quantum machine learning, offering new computational paradigms through quantum statistics and variational principles.
136+
137+
\end{document}

0 commit comments

Comments
 (0)