Professional Documents
Culture Documents
QK NN Grover Bigdata Recomd QIPLSIGML 2018
QK NN Grover Bigdata Recomd QIPLSIGML 2018
QIPLSIGML
Machine Learning meets Quantum Computation
Kraków, Poland, 26.04.2018
1/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
Content
Content
2/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
Motivations
Remark
Not always quantum register can be represented as a tensor product subsystems, in
which case the state of the register is a tangled state
4/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
5/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
Uρ0 U † = ρ1 . (7)
The technique of making a suitable unitary operator for a given quantum register is a
formidable task from the computational point of view. If we want to modify e.g. the first
and the third qudit then a suitable unitary operator is constructed as follows:
U = u1 ⊗ I ⊗ u2 (8)
6/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
As you can see the application of the Hadamard gate, it gives an amplitude
a value equal to the absolute value √12n in all states that a given quantum
register can accept.
7/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
jyi X jx ⊕ yi jyi jx ⊕ yi
(a) (b)
8/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
From the computational point of view two operations must be performed: calcula-
tion of the probability of distribution and the transformation of quantum register is
performed.
9/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
?
?
11/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
Grover’s algorithm
Grover diffusion operator
z }| {
n 2j0n ih0n j I n :::
j0i H ⊗n H ⊗n H ⊗n
Uw
j1i H :::
| {z }
p
Repeat O( N ) times
Grover’s algorithm
j0i H M
. . .
2j ih j I
2j ih j I
.
2j ih j I
. .
r0
. . .
Oracle Uf
Oracle Uf
Oracle Uf
. .
.
j0i H M
r1 j1i j1i
H H
13/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
Grover’s algorithm
αx αx
p1 p1
N N
x∗
0 x x
0
N −1 N −1
αx
p3
N
0 x∗ x
N −1
Given f : 0; :::::; N − 1− > 0; 1 such that f (x) = 1 for exactly one x, find x.
14/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
15/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
The database contains 12051 records. The following types of films exist in
the database:
16/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
Id Year T itle T ime Genres Language IMDb rating IMDb votes Type Hamming
266 1993 T he Legend 100 min Action, Comedy, History Cantonese 7.3 5,475 movie 101100011100100000
334 1994 Princess Caraboo 97 min Comedy, Drama, History English 5.9 2,073 movie 111001100001000000
351 1998 Frank Lloyd Wright 146 min Documentary, Biography, History English 7.8 470 movie 100010011110100000
371 2001 T he Inner Tour 97 min Documentary, History Arabic 7.5 105 movie 100010100000000000
426 1988 Young Einstein 91 min Comedy, History English 5.0 7,034 movie 111001000000000000
500 1987 Matewan 135 min Drama, History English, Italian 7.9 5,739 movie 110000100000000000
545 2004 J apan: Memoirs of a Secret Empire 123 min Documentary, History English 7.6 110 series 100010100000000000
551 1998 America’s J ourney T hrough Slavery 360 min History English 7.4 55 series 100000000000000000
850 1981 Quest for Fire 100 min Adventure, Drama, History French 7.4 15,079 movie 100110110000100000
857 1935 Mutiny on the Bounty 132 min Adventure, Drama, History English, Polynesian 7.8 14,972 movie 100110110000100000
898 1978 Gray Lady Down 111 min Adventure, Drama, History English, Norwegian 6.2 1,87 movie 100110110000100000
994 1961 K ing of K ings 168 min Biography, Drama, History English 7.1 4,3 movie 111101100001000000
1048 2004 Ben Franklin 210 min Documentary, History English 7.4 30 movie 100010100000000000
1061 1921 Orphans of the Storm 150 min Drama, History English 7.9 3,565 movie 110000100000000000
1070 2000 Uncle Saddam 63 min Documentary, Comedy, History English 6.4 221 movie 100010011100100000
1086 1997 Waco: T he Rules of Engagement 165 min Documentary, History English 8.0 2,514 movie 100010100000000000
1147 1996 T he Crucible 124 min Drama, History English 6.8 26,826 movie 110000100000000000
17/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
jq0 i = Musical
(22) (64) (0,531%)
8
>
>
> jq1 i = Fantasy
(3) (64) (0,531%)
>
>
>
>
>
>
>
>
>
>
>
>
jq2 i = Comedy
>
>
>
(574) (2876) (23,865%)
>
>
>
>
>
>
>
>
>
>
>
>
>
jq3 i = Biography
>
>
>
>
(3) (386) (3,203%)
>
>
>
>
>
>
>
>
>
>
Database
>
>
jq4 i =
>
History
jQi = >
<
18/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
q f f k
The total number of qubits:
N=q+f+f+k.
The vector features (feature vector) and user preferences vector are the same
length. Examples of states:
... ... ...
|ψi−1 i = |010|111001|101001|ψk i,
|ψi i = |011|111011|101001|ψk i,
|ψi+1 i = |100|111100|101001|ψk i,
... ... ...
19/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
H
j j qi
qi H
X
X
(a) j ff i
(b)
20/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
j fu i User feature
−i π H^
Ham.Dist. Calculation
Quantum Summing: U = e 2l
Feature vectors
j ff i
21/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
j qi jfqi i
User feature
Measurement
amplification
operation
Dataset
Feature
j ff i jfi i
22/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
Quantum register
Result is j1i
Measure of
c0 qubit
Result jfi i
Blocks represents
quantum calculations part
STOP
23/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
Quantum register
The first l qubits represent the database file, the second l qubitów is a user
feature vector. Initialization of the sub-register with the base of features:
L
1 X p
|Ψ1 i = √ |r1 , . . . , rlp i, (17)
L p=1
where L = 2l . Specifying the form of the ”database” and the user’s vector
results in the following state:
L
!
1 X p p 1
|Ψ2 i = √ |r1 , . . . , rl i ⊗ |t1 , . . . , tl i ⊗ √ (|0i + |1i) (18)
L p=1 2
24/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
Quantum register
Calculation of the Hamming distance between the set of features and the
user’s vector is carried out using the CNOT gates:
The next step is to perform the operation to determine the so-called the sum
of Hamming distances. This operation is performed by the block
Hamm.Summ. Described by the unit operation U:
⊗l
π
−i 2l Ĥ 1 0 1 0
U=e , Ĥ = ⊗ Il×l ⊗ , (21)
0 0 0 −1
25/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
Quantum register
26/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
Quantum register
Assuming that zero was obtained by measuring the state c0 , we get another
state described in the following way:
L
1 X
|ψ6 i = √ mp |ψrcmd i, (25)
L p=1
g L
!
1 X X
|ψ7 i = √ mpr |ψrcmd i + mpnr |ψrcmd i . (26)
L p=1 p=g +1
27/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
Quantum register
Based on the paper [Biham1996, Phys. Rev. A, 60, 2742] we introduce the
mean and the variance for amplitudes:
1
Pq 1
PL
mr (t) = q p=1 mpr (t), mnr (t) = q p=q+1 mpnr (t),
(27)
2 1
PL nr nr 2
σnr (t) = L−q p=q+1 |mp (t) − m (t)|
where t is the iteration number (time) of the algae operation. Grover, for
t = 0 we have an initial distribution of probability amplitudes. The maximum
probability of measuring recommended elements from the database is defined
as:
2 2
Pmax = 1 − (L − q)σnr 2
− 12 (L − q)|mnr (0)| + q|mr (0)| +
2 2
(28)
+ 21 |(L − q)mnr (0) + qmr (0) | ,
q
L
when executing O( q) iteration.
28/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
Initial state
0.12
0.10
Probability
0.08
0.06
0.04
0.02
0.00
f0 f1 f2 f3 f4 f5 f6 f7
Labels for features
The initial state of the selected database with elements for the
recommendation. We assume that we are interested in the feature f1 .
29/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
0.16
0.14
0.12
Probability
0.10
0.08
0.06
0.04
0.02
0.00
f0 f1 f2 f3 f4 f5 f6 f7
Labels for features
The status of the selected database after the implementation of the part
qk-NN, the feature f1 has the highest probability of measurement.
30/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
0.35
State of quantum register after Grover iteration t=0.25
0.30
0.25
0.20
Probability
0.15
0.10
0.05
0.00
f0 f1 f2 f3 f4 f5 f6 f7
Labels for features
The status of the selected database after the implementation of the Grover
gain part for t = 0.25, the f1 feature again has the highest probability of
measurement. 31/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
0.9
State of quantum register after Grover iteration t=1.0
0.8
0.7
0.6
Probability
0.5
0.4
0.3
0.2
0.1
0.0
f0 f1 f2 f3 f4 f5 f6 f7
Labels for features
The status of the selected database after the implementation of the Grover
gain part for t = 1.00, the feature f1 again has the highest probability of
measurement. 32/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
Summary
33/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
Bibliography
Schuld, S., Sinayskiy, I., Petruccione, F.: Quantum Computing for Pattern
Classification. PRICAI 2014: Trends in Artificial Intelligence,Springer International
Publishing, p. 208-220 (2014)
Mateus, P., Omar, Y.: Quantum Pattern Matching. arXiv preprint:
quant-ph/0508237v1 (2005)
Pinkse P.W.H., Goorden S.A., Horstmann M., Skoric B., Mosk A.P.:Quantum
pattern recognition. Lasers and Electro-Optics Europe (CLEO EUROPE/IQEC),
2013 Conference on and International Quantum Electronics Conference, Munich, pp.
1-1. (2013)
Schaller G., Schützhold R.: Quantum algorithm for optical-template recognition with
noise filtering. Phys. Rev. A 74, pp. 012303 (2006)
Schuld, M., Sinayskiy, I., Petruccione, F.: Quantum computing for pattern
classification. In: 13th Pacific Rim International Conference on Artificial Intelligence
(PRICAI) and Also Appear in the Springer Lecture Notes in Computer Science 8862
(2014)
Trugenberger, C.A.: Quantum Pattern Recognition. Quantum Information
Processing 1(6), 471–493, Springer (2002)
Yue Ruan, Hanwu Chen, Jianing Tan, Xi Li: Quantum computation for large-scale
image classification. Quantum Information Processing 15(10), 4049–4069, Springer
(2016)
34/ 35
Introduction System description and structure of classic and quantum data Numerical example Summary
Bibliography
Wiebe N., Kapoor A., Svore K.M.: Quantum algorithms for nearest-neighbor
methods for supervised and unsupervised learning, Quantum Information &
Computation, Vol. 15 Issue 3-4, pp. 316 – 356 (2015)
Erdal, A.: An Information-Theoretic Analysis of Grover’s Algorithm. Quantum
Communication and Information Technologies, Springer Netherlands, 339–347 (2003)
Alpaydin, E.: Introduction to machine learning. MIT press (2004)
Armbrust, M., Fox, A., Griffith, R., Joseph, D.A., Katz, R., Konwinski, A., Lee, G.,
Patterson, D., Rabkin, A., Stoica, I., Zaharia, M.: A view of cloud computing.
Commun. ACM. 4, 50-58 (2010)
Brassard, G., H.P.: An exact quantum polynomial-time algorithm for simon’s
problem. IEEE Computer Society Press pp. 12-23 (1997)
Busemeyer, J., B.P.: Quantum models of cognition and decision. Cambridge
University Press (2012)
Hechenbichler, K., S.K.: Weighted k-nearest-neighbor techniques and ordinal
classification. Sonderforschungsbereich p. 399 (2004)
Fortuna, B.,C., Dunja, C.,M.: Real-Time News Recommender System. Machine
learning and knowledge discovery in databases. European conference, ECML PKDD
2010, Barcelona, Spain, September 20–24, 2010. Proceedings, Part III (pp.583-586)
Biham, E.,O., Biron, D., Grassl, M., Lidar, D.: Grover’s quantum search algorithm
for an arbitrary initial amplitude distribution. Phys. Rev. A 60, 2742 (1999)
35/ 35