T E L K O M N I K A  T elec o m m un ica t io n,  Co m pu t ing ,   E lect ro nics   a nd   Co ntr o l   Vo l.   1 8 ,   No .   3 ,  J u n e   2 0 2 0 ,   p p .   13 19 ~ 133 0   I SS N:  1 6 9 3 - 6 9 3 0 ,   ac cr ed ited   First Gr ad e  b y   Kem en r is tek d i k ti,  Dec r ee   No : 2 1 /E/KPT /2 0 1 8   DOI : 1 0 . 1 2 9 2 8 /TE L KOM NI K A. v 1 8 i 3 . 1 4 7 5 5     1319       J o ur na l ho m ep a g e :  h ttp : //jo u r n a l.u a d . a c. id /in d ex . p h p /TELK OM N I K A   Web - a pp  real iza t io n of  S ho r’s  qua ntum  factoring  al g o rithm    a nd  G ro v er’s  qua ntum sea rch  alg o rithm       Ary a   Wica k s a na ,   Ant ho ny ,   Adj ie  Wa hy u Wica k s o no   De p a rtme n t  o f  In fo rm a ti c s,  Un i v e rsitas   M u lt ime d ia N u sa n tara ,   In d o n e sia       Art icle  I nfo     AB S T RAC T   A r ticle  his to r y:   R ec eiv ed   Sep   7 ,   2 0 1 9   R ev is ed   J an   2 1 ,   2 0 2 0   Acc ep ted   Feb   2 5 ,   2 0 2 0     Qu a n tu m   a lg o rit h m s  a re   we ll - k n o wn   f o r  th e ir  q u a d ra ti c   if  n o t  e x p o n e n t ial   sp e e d u p   o v e r  t h e ir  c las sic a l  c o u n terp a rts.   T h e   two   wi d e ly - k n o w n   q u a n tu m   a lg o rit h m s  a re   S h o r’s  q u a n t u m   fa c to rin g   a lg o r it h m   a n d   G ro v e r’ s  q u a n t u m   se a rc h   a lg o rit h m .   S h o r’s  q u a n t u m   fa c to rin g   a lg o rit h m   c o u ld   p e rf o rm   in teg e r  fa c to riza ti o n   in   O(lo g N).  G ro v e r’s  q u a n tu m   se a rc h   a l g o rit h m   c o u l d   so lv e     th e   u n s o rted   se a rc h   p ro b lem   in   O(√ N).  Ho we v e r,   b o t h   a lg o rit h m s  a re   in tro d u c e d   a s th e o re ti c a l  c o n c e p ts   in   th e   o ri g in a l  p a p e rs d u e   to   th e   l imitatio n s   o f  q u a n t u m   t e c h n o l o g y   a t   t h a t   t i m e .   I n   t h i s   p a p e r ,   a n   i m p r o v e d   w a y   i s   p r e s e n t e d   t o   r e a l i z e   t h e   t w o   a l g o r i t h m s   i n t o   a   w e b   a p p l i c a t i o n   u s i n g   s t a t e - of - t h e - a r t   q u a n t u m   t e c h n o l o g y .   T h e   w e b - a p p   i s   d e s i g n e d   a n d   b u i l t   c o n s i d e r i n g   t h e   u s e s   o f   a   q u a n t u m   s i m u l a t o r   a n d   l i b r a r i e s   p r o v i d e d   b y   P r o j e c t Q   a n d   R i g e t t i   F o r e s t .   T h e   r e s u l t   s h o w s   t h a t   b o t h   a l g o r i t h m s   a r e   r e a l i z a b l e   i n t o   w e b - a p p l i c a t i o n s .   K ey w o r d s :   Gr o v er   Qu an tu m   ap p licatio n   Sh o r   W eb - ap p   T h is i s  a n   o p e n   a c c e ss   a rticle   u n d e r  th e   CC B Y - SA   li c e n se .     C o r r e s p o nd ing   A uth o r :   Ar y a  W icak s an a,     Dep ar tm en t o f   I n f o r m atics,   Un iv er s itas   Mu ltime d ia  Nu s an tar a,   Scien tia  B o u lev ar d   St. ,   Gad in g   Ser p o n g ,   T an g er an g - 1 5 8 1 0 ,   B an ten ,   I n d o n esia.   E m ail: a r y a. wica k s an a@ u m n . ac . id       1.   I NT RO D UCT I O N   Qu an tu m   co m p u tin g   c o u ld   d r iv e  th e  p r o g r ess   o f   b r ea k th r o u g h s   in   s cien ce   b y   lev e r ag in g   q u an t u m   m ec h an ical  p h en o m en a   to   e m p lo y   i n f o r m atio n   [ 1 - 5 ] .   I n   1 9 9 4 ,   M I T ’ s   Peter   Sh o r   s h o ws  t h at  it’s  p o s s ib le  to   f ac to r   a  n u m b er   in to   its   p r im e s   o n   a  q u an tu m   c o m p u te r   in   p o ly n o m ial  tim e  [ 6 - 9 ] .   T h is   is   a  p r o b lem   th at  ta k es   class ical  co m p u ter s   “a n   ex p o n en tially   lo n g   tim e”   to   s o l v e  f o r   lar g e  n u m b er s   [ 10 ,  11 ] .   I n   1 9 9 6 ,   L o v   Gr o v e r   in tr o d u ce s   a  f ast  q u an t u m   m e ch an ical  alg o r ith m   f o r   u n s o r te d   d atab ase  s ea r ch .   T h e  q u an tu m   s ea r ch   alg o r ith m   tak es  O( √ N)   f o r   th e  u n s o r ted   d atab ase  s e ar ch   p r o b lem   [ 12 ]   an d   allo ws  q u ad r atic  s p ee d u p   o v er   its   class ical   co u n ter p a r t  b y   u s in g   am p lit u d e  am p lific atio n   in   q u an tu m   co m p u tin g .   T h e  two   q u a n tu m   alg o r ith m s   ar e   in tr o d u ce d   as th eo r etica l c o n c ep ts   in   th eir   o r ig i n al  p ap e r s   with   n o   d etailed   im p lem en tatio n .   T o d ay ’ s   s tate - of - th e - ar t   q u a n t u m   co m p u tin g   tech n o lo g ies  [ 13 ]   a r e  d eliv er ed   b y   R ig etti,  I B M,   E T H   Z u r ich ,   Mic r o s o f t,  I n tel,   an d   Go o g le.   T h e  s o f twar e  p latf o r m s   r esp ec tiv ely   ar e  Fo r est,  Qis k it,  Pro jectQ,   an d   Qu an tu m   Dev el o p m en t   Kit.  T h e  B r is tleco n e  is   Go o g le’ s   lat est  q u an tu m   co m p u ter   with   t h e  m o s t  n u m b er   o f   q u b its   to - d ate  ( 7 2   q u b its )   [ 13 ]   alo n g   with   Sy ca m o r e   ( 5 3   q u b its )   [ 1 4 ,  1 5 ] .   R ig etti  Fo r est,   o n   th e   o th er   h a n d ,   is   a  q u an tu m   v ir tu al  m ac h in e  ( QVM )   th at  is   av ailab le  f o r   p u b lic  u s e  to   d o   q u an t u m   p r o g r am m in g   an d   co m p u tatio n al  s im u latio n s   o n   a  class ical  co m p u ter   [ 16 ] .   E T H  Z u r ich ’ s   Pro jectQ  is   a  p u b licly   ac ce s s ib le  Py th o n   lib r a r y   a n d   f r am ewo r k   th at  allo ws  q u an tu m   co m p u tin g   u s in g   a  class ical  co m p u ter   [ 17 ] .   T h ese  two   q u an tu m   v ir tu al  m ac h in e   ( Fo r est  an d   Pr o jectQ)   ar e  s u it ab le  f o r   r ea lizin g   th e  Sh o r ’ s   q u an t u m   f ac to r in g   alg o r ith m   an d   Gr o v e r ’ s   q u an t u m   s ea r ch   alg o r ith m   in to   a  we b   ap p licatio n   d u e  to   th eir   q u an tu m   lib r ar y   s u p p o r t   f o r   ea ch   alg o r ith m .   Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   1 6 9 3 - 6 9 3 0   T E L KOM NI KA   T elec o m m u n   C o m p u t E l Co n tr o l ,  Vo l.  1 8 ,   No .   3 ,  J u n e   2 0 2 0 :    13 19   -   1 3 3 0   1320   A  r elate d   s tu d y   o n   t h e  r ea liza tio n   o f   a  q u an tu m   alg o r ith m   i n to   a  web   ap p lica tio n   co u ld   b e  f o u n d   in   q u an tu m   co m p u tin g   p lay g r o u n d   ( QC P)  [ 1 8 ] .   T h e  QC P  d e m o n s tr ates  th e  wo r k   o f   Sh o r ’ s   q u an tu m   f ac to r in g   alg o r ith m   an d   Gr o v er ’ s   q u a n tu m   s ea r ch   alg o r ith m .   I t  is   a  web - b ased   W eb GL   C h r o m e  e x p er im en t  th at  is   cr ea ted   b y   a   g r o u p   o f   Go o g le  en g in e er s   in   2 0 1 4   u s in g   QScr i p t.  Ho wev er ,   t h e  QC P’s  web - ap p   h as  a  lim itatio n   o f   u s in g   o n ly   o n e  q u an t u m   r e g is ter   with   s ize  u p   to   2 2   q u b its   an d   n o   p o s s ib le  p o r ta b ilit y   n o r   c o n n ec tiv ity   to   th e  g ate  lev el  q u a n tu m   h a r d war e.   I t  also   d o es  n o t  s u p p o r t  co n n ec tiv ity   with   th e  s tate - of - th e - a r ts   q u an tu m   tech n o lo g ies.    T h u s ,   th is   p ap er   p r o p o s es  an   im p r o v e d   way   o f   d esig n   an d   im p lem en tatio n   f o r   th e  tw o   q u an t u m   alg o r ith m s   ( Sh o r ’ s   an d   Gr o v er ’ s )   in to   a  web   ap p licati o n .   I t  is   to   ad d r ess   th e  lack   o f   d esig n   an d   im p lem en tatio n   d etails  u p   t o   th is   d ate  f o r   b o th   q u an t u m   alg o r ith m s   u s in g   s tate - of - th e - ar ts   q u an tu m   tech n o lo g ies   [ 1 9 - 22] .   W eb   p l atf o r m   is   ch o s en   f o r   th e   r ea liz atio n   o f   th e   q u an tu m   alg o r ith m s   to   allo w   ea s e  o f   u s e  an d   ac ce s s .   T h e   q u a n tu m   tech n o l o g ies  th at  a r e  u s ed   f o r   th e   web - a p p   r ea lizatio n   a r e  R ig etti  Fo r est  f o r   Gr o v er ’ s   q u an t u m   s ea r c h   al g o r ith m   an d   E T H   Z u r ic h   Pr o jectQ  f o r   Sh o r ’ s   q u an tu m   f ac to r in g   alg o r ith m .     T h e  two   q u an tu m   co m p u tin g   tech n o lo g ies  ar e   ch o s en   d u e   to   th eir   s u p p o r t   an d   av ailab ilit y   f o r   g e n er al  u s er s :   d o cu m e n tatio n   an d   e x am p les.   B o th   Fo r est  an d   Pro jectQ  u s e  Py th o n   as  th eir   p r o g r am m i n g   lan g u ag e,   h en ce   Flas k   m icr o   web   f r am ew o r k   co u ld   b e  u s ed   f o r   th e   web - a p p   d e v elo p m e n t  s in ce   it  is   also   wr itten   in   Py th o n .   T h e  p er f o r m a n ce   o f   th e   web - a p p   r ea lizatio n   in   te r m s   o f   th e  e x ec u tio n   tim e   is   co m p a r ed   with   th e  QC P’s  r esu lt   u n d er   t h e  s am e  s im u latio n   s ce n ar io   an d   p ar a m eter s .       2.   RE S E ARCH   M E T H O D   T h e  r esear ch   m eth o d s   u s ed   ar e  liter atu r e  r ev iews,  d esig n   an d   im p lem en tatio n ,   an d   te s tin g   an d   ev alu atio n .   T h e  liter atu r e   r ev iews  in clu d e  q u a n tu m   b i t,  u n iv er s al  q u an tu m   g ate,   Sh o r ’ s   q u an tu m   f ac to r i n g   alg o r ith m   [ 2 3 ] ,   Gr o v e r ’ s   q u a n tu m   s ea r ch   alg o r ith m ,   Qu a n tu m   C o m p u tin g   Play g r o u n d ,   E T H  Z u r ich   Pro jectQ  f r am ewo r k ,   an d   R ig etti  Fo r est  SDK.   T h e  d esig n   o f   th e  im p l em en tatio n   o f   t h e  q u a n tu m   alg o r ith m   is   d escr ib ed   u s in g   a  f lo wch a r t.  I n   t h is   r esear ch ,   th e  q u an tu m   er r o r   co r r ec ti o n   an d   an cilla  q u b its   ar e  n o t ta k en   in to   ac c o u n t.   T h e  web - ap p   r ea lizatio n   o f   th e  Sh o r ’ s   q u a n tu m   f ac t o r in g   al g o r ith m   is   d o n e  u s in g   t h e  E T H  Z u r ich   Pro jectQ  f r am ewo r k   an d   Flas k .   Me an wh ile  f o r   G r o v e r ’ s   q u an tu m   s ea r ch   alg o r ith m   is   d o n e  u s in g   R ig etti  Fo r est  SDK  wi th   p y Qu il  lib r a r y   an d   Flas k .   T wo   co m p u ter s   with   d if f er en t  h a r d war e  s p ec if icatio n s   ar e  u s ed   f o r   th e  im p lem e n tatio n   p ar t .   T h e  test in g   is   d o n e  u s in g   th e  wh ite - b o x   test in g   m e th o d o lo g y   an d   th e   p er f o r m an ce   o f   th e  we b - ap p   i s   m ea s u r ed   b y   th e  e x ec u tio n   t im e  an d   co m p ar ed   with   th e   Q u an tu m   C o m p u tin g   Play g r o u n d   u n d er   th e   s am e  s im u latio n   s ce n ar io   a n d   p ar am e ter s   as p r esen ted   in   [ 2 4 ,  2 5 ] .     2 . 1 .   Sh o r’ s   im plem ent a t io n desi g n   Fig u r e  1   s h o ws  Sh o r ’ s   q u a n t u m   f ac to r in g   alg o r ith m   f l o wch ar t.  First,  th e   u s er   is   ask e d   to   in p u t  a   p o s itiv e  in teg er   v alu e  i.e .   N.   T h e  in p u t  is   ev alu ated   an d   r e tu r n ed   with   tr u e  if   N  m o d u lo   b y   2   eq u als  0 ,   an d   r etu r n s   f alse  o th er wis e.   T h e  n ex t  p r o ce s s   is   th e  in s p ec tio n   p r o ce s s   if   N  is   p r im e  o r   n o t.   Sam e  as  th e  p r ev io u s   p r o ce s s ,   th is   p r o ce s s   will  r etu r n   tr u e  o r   f alse  d ep e n d in g   o n   th e  v al u e  o f   N  e n ter ed .   I f   th e   v alu e  o f   N  ca n   b e   u s ed   u p   m o d u lated   b y   a  n u m b er   s m aller   th an   its elf ,   th is   p r o ce s s   will  r etu r n   a  f alse  v alu e.   Fu r th er m o r e,     th e  v alu e   o f   th e   v a r iab le  q   is   d eter m in ed   b y   f in d i n g   a  r a n k   o f   2   th at  is   g r ea ter   o r   eq u al   to   th e  v alu e   o f   N 2 .   T h is   p r o ce s s   will  ad d   o n e  t o   th e  p o wer   v ar iab le  u n til  a  d is p lace m en t  o f   two   is   g r ea te r   th an   t h e  t ar g et.   T h is   p r o ce s s   f lo wch ar t  ca n   b e   s ee n   in   Fig u r e  2   n o tated   b y   o f f - p ag e   r ef er en ce   1 .   Af ter   th at,   th e  v alu e  o f   th e   v ar iab le   x   is   d eter m in ed   r an d o m ly .   T h e   s u b - q u a n tu m   r o u tin e   o f   Sh o r ' s   q u an tu m   f ac to r in g   alg o r ith m   will  b e  r u n   if   x   is   co p r im e  with   N  an d   N  is   n o t p r im e  n o r   ev en .   On - p ag e  r ef e r en ce   C   d escr ib e s   th e  in itializatio n   p r o ce s s   o f   v ar iab les  wh ich   will  later   b e  u s ed   in   th e   q u an tu m   co m p u tatio n   p r o ce s s   wh ich   i s   n o tated   b y   th e   o n - p ag e  r ef e r en ce   D  in   Fig u r e   2 .   T h e  n   v alu e   in   th is   p r o ce s s   s to r es  th e   b it  s ize  n e ed ed   to   r e p r esen t  in te g er s   u p   to   t h e  v ar iab le  q   m in u s   o n e.   Nex t,  t h e  q u an tu m   r eg is ter   is   in itialized   to   s ize  n ,   th e  b it  s ize  p r ev i o u s ly   ca lcu lated .   T h is   q u a n t u m   r e g is ter   will  th en   b e  p ass ed   th r o u g h   th e  Ha d am ar d   g ate  to   en ter   th e  s u p er p o s itio n   s tate  o f   all  n u m b er s   f r o m   ze r o   to   q   m in u s   o n e.   A  q u b it  will  also   b e  in itialized   as   a  ct r l_ q u b it   v ar iab le.   T h e   m ea s u r em en t  v a r iab les  ar e   cr ea ted   a s   n - s ized   ar r ay s   to   s to r e  th e  v alu e  o f   m o d u lar   e x p o n en tiatio n   at  a  later   s tep .   T h e  n e x t  p r o ce s s   is   m o d u l ar   ex p o n e n tiatio n .   T h is   s tep   is   r ep ea ted   f o r   n   n u m b er   o f   tim es.    T h e  cu r r e n t_ x   v alu e  is   f illed   with   th e  v alu e  f r o m   t h e  ca l cu latio n   o f   p o w  ( x ,   1   <<   ( n - 1 - k ,   N) )   wh er e  k   is     th e  i ter ato r   o f   th e   r ep etitio n   o f   th e   p r o ce s s .   T h en ,   th e   ctr l_ q u b it  v ar iab le   is   b r o u g h t  to   a   s u p er p o s itio n   s tate   b ef o r e   th e  c o n tr o l  s tatem en t  i s   ex ec u ted .   I f   th e   co n d itio n s   i n   th e  C o n tr o l  s tatem en t  ar e   s atis f ied ,   th e  m o d u lar   m u ltip licatio n   ca lcu latio n   is   co n tin u ed .   T h e  m o d u la r   m u l tip licatio n   p r o ce s s   ex ec u tes  u s in g   th e  q u an tu m   r eg is ter   a  as  th e  b ase,   cu r r en t _ x   as  th e  m u ltip lier ,   a n d   N  as   th e  v alu e   th at  will  p er f o r m   th e  m o d u lo   o p er atio n   o n   th e  p r ev io u s   m u ltip licatio n   r esu lt.  T h e  last   s tep   in   th e  q u a n tu m   co m p u tatio n   p r o ce s s   is   t h e  m ea s u r em en t o f   th e  v alu e  o f   ctr l_ q u b it.   T h e  m ea s u r ed   v alu e   is   p u t  in t o   th e  m ea s u r em en t  a r r ay   at   th e  k - in d ex ,   wh er e  k   is     Evaluation Warning : The document was created with Spire.PDF for Python.
T E L KOM NI KA   T elec o m m u n   C o m p u t E l Co n tr o l         Web - a p p   r ea liz a tio n   o f  S h o r ’ s   q u a n t u m  fa cto r in g   a lg o r ith m  a n d   G r o ve r ’ s   q u a n tu m…   ( A r y a   Wica ksa n a )   1321   th e  iter ato r   o f   th is   p r o ce s s   l o o p .   T h e   p er i o d   o f   N  co u ld   b e   f o u n d   b y   ad d in g   u p   all  v alu es  o f   th e   ar r ay   m ea s u r em en ts   an d   lo o k   f o r   th e  b est r atio n al  ap p r o x im atio n   f r o m   th at  v al u e.   Af ter   th e  p er io d   o f   N,   r ep r ese n ted   b y   th e  v a r iab le  r   is   f o u n d ,   r ’ s   v alu e  is   ch ec k ed   wh eth er   o r   n o t  it  is   o d d .   I f   it  is   o d d ,   t h e  v alu e  is   m u ltip lied   b y   2 .   T h e  two   f ac t o r s   o f   N  co u l d   b e  d ete r m in ed   b y   ca lcu latin g   t h e  v alu es  o f   GC D  ( ( x (r/2) +1 ) ,   N)   an d   GC D  ( ( x (r/2) - 1 ) ,   N) .   B o th   v alu es  ar e  s to r ed   in   v ar iab les  f 1   an d   f 2   r esp ec tiv ely .   I f   th e  p r o d u ct  o f   f 1   an d   f 2   m u ltip les  d o   n o t  p r o d u ce   N  an d   is   m o r e  th an   1 ,   th e  v alu e  o f   f 1   b ec o m es  th e   p r o d u ct   o f   f 1   b y   f 2   an d   f 2   b ec o m es  t h e  r esu lt   o f   th e   d iv is io n   o f   N  b y   f 1 .   I f   th e  f ac to r   o f   N  f o u n d ,   th e  p r o g r am   will  is s u e  b o th   v alu es.  I f   n o t,  th e   p r o g r am   n o t if ies  th at  th e  ca lcu latio n   is   f ailed .   T h is   f ailu r e  is   p ar t  o f   th e   p r o b ab ilis tic  n atu r e  o f   q u a n tu m   s u p er p o s itio n .   T h e  f lo wch a r t  d esig n   f o r   th is   la s t  s tep   is   s h o wn   i n   Fig u r e  3 .           Fig u r e  1 .   Sh o r ’ s   q u a n tu m   f ac to r in g   alg o r ith m   f lo wch ar t ( p ar t o n e)       Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   1 6 9 3 - 6 9 3 0   T E L KOM NI KA   T elec o m m u n   C o m p u t E l Co n tr o l ,  Vo l.  1 8 ,   No .   3 ,  J u n e   2 0 2 0 :    13 19   -   1 3 3 0   1322       Fig u r e  2 .   Sh o r ’ s   q u a n tu m   f ac to r in g   alg o r ith m   f lo wch ar t ( p ar t two )                 Evaluation Warning : The document was created with Spire.PDF for Python.
T E L KOM NI KA   T elec o m m u n   C o m p u t E l Co n tr o l         Web - a p p   r ea liz a tio n   o f  S h o r ’ s   q u a n t u m  fa cto r in g   a lg o r ith m  a n d   G r o ve r ’ s   q u a n tu m…   ( A r y a   Wica ksa n a )   1323       Fig u r e  3 .   Sh o r ’ s   q u a n tu m   f ac to r in g   alg o r ith m   f lo wch ar t ( p ar t th r ee )       2 . 2 .   G ro v er ’ s   im plem ent a t io n desi g n   Fig u r e  4   s h o ws Gr o v er ’ s   q u an tu m   s ea r ch   alg o r ith m   f lo wch a r t.  First,  th e  u s er   en ter s   in p u t d ataset  an d   tar g et  to   b e  s ea r ch e d .   T h e  p r o g r a m   will  co n v e r t  tar g et  to   b in ar y   r ep r esen tatio n   an d   s to r ed   in   v ar ia b le   d ataT ar g et.   T h en ,   th e  p r o g r a m   will  s ea r ch   f o r   m ax   v alu e  in   th e  d ataset.   T h e  m ax   v alu e  b in ar y   r ep r esen tatio n   will  b e  s to r ed   i n   v a r iab le  b it  s tr in g .   T h e   n u m b er   o f   q u a n tu m   b its   th at  will  b e   u s ed   d ep e n d s   o n   th e   len g th   o f   th e  b it  s tr in g .   Qu an tu m   p r o g r am   is   n ee d ed   in   R ig etti  Fo r es t   SDK.   T h e  Or ac le  f u n ctio n   an d   Dif f u s io n   m atr ix   ar e  cr ea ted   an d   ad d ed   to   t h e   q u an tu m   p r o g r am   as  a  n ew  g ate.   T h e  f ir s t  s tep   in   Gr o v er ’ s   q u an tu m   s ea r c h   alg o r ith m   is   to   ap p ly   Had am a r d   tr an s f o r m   o n   e v er y   q u b it  to   m ak e  ev er y   s tate  h av e  th e  s am e  am p litu d e.   T h e   n ex t  s tep   is   th e  am p litu d e  am p lific atio n   p r o ce s s ,   wh ich   i s   o b tain ed   b y   d o i n g   Or ac le  f u n ctio n   an d   Ma tr ix   Dif f u s io n   with   ᴨ 4   lo o p s .   Or ac le   f u n ctio n   will  r etu r n   1   f o r   th e   co r r ec t  s tate  a n d   r etu r n   0   f o r   t h e  wr o n g   s tate.   Di f f u s io n   m atr ix   will in v e r s e  th e  am p litu d e  a r o u n d   th e  a m p li tu d es m ea n .   Fig u r e  5   s h o ws  th e   co n ti n u ati o n   o f   Gr o v er ’ s   q u a n tu m   s ea r c h   alg o r ith m   f lo wch ar t.   T h e   p r o g r am   will   r eser v ed   m em o r y   s p ac e  with   th e  s ize  o f   th e  n u m b er   o f   q u b it.  T h en ,   ev er y   q u b its   will   b e  m e asu r ed   wit h   m ea s u r e  f u n ctio n   f r o m   p y Q u il  lib r ar y .   Af ter   th at,   th e  p r o g r a m   will  o p en   a  co n n ec tio n   to   t h e  q u a n tu m   v ir tu al   m ac h in e  an d   r u n   t h e  q u an tu m   p r o g r a m .   T h e  r esu lt  will  b e   co m p ar ed   with   th e  v alu e  in s id e  v ar iab le  d ataT a r g et   to   ch ec k   wh et h er   o r   n o t it  is   th e  s am e.       Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   1 6 9 3 - 6 9 3 0   T E L KOM NI KA   T elec o m m u n   C o m p u t E l Co n tr o l ,  Vo l.  1 8 ,   No .   3 ,  J u n e   2 0 2 0 :    13 19   -   1 3 3 0   1324       Fig u r e  4 .   Gr o v er ’ s   q u an tu m   s ea r ch   alg o r ith m   f lo wch a r t ( p a r t o n e)       Evaluation Warning : The document was created with Spire.PDF for Python.
T E L KOM NI KA   T elec o m m u n   C o m p u t E l Co n tr o l         Web - a p p   r ea liz a tio n   o f  S h o r ’ s   q u a n t u m  fa cto r in g   a lg o r ith m  a n d   G r o ve r ’ s   q u a n tu m…   ( A r y a   Wica ksa n a )   1325       Fig u r e  5 .  Gr o v er ’ s   q u an tu m   s ea r ch   alg o r ith m   f lo wch a r t ( p a r t two )       3.   RE SU L T S  A ND  AN AL Y SI S     I n   th is   s ec tio n ,   f iv e  test   s ce n ar io s   ar e  u s ed   f o r   test in g   t h e  web - ap p   im p lem en tatio n s   f o r   b o th   q u an tu m   alg o r ith m s   r esp ec tiv ely .     3 . 1 .   Sh o r’ s   web - a pp   re a liza t io n   Her e  th e   im p lem en tatio n   co d e  in   Py th o n   u s in g   E T H  Z u r i ch ’ s   Pro jectQ  f r am ewo r k   is   d escr ib ed .   Fig u r e  6   ( a )   s h o ws  th e  in itia lizatio n   p h ase  o f   Pr o jectQ’ s   q u an tu m   s im u lato r .   T h e   q u a n tu m   r eg is ter   n   is   allo ca ted   b y   th e  e n g in e  a n d   p u t  in to   s u p er p o s itio n   b y   u s in g   th e  Had am ar d   g ate.   T h e  m o d u lar   ex p o n en tiatio n   p r o ce s s   is   im p lem en ted   u s in g   f u n ctio n   M u ltip ly B y C o n s tan tMo d N  as d is p lay ed   in   Fig u r e  6   ( b ).   Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   1 6 9 3 - 6 9 3 0   T E L KOM NI KA   T elec o m m u n   C o m p u t E l Co n tr o l ,  Vo l.  1 8 ,   No .   3 ,  J u n e   2 0 2 0 :    13 19   -   1 3 3 0   1326       ( a)   ( b )     Fig u r e  6 .  ( a )   Qu an t u m   co m p u t in g   in itializatio n   co d e ,   an d   ( b )   m o d u lar   ex p o n en tiatio n   c o d e       T h e  p e r io d   f in d in g   is   th e   im p o r tan t  s tep   o f   Sh o r ’ s   q u an tu m   f ac to r i n g   al g o r ith m .   I t   is   in   f a ct  th e  o n ly   p ar t  o f   th e  alg o r ith m   th at  r eq u ir es  a  q u an tu m   co m p u ter .   T h e   im p lem en tati o n   o f   th e  p er io d   f in d in g   is   g iv en   in   Fig u r e  7 .   Fig u r e  8   s h o ws th e  f in al  p ar t o f   th e  alg o r ith m   wh ic h   is   f in d in g   th e  f ac to r s   o f   th e  in p u t.   T h e  web - a p p   r ea lizatio n   in   Fig u r e  9   s h o ws  s u cc ess f u l  d esig n   an d   i m p lem en tatio n   o f   t h e  Sh o r ’ s   q u an tu m   f ac to r i n g   alg o r ith m .   T h e  g iv e n   in p u t  is   3 3   wh ich   is   n o t  e v en   n o r   p r i m e.   T h e  f ac to r s   ar e  3   a n d   1 1   wh ich   ar e  co r r ec tly   o b tain ed   b y   th e  s im u latio n   g iv en   in   Fig u r e  9 .           Fig u r e  7 .  Per io d   f in d in g   c o d e           Fig u r e  8 .  Facto r s   f in d in g   c o d e           Fig u r e  9 .  Sh o r ’ s   alg o r ith m   s im u latio n   f o r   f in d in g   f ac to r s   o f   3 3   Evaluation Warning : The document was created with Spire.PDF for Python.
T E L KOM NI KA   T elec o m m u n   C o m p u t E l Co n tr o l         Web - a p p   r ea liz a tio n   o f  S h o r ’ s   q u a n t u m  fa cto r in g   a lg o r ith m  a n d   G r o ve r ’ s   q u a n tu m…   ( A r y a   Wica ksa n a )   1327   I n   Fig u r e   1 0 ,   th e  web - a p p   r e aliza tio n   o f   th e   Sh o r ’ s   q u an t u m   f ac to r i n g   alg o r ith m   is   ab le  to   f in d     th e  f ac to r s   o f   9 1 ,   wh ich   ar e  7   an d   1 3 .   T h is   ex h i b its   th e  s u cc ess   o f   th e  im p lem en tatio n   o f   th e  alg o r ith m   in   Pro jectQ  f r am ew o r k   a n d   also   th e  d ev elo p m en t  o f   th e  web - ap p   f o r   th e  im p lem en tatio n   t o   b e  ac ce s s ed   an d   u s ed   u s in g   web   b r o wser   co n v e n ien tly .           Fig u r e  10 .  Sh o r ’ s   alg o r ith m   s i m u latio n   f o r   f in d in g   f ac to r s   o f   9 1       3 . 2 .   G ro v er ’ s   web - a pp   re a liza t io n   T h er e  ar e  3   s tep s   in   im p le m en tin g   th e  Gr o v er ’ s   q u an t u m   s ea r ch   alg o r ith m .   T h ese   s tep s   ar e   in itializatio n ,   am p litu d e  am p lific atio n ,   an d   m ea s u r e.   Fi g u r e  1 1   s h o ws  th e  im p le m en tatio n   co d e   f o r   in itializatio n   in   R ig ett i  Fo r est.   T h is   in itializa tio n   aim s   to   m a k e  q u b its   h av e  th e  s am e  am p litu d e  f o r   ea ch   s tate.   I n   th is   p iece   o f   c o d e,   in itializatio n   is   o b tain ed   b y   ap p l y in g   t h e  Had am a r d   g ate  to   ea ch   q u b it.   Fig u r e  1 2   s h o ws  th e  am p litu d e  a m p lific atio n   i m p lem en tatio n   u s in g   R ig etti  Fo r est.  T h e  n u m b er   o f   r ep etitio n s   n ee d e d   is   4 √ .  I n   th is   iter atio n   p r o ce s s ,   th e  O r ac le  f u n ctio n   an d   Dif f u s io n   m atr ix   ar e  ap p lied .           Fig u r e  11 .  Su p er p o s itio n   in itializatio n   f o r   all  q u b its             Fig u r e  12 .  Am p litu d e  am p lific atio n   co d e       T h e  Or ac le  f u n ctio n   is   n o t  p a r t  o f   th e  Gr o v er ’ s   q u an tu m   s ea r ch   alg o r ith m .   Fig u r e  1 3   s h o ws  a  p iec e   o f   co d e  th at  is   d ev elo p e d   o r ig in ally   in   th is   r esear ch   t o   cr ea te  an   Or ac le  f u n ctio n   in   th e  f o r m   o f   a    2 - d im en s io n al   ar r a y .   Dif f u s io n   m atr ix   is   p ar t   o f   Gr o v e r   i ter atio n   an d   is   im p lem e n ted   a f ter   Or ac le  f u n ctio n s .   Fig u r e  1 4   s h o ws  a   p iece   o f   co d e  to   m ak e   a  Dif f u s io n   m atr ix   in   th e   f o r m   o f   a  2 - d im e n s io n al  ar r ay .   Fig u r e   1 5   is   th e  im p lem en tatio n   o f   th e   ag o r ith m   t o   m ea s u r e  t h e  r esu lt  s tate.   T h is   m ea s u r em en t  d r iv es  th e  q u b its   to   co llap s e  to   o n e  o f   its   eig en s tates.  T h e  m ea s u r em en t  r esu lts   ar e  s to r ed   in   th e  m e m o r y   wit h   s ize  eq u al  to   th e   n u m b er   o f   th e  q u b its   u s ed .   Fig u r e  1 6   s h o ws th e  s im u latio n   r e s u lt f o r   f in d in g   5   f r o m   d ataset  co n tain in g   9 ,   5 ,   0 ,   1 1 ,   6   a n d   2 .   I t  also   d is p lay s   th e  n u m b er   o f   q u b it   u s ed   f o r   th e   s ea r ch   an d   th e   am p lit u d es  f o r   ea c h   o f   all   p o s s ib le  s tates.  An o th er   s im u latio n   p r esen ted   h er e  is   s h o wn   in   Fig u r e  1 7   wh er e   th e  d ataset   co n tain s   1 ,   6 ,   2 ,   4 ,   an d   3   a n d   th e   tar g et  v alu e   is   2 .         Evaluation Warning : The document was created with Spire.PDF for Python.
                      I SS N :   1 6 9 3 - 6 9 3 0   T E L KOM NI KA   T elec o m m u n   C o m p u t E l Co n tr o l ,  Vo l.  1 8 ,   No .   3 ,  J u n e   2 0 2 0 :    13 19   -   1 3 3 0   1328       Fig u r e  13 .  Or ac le  f u n ctio n   co d e             Fig u r e  14 .  Dif f u s io n   m at r ix   co d e       Fig u r e  15 .  Qu b its   m ea s u r em e n t           Fig u r e  16 .  Gr o v e r ’ s   alg o r ith m   s im u latio n   f o r   s ea r c h in g   5           Fig u r e  17 .  Gr o v e r ’ s   alg o r ith m   s im u latio n   f o r   s ea r c h in g   2   Evaluation Warning : The document was created with Spire.PDF for Python.