T E L K O M N I K 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 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 o 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 a re   we ll - k n o wn   f o th e ir  q u a d ra ti c   if  n o e x p o n e n t ial   sp e e d u p   o v e t h e ir  c las sic a 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 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’ 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 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 a re   in tro d u c e d   a s th e o re ti c a c o n c e p ts   in   th e   o ri g in a p a p e rs d u e   to   th e   l imitatio n s   o 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 a n   o p e n   a c c e ss   a rticle   u n d e 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 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 th 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   n u m b er   in to   its   p r im e s   o n   q u an tu m   c o m p u te r   in   p o ly n o m ial  tim [ 6 - 9 ] .   T h is   is   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 f o r   lar g 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   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 q u an tu m   s ea r ch   alg o r ith m   tak es  O( N)   f o r   th 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 b y   u s in g   am p lit u d am p lific atio n   in   q u an tu m   co m p u tin g .   T h 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 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 s o f twar p latf o r m s   r esp ec tiv ely   ar Fo r est,  Qis k it,  Pro jectQ,   an d   Qu an tu m   Dev el o p m en t   Kit.  T h B r is tleco n is   Go o g le’ s   lat est  q u an tu m   co m p u ter   with   t h m o s 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   q u an tu m   v ir tu al  m ac h in ( QVM )   th at  is   av ailab le  f o r   p u b lic  u s 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   class ical  co m p u ter   [ 16 ] .   E T Z u r ich s   Pro jectQ  is   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   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 s u it ab le  f o r   r ea lizin g   th 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   we b   ap p licatio n   d u 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   r elate d   s tu d y   o n   t h r ea liza tio n   o f   q u an tu m   alg o r ith m   i n to   web   ap p lica tio n   co u ld   b 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 QC d e m o n s tr ates  th 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 is   web - b ased   W eb GL   C h r o m e x p er im en 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 QC P’s  web - ap p   h as  lim itatio n   o f   u s in g   o n ly   o n 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 g ate  lev el  q u a n tu m   h a r d war e.   I also   d o es  n o s u p p o r co n n ec tiv ity   with   th 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 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   web   ap p licati o n .   I is   to   ad d r ess   th 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 o f   u s 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 u s ed   f o r   th e   web - a p p   r ea lizatio n   a r 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 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 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 u s ed   f o r   th e   web - a p p   d e v elo p m e n s in ce   it  is   also   wr itten   in   Py th o n .   T h 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 x ec u tio n   tim e   is   co m p a r ed   with   th QC P’s  r esu lt   u n d er   t h s am 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 r esear ch   m eth o d s   u s ed   ar liter atu r 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 liter atu r e   r ev iews  in clu d 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 Z u r ich   Pro jectQ  f r am ewo r k ,   an d   R ig etti  Fo r est  SDK.   T h d esig n   o f   th im p l em en tatio n   o f   t h q u a n tu m   alg o r ith m   is   d escr ib ed   u s in g   f lo wch a r t.  I n   t h is   r esear ch ,   th 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 n o t ta k en   in to   ac c o u n t.   T h web - ap p   r ea lizatio n   o f   th 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 u s in g   t h E T 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 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 h a r d war s p ec if icatio n s   ar u s ed   f o r   th im p lem e n tatio n   p ar t .   T h test in g   is   d o n u s in g   th 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 we b - ap p   i s   m ea s u r ed   b y   th e x ec u tio n   t im 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 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 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 a   p o s itiv in teg er   v alu i.e .   N.   T h in p u is   ev alu ated   an d   r e tu r n ed   with   tr u if   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 n ex p r o ce s s   is   th in s p ec tio n   p r o ce s s   if   is   p r im o r   n o t.   Sam as  th 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 o r   f alse  d ep e n d in g   o n   th v al u o f   e n ter ed .   I f   th e   v alu o f   ca n   b e   u s ed   u p   m o d u lated   b y   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   f alse  v alu e.   Fu r th er m o r e,     th 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   r a n k   o f   2   th at  is   g r ea ter   o r   eq u al   to   th v alu e   o f   N 2 .   T h is   p r o ce s s   will  ad d   o n t o   th p o wer   v ar iab le  u n til  d is p lace m en o f   two   is   g r ea te r   th an   t h t ar g et.   T h is   p r o ce s s   f lo wch ar ca n   b e   s ee n   in   Fig u r 2   n o tated   b y   o f f - p ag e   r ef er en ce   1 .   Af ter   th at,   th v alu 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 r u n   if   x   is   co p r im with   an d   is   n o t p r im n o r   ev en .   On - p ag r ef e r en ce   C   d escr ib e s   th in itializatio n   p r o ce s s   o f   v ar iab les  wh ich   will  later   b 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 r ef e r en ce   in   Fig u r e   2 .   T h 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 in te g er s   u p   to   t h v ar iab le  q   m in u s   o n e.   Nex t,  t h q u an tu m   r eg is ter   is   in itialized   to   s ize  n ,   th 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 p ass ed   th r o u g h   th Ha d am ar d   g ate  to   en ter   th 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.   q u b it  will  also   b in itialized   as   ct r l_ q u b it   v ar iab le.   T h e   m ea s u r em en v a r iab les  ar e   cr ea ted   a s   n - s ized   ar r ay s   to   s to r th v alu o f   m o d u lar   e x p o n en tiatio n   at  later   s tep .   T h n e x 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 cu r r e n t_ x   v alu is   f illed   with   th v alu f r o m   t h ca l cu latio n   o f   p o ( x ,   1   <<   ( n - 1 - k ,   N) )   wh er k   is     th 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 to   a   s u p er p o s itio n   s tate   b ef o r e   th c o n tr o s tatem en i s   ex ec u ted .   I f   th e   co n d itio n s   i n   th C o n tr o s tatem en ar e   s atis f ied ,   th m o d u lar   m u ltip licatio n   ca lcu latio n   is   co n tin u ed .   T h 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 q u an tu m   r eg is ter   as  th b ase,   cu r r en t _ x   as  th m u ltip lier ,   a n d   as   th v alu e   th at  will  p er f o r m   th m o d u lo   o p er atio n   o n   th p r ev io u s   m u ltip licatio n   r esu lt.  T h last   s tep   in   th q u a n tu m   co m p u tatio n   p r o ce s s   is   t h m ea s u r em en t o f   th v alu o f   ctr l_ q u b it.   T h m ea s u r ed   v alu e   is   p u in t o   th m ea s u r em en a r r ay   at   th k - in d ex ,   wh er 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 S h o r s   q u a n t u fa cto r in g   a lg o r ith 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 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   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 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 p er io d   o f   N,   r ep r ese n ted   b y   th v a r iab le  r   is   f o u n d ,   r s   v alu is   ch ec k ed   wh eth er   o r   n o it  is   o d d .   I f   it  is   o d d ,   t h v alu is   m u ltip lied   b y   2 .   T h two   f ac t o r s   o f   co u l d   b d ete r m in ed   b y   ca lcu latin g   t h v alu es  o f   GC ( ( x (r/2) +1 ) ,   N)   an d   GC ( ( x (r/2) - 1 ) ,   N) .   B o th   v alu es  ar s to r ed   in   v ar iab les  f 1   an d   f 2   r esp ec tiv ely .   I f   th p r o d u ct  o f   f 1   an d   f 2   m u ltip les  d o   n o p r o d u ce   an d   is   m o r th an   1 ,   th v alu 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 r esu lt   o f   th e   d iv is io n   o f   b y   f 1 .   I f   th f ac to r   o f   f o u n d ,   th p r o g r am   will  is s u 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 ca lcu latio n   is   f ailed .   T h is   f ailu r is   p ar o f   th e   p r o b ab ilis tic  n atu r o f   q u a n tu m   s u p er p o s itio n .   T h f lo wch a r d esig n   f o r   th is   la s s tep   is   s h o wn   i n   Fig u r 3 .           Fig u r 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 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 S h o r s   q u a n t u fa cto r in g   a lg o r ith 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 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 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 u s er   en ter s   in p u t d ataset  an d   tar g et  to   b s ea r ch e d .   T h p r o g r a m   will  co n v e r 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 p r o g r a m   will  s ea r ch   f o r   m ax   v alu in   th d ataset.   T h m ax   v alu b in ar y   r ep r esen tatio n   will  b 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 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 Or ac le  f u n ctio n   an d   Dif f u s io n   m atr ix   ar cr ea ted   an d   ad d ed   to   t h e   q u an tu m   p r o g r am   as  n ew  g ate.   T h f ir s 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 ev er y   s tate  h av th s am am p litu d e.   T h e   n ex s tep   is   th am p litu d 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 s tate  a n d   r etu r n   0   f o r   t h wr o n g   s tate.   Di f f u s io n   m atr ix   will in v e r s th am p litu d a r o u n d   th a m p li tu d es m ea n .   Fig u r 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 with   th s ize  o f   th n u m b er   o f   q u b it.  T h en ,   ev er y   q u b its   will   b m e asu r ed   wit h   m ea s u r f u n ctio n   f r o m   p y Q u il  lib r ar y .   Af ter   th at,   th p r o g r a m   will  o p en   co n n ec tio n   to   t h q u a n tu m   v ir tu al   m ac h in an d   r u n   t h q u an tu m   p r o g r a m .   T h r esu lt  will  b e   co m p ar ed   with   th v alu in s id 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 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 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 S h o r s   q u a n t u fa cto r in g   a lg o r ith 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 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 A ND  AN AL Y SI S     I n   th is   s ec tio n ,   f iv test   s ce n ar io s   ar u s ed   f o r   test in g   t h 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 th e   im p lem en tatio n   co d in   Py th o n   u s in g   E T Z u r i ch s   Pro jectQ  f r am ewo r k   is   d escr ib ed .   Fig u r 6   ( a )   s h o ws  th 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 n g in a n d   p u in to   s u p er p o s itio n   b y   u s in g   th Had am ar d   g ate.   T h 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 as d is p lay ed   in   Fig u r 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 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 p e r io d   f in d in g   is   th e   im p o r tan 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 o n ly   p ar o f   th alg o r ith m   th at  r eq u ir es  q u an tu m   co m p u ter .   T h e   im p lem en tati o n   o f   th p er io d   f in d in g   is   g iv en   in   Fig u r 7 .   Fig u r 8   s h o ws th f in al  p ar t o f   th alg o r ith m   wh ic h   is   f in d in g   th f ac to r s   o f   th in p u t.   T h web - a p p   r ea lizatio n   in   Fig u r 9   s h o ws  s u cc ess f u d esig n   an d   i m p lem en tatio n   o f   t h Sh o r s   q u an tu m   f ac to r i n g   alg o r ith m .   T h g iv e n   in p u is   3 3   wh ich   is   n o e v en   n o r   p r i m e.   T h f ac to r s   ar 3   a n d   1 1   wh ich   ar co r r ec tly   o b tain ed   b y   th s im u latio n   g iv en   in   Fig u r 9 .           Fig u r 7 Per io d   f in d in g   c o d e           Fig u r 8 Facto r s   f in d in g   c o d e           Fig u r 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 S h o r s   q u a n t u fa cto r in g   a lg o r ith 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 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 f ac to r s   o f   9 1 ,   wh ich   ar 7   an d   1 3 .   T h is   ex h i b its   th s u cc ess   o f   th im p lem en tatio n   o f   th alg o r ith m   in   Pro jectQ  f r am ew o r k   a n d   also   th d ev elo p m en o f   th web - ap p   f o r   th im p lem en tatio n   t o   b 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 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 ar 3   s tep s   in   im p le m en tin g   th 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 am p lific atio n ,   an d   m ea s u r e.   Fi g u r 1 1   s h o ws  th im p le m en tatio n   co d e   f o r   in itializatio n   in   R ig ett Fo r est.   T h is   in itializa tio n   aim s   to   m a k q u b its   h av th s am am p litu d 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 Had am a r d   g ate  to   ea ch   q u b it.   Fig u r 1 2   s h o ws  th am p litu d 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 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 O r ac le  f u n ctio n   an d   Dif f u s io n   m atr ix   ar ap p lied .           Fig u r 11 Su p er p o s itio n   in itializatio n   f o r   all  q u b its             Fig u r 12 Am p litu d am p lific atio n   co d e       T h Or ac le  f u n ctio n   is   n o p a r o f   th Gr o v er s   q u an tu m   s ea r ch   alg o r ith m .   Fig u r 1 3   s h o ws  p iec e   o f   co d 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 f o r m   o f     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 1 4   s h o ws  a   p iece   o f   co d to   m ak e   Dif f u s io n   m atr ix   in   th e   f o r m   o f   2 - d im e n s io n al  ar r ay .   Fig u r e   1 5   is   th im p lem en tatio n   o f   th e   ag o r ith m   t o   m ea s u r t h r esu lt  s tate.   T h is   m ea s u r em en d r iv es  th q u b its   to   co llap s to   o n o f   its   eig en s tates.  T h m ea s u r em en r esu lts   ar s to r ed   in   th m e m o r y   wit h   s ize  eq u al  to   th e   n u m b er   o f   th q u b its   u s ed .   Fig u r 1 6   s h o ws th 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 also   d is p lay s   th 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 is   s h o wn   in   Fig u r 1 7   wh er e   th 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 13 Or ac le  f u n ctio n   co d e             Fig u r 14 Dif f u s io n   m at r ix   co d e       Fig u r 15 Qu b its   m ea s u r em e n t           Fig u r 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 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.