Generative Modeling
From Boltzmann Machines to Born Machines

Lei Wang (王磊)Institute of Physics, CAS
https://wangleiphy.github.io

Discriminative vs Generative
Learning

readwrite

Discriminative vs Generative
Learning
x1
h1

x2

..
.
xN

..
.

h2

h3

..
.

y = f (x)or p(y|x)x1

x2... h... xp(x, y)NM

yDiscriminative vs Generative
Learning
x1
h1x2

..
.
xN

..
.

h2

h3..
.

y = f (x)or p(y|x)x1

x2... h... xM

Np(x, y)p(y|x) =p(x)yDiscriminative vs GenerativeLearning

Discriminative vs Generative
Learning“What I can not create, I do not understand”

Discriminative vs Generative
Learning

Generative Modelingdata

encoder

decoderdata“Auto-Encoding Variational Bayes", Kingma and Welling,1312.6114

Generative Modelinglatent vector
data

encoder

decoderdata“Auto-Encoding Variational Bayes", Kingma and Welling,1312.6114

Latent
space
interpolation
2.D applications
49

Figure 2.D.3: VAEs can be used for image re-synthesis. In this example byWhite, space1609.04468
White [2016], an original image (left) is modified in a latentin theProbabilistic Generative Modelingp(x)How to express, learn, and sample from ahigh dimensional probability distribution ?
  

    " 7          &    0   %  ?
    AF:)    ) ,F:)-    F         '          .   :    )           !               @       ) ,A-    , 1-             *                     ) AF:)           
      *                   4%?         )      

“random” images 1  

“natural” images                  <     <  !
:          ;         -                 ,     0 C      ,                                    

      HProbabilistic Generative Modelingp(x)How to express, learn, and sample from ahigh dimensional probability distribution ?
    

Page 159“… the images encountered in
AI applications occupy anegligible proportion of
the volume of image space.”  " 7          &    0   %  ?
    AF:)    ) ,F:)-    F         '          .   :    )           !               @       ) ,A-    , 1-             *                
     ) AF:)           
      *                   4%?         )      “random” images 1  

“natural” images                  <     <  !
:          ;         -                 ,     0 C      ,                                    

      HProbabilistic Generative Modelingp(x)How to express, learn, and sample from ahigh dimensional probability distribution ?

https://blog.openai.com/generative-models/Generative Modeling and Physics

Boltzmann Machines
p(x) =eE(x)Zstatistical physics“Born” Machines| (x)|2p(x) =N

quantum physics

Generative Modeling and Physics
Hilbert SpaceArea law
Entanglement

Boltzmann Machines
p(x) =eE(x)Zstatistical physics“Born” Machines| (x)|2p(x) =Nquantum physics

Gifts from Physicists
Tensor Networks

Mean Field Theory

rges et al.: Dynamical mean-field theory of . . .

21(23)

d for a random
tice (all N sites
gs are indepent 2ij 5t 2 /N (seees(24)ving long-range
One possibilityor the Fourier
ice, with either
ails of the denarization to be
toff in the tails,
then a 1/d exantities like thehe cutoff. Otherce between thero temperature,ptibility have ad. The Hilbertn[Im(z)]%. Using
fication arises inger depends on

FIG. 1. Cavity created in the full lattice by removing a single
site and its adjacent bonds.

presented below prove the validity of this constructionin the limit of large dimensions.

Monte Carlo Methods(25)

Quantum Computing

A. The cavity method

The first derivation that we shall present is borrowed
from classical statistical mechanics, where it is known
under the name of ‘‘cavity method.’’ It is not the first
one that has historically been used in the present context, but it is both simply and easily generalized to several models. The underlying idea is to focus on a givensite of the lattice, say i=0, and to explicitly integrate out
the degrees of freedom on all other lattice sites in orderto define an effective dynamics for the selected site.
Let us first illustrate this on the Ising model. The effective Hamiltonian H eff for site o is defined from thepartial trace over all other spins:Uthe inner product between jui and jvi can be directly
calculated from the p:
hujvi ¼ ð0.5 − pÞðjuj þ jvj Þ=jujjvj;
2

2

the statepﬃﬃﬃ
ðj0ianc j0ivec þ j1ianc j1ivec Þ= 2:

ð3Þ

ð5Þ

One photon (anc) is used as the ancillary qubit, and the otherone (vec) will be used to encode the reference and incoming
vectors using Sagnac-like interferometers (see Fig. 1).
To generate three- and four-photon entanglement
resource states, we create two entangled photon pairs.
Two single photons, one from each pair, are temporally andspatially superposed on a polarizing beam splitter (PBS).
We select the events where one and only one single photonemits from each output. It can be concluded that the fourphotons are either all H polarized or V polarized, two casesthat are quantum mechanically indistinguishable when all
the other degrees of freedom of the photons are erased(see the caption of Fig. 1), thus projecting the four photons
into the Greenberger-Horne-Zeilinger entangled state [18]:and the distance between u~ and v~ can then be obtained:
qﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃﬃ
ð4ÞD ¼ 2pðjuj2 þ jvj2 Þ:Quantum Machine Learning
It is important to note that such an estimation can achieve adesired statistical accuracy simply by a sufficient number of
repeated measurements, but is independent of the size (N)of the vectors, which gives a quantum speed-up.
This algorithm can be understood intuitively; the moredifference between the pure states jui and jvi, the moreentangled the Eq. (1) is. For examples, if jui and jvi areidentical,
then the ancillary qubit is in the state ðj0i þ j1iÞ=pﬃﬃﬃ
2, separable from the vector qubits, and p ¼ 0, D ¼ 0.

Search• Sampling• Clustering• Optimization• Linear system solver• Support vector machines• Principal component analysis
•BBO

BBO

HWP
BBO

HWP
HWP
BBO

BBO

HWP
BBO

HWP

HWP
PBS

3PBS

NBS

21PBS

NBS

anc

PBS

NBS

HWP

D3

D2

HWP
Prism

D1

HWP
Prism

PBS

DRDT

HWP
Prism

FIG. 2. (Color online) The schematic diagram of the quantum SVM. An ancillary qubit is added hereThesetup
auxiliary
registers
forlearning
matrixwith
inversion
notshown laser
here.pulses with a central
FIG. 1 (color). result.
Experimental
for quantum
machinephotonic arequbits.
Ultraviolet
wavelength of 394 nm, pulse duration of 120 fs, and a repetition rate of 76 MHz pass through two type-II β-barium borate (BBO)
crystals with a thickness of 2 mm to produce two entangled photon pairs. The photons pass through pairs of birefringent compensators
consisting of a 1-mm BBO crystal and a HWP
ptoﬃﬃﬃ compensate the walk-off between horizontal and vertical polarization, and are prepared
13(a)
(b)
in the quantum state:placed in𝐹arm 3 and anc𝐹are used to transformthe state intopﬃﬃﬃðjHijVi þ jVijHiÞ= 𝐶 2. Two extra 𝐹HWPs
1230ðjHijHi þ jVijViÞ= 2. Two single photons, one from eachpair,aretemporally
andspatiallysuperposed
onaPBS
togenerateaHfourpﬃﬃﬃ
F3
13𝐶 15479.9Hz
photon entangled state: ðjHijHijHijHiþ jVijVijVijViÞ= 2. The photons 1, 2, and 3 are sent to Sagnac-likeinterferometers, whereF2
C and recombines on a nonpolarizing beam
each single photon splits into two spatial modes by the PBS with regard to its polarization,𝐼 HWPs. The-297.7Hz encoded-33130.1Hz
13 specially designed
1 independently
0 beam splitter
splitter (NBS). Various vectors𝐹are
into the two spatial modes using
C
cube is half-PBS coated and half-NBScoated.
High-precisionsmall-angle
prismsareinsertedforfine
adjustments of the relative delay
𝐹2-275.7Hz
64.6Hz-42681.4HzF
1of the two different paths. The photons are detected by five single-photon detectors (quantum efficiency> 60%), and the two four0
photon coincidence events, D3𝐹
D32 D1 DT 39.1Hz
and D3 D2 D1 DR , 51.5Hz
are simultaneously
registered by-56443.5Hz
a homemade FPGA-based coincidence
unit.
-129.0Hz

Cai et al, PRL 114, 110504 (2015)

(c)

𝑇2∗

1.22s

𝑇2

7.9s

0.66s
110504-2
4.4s

0.63s

0.61s

6.8s

4.8s

Tra00HLi et al, PRLS 114,140504 (2015)
H S
HH0H

H00−𝜋/4𝑅𝑦−1

HH

few qubits demo
𝑒 𝑖𝐹𝑡0 /2 𝑒 𝑖𝐹𝑡0 /4𝜋/2𝑅𝑦𝜃

𝑅𝑦1

𝜃

𝑅𝑦1

𝜃

𝑅𝑦2

𝑒 −𝑖𝐹𝑡0 /4 𝑒 −𝑖𝐹𝑡0 /2

𝜋/4𝑅𝑦Matrix inversion“Use a quantum computer to speed up
ML subroutines”

Training-dataOracle

FIG. 3. (Color online)(a) Properties of the 13 C-iodotrifluroethylene. The chemical shifts ⌫i and scal
are on the lower diagonal in the table, respectively. The chemical shifts are given with respect to refe
MHz (Carbon) and 376.48 MHz (Fluorines). (b) The quantum circuit for building the kernel matr
training-data register (the second qubit), the desired kernel matrix K is obtained as the quantumqubit. (c) The quantum circuit for classification. Here H and S are the Hadamard and phase gate,realized [15, 16], with an exponentially speedup. Using the same method, the hyperplane pa
TTby b, ↵~T= F̃ 1 0, ~y T , where the vectors here represent quantum states.

Review “Quantum machine learning”, Biamonte et al, Nature 2017

The classification results in Eq. (2) could be reproduced by the overlap of two quantum statPM
1with the training-data state |ũi = pN
(b|0i|0i + k=1 abs(~xk )↵k |ki|~xk i) and the query-staũP1
2 M. Martinis, and3Daniel
A. F.
Lidar,John
Matthias
TroyerWecker,Sergio
Boixo,
TroelsRønnow,
Sergei V. Isakov,2 Zhihui
Wang,
David
4561
DanielA. Lidar,John
M. Martinis,
and Matthias
TroyerWecker,Information
Sciences
Institute,
Universityof Southern
California,
Los Angeles,CA ∗290089, USA

2
Theoretische
ETH
Zurich, Los
Switzerland
Information
Sciences
Institute, Physik,
Universityof Zurich,Southern8093
California,
Angeles, CA 90089, USA
3
2
Department ofChemistry andCenter
forZurich,
Quantum
Information
Science & Technology,
TheoretischePhysik,
ETH
8093
Zurich, Switzerland
3Universityof Southern
California,
Los Angeles,
California
90089,&USA
Departmentof Chemistry
and Centerfor Quantum
Information
ScienceTechnology,
4Quantum Architectures
andComputation
Group,
MicrosoftResearch,Redmond,
WA
Universityof Southern California, Los Angeles, California 90089, USA 98052, USA
5
4Departmentsof ElectricalGroup,Engineering,
Chemistry
Physics,WA 98052, USA
Quantum Architectures
and Computation
Microsoft
Research,andRedmond,
5 and Center for Quantum Information Science & Technology,
Departments of Electrical Engineering, Chemistry and Physics,
Universityof SouthernCalifornia,
Los Angeles,
California
90089, USA
and Centerfor Quantum
Information
Science& Technology,
6Departmentof Physics,
Universityof California,
Santa California
Barbara, CA93106-9530,
USAUniversityof Southern
California,Los Angeles,90089,
USA
1Quantum Boltzmann Machines$15million “analog quantum device”
Department of Physics, University of California, Santa Barbara, CA 93106-9530, USA
6I.

OVERVIEW

0

4

8

12

16

20

2428I.

OVERVIEW

1054

98

12
13

16
1720
21

24
25

28
29

21

65

9
10

13
14

17
18

21
2225
26

29
30

32

76

10
11

14
15

18
19

22
23

26
2730
31

332

736

1140

15
44

1948

2352

2756

3160

32
33

36
37

40
41

44
45

48
4952
53

56
57

60
61

33
343738414245464950535457
5861623435383942
4346475051545558596263

35
64

3968

4372

4776

5180

55845988639264
656869727376
7780
8184
85

8889

92
93

65
66

69
7073
747778

81
82

85
86

89
90

9394

66
6770
7174
75

78
79

82
8386
87

90
91

94
95

6796

71
100

75
104

79108

83
112

87
116

91
120

95
124

96
97

100
101

104
105

108
109

112
113

116
117

120
121

124
125

97
98

101
102

105
106

109
110

113
114

117
118

121
122

125
126

98
99102
103

106
107

110
111

114
115

118
119122
123

126
127

99

103

107

111115

119

123

127

Here we provide additional details in support of themaintext.
shows detailsof thechimera ofgraph
Herewe Section
provide IIadditionaldetails
in support
theusedour Section
study andthe choiceof graphs
our simulamain intext.
II shows
detailsof the forchimeragraphtions.
III expands
upon thealgorithms
employed
used inSection
our study
and the choiceof graphs
for oursimulain
our study.
IV presents
additional
success
probtions.
SectionSection
III expands
upon thealgorithms
employedabilityhistograms
forIV
diﬀerent
numbersof qubitsandfor
in our study.
Sectionpresents
additional
success
probinstanceswith magnetic
fields, explainsorigin andof easy
ability histogramsfor diﬀerent
numbers theof qubitsforandhard withinstances,and fields,
explains
how thestate
caninstancesmagnetic
explains
thefinal
originof easybe
via a simple
error reduction
Sectionandimproved
hard instances,and explains
how thescheme.
final state
canV
correlation
plots andprovide
more
be presents
improvedfurther
via a simple
error reduction
scheme.
Sectiondetails
on gauge
averaging.
Sectiondetailson
V presents
furthercorrelation
plots VI
andgives
providemore
howweondetermined
the scalingplots VI
andgives
howdetails
quantumdetails
gauge averaging.
Sectionon
speedupcan be detected
on futuredevices.
Finally,sechow we determined
the scalingplotsand how
quantumtion
VII canexplains
how theonspectral
gaps wereFinally,
calculated
speedupbe detected
future devices.
secby
Monte
Carlo
tionquantum
VII explains
howthe (QMC)
spectralsimulations.
gaps were calculated
by quantum Monte Carlo (QMC) simulations.
II.
II.

THE CHIMERA GRAPH OF THE D-WAVE
DEVICE.
THE CHIMERA
GRAPH OF THE D-WAVE
DEVICE.

~2000“qubits”

FIG. 1: Qubits and couplers in the D-Wave device.
TheOne andRainer
chip consistsof D-Wave
4 × 4 unitdevice.
cells ofFIG. D-Wave
1: Qubits
couplersin the1eightqubits, connectedbychipprogrammableinductiveThe D-Wave
One Rainer
consists of 4× 4 unitcouplers
cells of1asshownbylines.
eight qubits, connected by programmable inductive couplers

The qubitsand couplers
in the D-Wave device
canthisbeIs there
anyadvantageofquantum
architecture?
thoughtof
asthevertices
andedges,
respectively,ofaThe qubits and couplers in the D-Wave device can bebipartite
graph,
calledthe “chimeragraph”,
as shown
thought ofas thevertices
and edges,
respectively,of inafigure1. graph,This graphbuiltfrom unit
cellsascontaining
bipartite
calledisthe“chimeragraph”,
shown ineighteach.
Withineach
unitunit
cell cells
the qubits
andfigure qubits
1. Thisgraph
is built
fromcontaining
couplers
realisea complete
bipartitegraph
4,4 where
eight qubitseach.
Within each
unit cell
the Kqubits
andas shown by lines.

Amin et al, 1601.02036 Perdomo-Ortiz et al, 1708.09757

tions. The sizes we typically used in our numerical sim-

Taxonomy of Generative Models
Goodfellow, 1701.00160p(x)Taxonomy of Generative Models
Goodfellow, 1701.00160p(x)Taxonomy of Generative Models
Goodfellow, 1701.00160p(x)Shuo-Hui Li

Taxonomy of Generative Models
Goodfellow, 1701.00160p(x)Shuo-Hui Li+Matrix Product States Jun Wang, Zhao-Yu Han

Taxonomy of Generative Models
Goodfellow, 1701.00160p(x)Shuo-Hui Li+Matrix Product States Jun Wang, Zhao-Yu Han+QuantumCircuits