TELK
OMNIKA
T
elecommunication,
Computing,
Electr
onics
and
Contr
ol
V
ol.
23,
No.
5,
October
2025,
pp.
1247
∼
1257
ISSN:
1693-6930,
DOI:
10.12928/TELK
OMNIKA.v23i5.26929
❒
1247
Realization
of
Ber
nstein-V
azirani
quantum
algorithm
in
an
interacti
v
e
educational
game
Da
vid
Gosal,
T
imoth
y
Rudolf
T
an,
Y
ozef
Tjandra,
Hendrik
Santoso
Sugiarto
Department
of
IT
and
Big
Data
Analytics,
F
aculty
of
Science
and
Engineering,
Calvin
Institute
of
T
echnology
,
Jakarta,
Indonesia
Article
Inf
o
Article
history:
Recei
v
ed
Feb
21,
2025
Re
vised
Jun
3,
2025
Accepted
Aug
1,
2025
K
eyw
ords:
Bernstein-V
azirani
algorithms
Gamication
Interacti
v
e
educational
g
ame
Quantum
algorithms
Quantum
conte
xtualization
ABSTRA
CT
Quantum
algor
ithms
are
celebrated
for
their
computational
superiority
o
v
er
clas-
sical
counterparts,
yet
the
y
pose
signicant
learning
challenges
for
non-ph
ysics
audiences.
Among
these,
the
Bernstein-V
azirani
(BV)
algorithm
stands
out
for
its
quantum
speedup
by
ef
ciently
identifying
a
secret
binary
string.
Ho
we
v
er
,
the
accessibility
of
such
algorithms
remains
constrained
by
their
inherent
techni-
cal
comple
xity
.
T
o
address
this
educational
g
ap,
this
paper
introduces
a
g
amied,
web-based
tool
that
inno
v
ati
v
ely
reinterprets
the
BV
algorithm’
s
comple
x
math-
ematical
settings
through
an
into
eng
aging
scenario
of
identifying
brok
en
lamps.
Players
assume
the
role
of
an
in
v
estig
ator
,
utilizing
bot
h
classical
and
quantum
solv
ers
to
identify
f
aulty
lamps
with
minimal
queries.
By
transforming
the
BV
algorithm
into
an
intuiti
v
e
g
ameplay
e
xperience,
the
tool
helps
reducing
techni-
cal
barriers,
making
quantum
concepts
much
more
comprehensible
for
educators
and
students
than
traditional
methods
that
demand
rigorous
mathemat
ical
under
-
standing.
De
v
eloped
using
Qiskit,
IB
M’
s
Python
package
for
quantum
compu-
tation,
and
deplo
yed
via
Flask,
a
popular
Python
microframe
w
ork
for
b
uilding
web
applications,
the
g
ame
ef
fecti
v
ely
simpli
es
comple
x
quantum
algorithms
while
demonstrating
the
practical
applicat
ions
of
quantum
speedup.
This
contri-
b
ution
adv
ances
quantum
education
by
mer
ging
technical
depth
with
interacti
v
e
design,
fos
tering
a
broader
understanding
of
quantum
principles
and
inspiring
ne
w
inno
v
ations
in
g
amied
learning.
This
is
an
open
access
article
under
the
CC
BY
-SA
license
.
Corresponding
A
uthor:
Hendrik
Santoso
Sugiarto
Department
of
IT
and
Big
Data
Analytics,
F
aculty
of
Science
and
Engineering,
Calvin
Institute
of
T
echnology
Calvin
T
o
wer
RMCI,
St.
Industri
Raya
Ka
v
1
Blok
B14,
K
emayoran,
Jakarta
10610,
Indonesia
Email:
hendrik.sugiarto@calvin.ac.id
1.
INTR
ODUCTION
Quantum
computing
le
v
erages
principles
from
quantum
ph
ysics
such
as
superposition
and
ent
angle-
ment
to
address
comple
x
problems
with
pot
ential
capabilities
be
yond
classical
computing.
Groundbreaking
algorithms
lik
e
Shor’
s
algorithm
for
period
nding
of
prime
inte
ger
f
actorization
[1]
and
Gro
v
er’
s
algorithm,
which
has
been
applied
to
quantum
k
e
y
search
in
cryptographic
systems
lik
e
adv
anced
encryption
standard
(AES)
and
lo
w
multiplicati
v
e
comple
xity
(Lo
wMC)
[2]
ha
v
e
historically
sho
wcased
the
potential
computa-
tional
po
wer
of
quantum
algorithms.
These
breakthroughs
ha
v
e
ignited
the
de
v
elopment
of
quantum
algorithms
in
v
arious
domains,
including
optimization
[3],
[4],
machine
learning
[5]-[7]
scientic
simulation
[8],
and
cryp-
tograph
y
[9].
The
realiz
ation
of
quantum
supremac
y
,
notably
demonstrated
by
Google
in
2019
[10]
and
2024
[11],
undersc
ored
this
potential
by
solving
a
problem
in
a
practical
running
time
that
w
ould
tak
e
septillion
years
of
computation
for
classical
computers.
Moreo
v
er
,
the
recent
breakthrough
in
Majorana
quantum
chips
J
ournal
homepage:
http://journal.uad.ac.id/inde
x.php/TELK
OMNIKA
Evaluation Warning : The document was created with Spire.PDF for Python.
1248
❒
ISSN:
1693-6930
by
Microsoft
Azure
Quantum
[12]
signicantly
enhances
the
prospects
of
quantum
technology
,
enabling
more
stable
and
scalable
quantum
computing.
Among
the
man
y
quantum
algorithms,
the
Bernstein-V
azirani
(BV)
algorithm
[13]
stands
out
as
a
f
a-
mous
foundational
e
xample
sho
wcasing
quantum
speedup
through
its
ele
g
ant
problem-solving
approach.
F
or
a
detailed
e
xplanation
on
the
algorithm,
one
could
consult
man
y
well-kno
wn
references
[14].
It
addresses
the
problem
of
identifying
a
secret
binary
string
using
polynomially
fe
wer
queries
compared
to
classical
methods,
making
it
a
compelling
illustration
of
quantum
superiority
.
Furthermore,
v
arious
literature
had
sho
wn
the
algo-
rithm’
s
application
in
terms
of
information
security
[15],
[16].
V
arious
implementations
of
the
BV
algorithm
on
quant
um
hardw
are
ha
v
e
been
e
xplored,
for
e
xample
in
trapped
ions
[17],
[18]
and
superconductor
de
vices
[19].
Classical
simulations
of
the
BV
algorithm
are
also
a
v
ailable
across
platforms,
such
as
web-based
tools
[20]
and
mobile
applications
[21],
designed
to
demonstrate
its
quantum
principles.
Ho
we
v
er
,
these
resources
are
often
tar
geted
at
researchers
and
e
xperts,
requiring
prior
technical
kno
wledge,
making
them
insuf
cient
to
eng
age
the
general
public.
Despite
the
increasing
a
v
ailability
of
quantum
algorithm
demonstrations
on
classical
de
vices
[22]-
[24],
man
y
e
xisting
tools
rem
ain
hea
vily
focused
on
circuit
visualization
and
i
ntricate
mathematical
formula-
tions,
making
them
less
eng
aging
to
broader
audiences
.
This
g
ap
in
user
-friendly
educational
tools
limits
the
potential
to
inspire
and
train
the
ne
xt
generation
of
scientists
who
can
inte
grate
quantum
technologies,
as
high-
lighted
in
ef
forts
such
as
[25].
Gamied
applications
ha
v
e
sho
wn
promise
in
breaking
do
wn
technical
barriers
in
science,
technology
,
engineering,
and
mathematics
(STEM)
education
[26],
especially
in
making
quantum
concepts
intuiti
v
e
and
interacti
v
e,
and
equipping
educators
with
tools
to
introduce
quantum
technologies
e
v
en
at
primary
and
secondary
school
le
v
els
[27].
Notable
conceptualizations
of
quantum
g
ames
include
quantum
chess
[28]
and
simulations
of
quantum
error
correction
[29].
Furthermore,
hackathons,
g
ame
j
ams,
and
student
projects
from
v
arious
countries
ha
v
e
produced
di
v
erse
qu
a
ntum
g
ames
aimed
at
educating
the
public
about
the
fundamentals
of
quantum
mechanics
and
it
s
applications
[30].
Ho
we
v
er
,
while
these
ef
forts
contrib
ute
meaningfully
to
quantum
outreach,
none
e
xplicitly
focus
on
the
conte
xtualization
and
pedagogical
unpacking
of
the
BV
algorithm.
T
o
address
this
problem,
our
w
ork
introduces
a
g
amied
realization
of
the
BV
algorithm,
designed
to
con
v
e
y
its
core
principles
and
illustrate
quantum
speedup
in
an
eng
aging
and
accessible
format,
bridging
the
g
ap
between
technical
sophistication
and
public
understanding.
This
w
ork
introduces
an
inno
v
ati
v
e
web-based
interacti
v
e
educational
g
ame
that
conte
xtualizes
the
BV
algorithm
through
a
relatable
scenario
in
v
olving
n
brok
en
lamps
(corresponding
to
the
n
-digit
secret
bi-
nary
string).
In
this
g
ame,
players
act
as
in
v
estig
ators,
querying
an
oracle
(corresponding
to
the
special
binary
function
in
the
BV
algorithm’
s
oracle
setting)
to
determine
which
lamp
is
f
aulty
.
While
performing
the
classical
logical
deduction
requires
se
v
eral
queries,
the
g
ame
w
ould
demonstrate
the
e
xcellence
of
the
BV
quantum
al-
gorithm
to
obtain
the
correct
answer
with
only
a
single
query
from
the
or
acle
based
on
quantum
principles.
By
embedding
this
concept
within
a
f
amiliar
narrati
v
e
and
intuiti
v
e
g
ameplay
,
the
intricate
mathematical
formal-
ism
can
be
a
v
oided
and
thus
the
g
ame
simplies
the
BV
algorithm’
s
technical
concepts
into
an
eng
aging
and
intuiti
v
e
format,
making
quantum
computing
accessible
to
a
broader
audience.
By
focusing
on
user
-friendly
design
and
conte
xtual
g
ameplay
,
the
g
ame
bridges
the
g
ap
between
technical
demonstrations
and
public
edu-
cation,
contrib
uting
to
both
the
gro
wing
body
of
quantum
educational
resources
as
well
as
the
de
v
elopment
of
accessible
quantum
computing
demonstrations.
The
remainder
of
this
paper
discusses
the
desi
gn
and
imple-
mentation
of
the
g
ame,
its
educational
objecti
v
es,
and
its
potential
impact
in
making
quantum
computing
more
comprehensible
and
eng
aging.
2.
RESEARCH
METHOD
The
research
approaches
include
re
vie
ws
of
the
literature,
design,
and
de
v
elopment
of
the
web-based
g
ame
application.
The
design
of
the
quantum
algorithm
implementation
is
described
using
o
wcharts.
In
this
research,
the
quantum
error
correction
and
ancilla
qubits
are
not
tak
en
into
account.
The
web-a
pp
realization
of
BV’
s
algorithm
is
done
using
Qiskit
library
and
Flask.
The
web-app
is
deplo
yed
through
DOM
Cloud
where
the
web
can
be
accessed
from
an
y
computer
.
This
web-app
compares
ho
w
human,
classical
computer
and
quantum
computer
solv
es
the
problem.
In
this
section,
we
rst
describe
the
BV
problem,
and
then
e
xplain
ho
w
to
solv
e
it
utilizing
the
classical
and
quantum
algorithm.
TELK
OMNIKA
T
elecommun
Comput
El
Control,
V
ol.
23,
No.
5,
October
2025:
1247–1257
Evaluation Warning : The document was created with Spire.PDF for Python.
TELK
OMNIKA
T
elecommun
Comput
El
Control
❒
1249
2.1.
Ber
nstein-V
azirani
pr
oblem
Let
s
=
s
0
s
1
.
.
.
s
n
−
1
be
an
n
-bit
binary
string
and
f
be
a
Boolean
function
f
:
{
0
,
1
}
n
→
{
0
,
1
}
which
depends
on
s
,
dened
as:
f
(
x
)
=
s
·
x
=
s
0
x
0
+
s
1
x
1
+
.
.
.
+
s
n
−
1
x
n
−
1
mo
d
2
,
where
x
0
,
.
.
.
,
x
n
−
1
are
the
bits
of
x
.
In
the
BV
problem,
f
is
called
the
oracle
and
the
problem
objecti
v
e
is
to
nd
s
by
le
v
eraging
t
he
oracle’
s
outputs
without
kno
wing
its
implementation
details.
In
this
setting,
one
must
astutely
determine
the
binary
string
x
to
be
ask
ed
to
the
oracle
so
that
the
query
res
u
l
t
f
(
x
)
may
besto
w
useful
information
re
g
arding
the
secret
number
s
.
In
the
best
classical
solution
of
this
problem,
one
needs
to
consult
the
oracle
at
least
n
times.
F
or
instance,
we
rst
query
f
(100
.
.
.
0)
,
which
re
v
eals
s
0
.
Ne
xt,
we
query
f
(010
.
.
.
0)
to
nd
s
1
,
and
so
on,
until
f
(000
.
.
.
1)
re
v
eals
s
n
−
1
.
Thus,
n
oracle
queries
are
necessary
to
nd
all
bits
of
s
.
There
is
no
w
ay
to
reduce
this
number
without
introducing
errors
in
the
algorithm.
In
the
quantum
case,
the
function
f
(
x
)
=
s
·
x
is
implemented
using
the
unitary
operator
U
f
,
which
acts
on
a
system
of
n
+
1
qubits,
dened
as:
U
f
|
x
⟩|
j
⟩
=
|
x
⟩|
j
⊕
f
(
x
)
⟩
,
where
x
∈
{
0
,
1
}
n
,
j
is
a
bit,
and
⊕
is
the
e
xclusi
v
e
OR
(XOR)
operation
(sum
modulo
2).
This
operator
uses
tw
o
re
gisters:
the
rst
of
size
n
qubits
and
the
second
of
size
1
qubit.
Although
U
f
can
be
used
as
man
y
times
as
needed,
it
is
only
used
once
in
the
BV
algorithm.
In
the
original
problem
setting,
the
binary
operations
within
the
oracle
function
are
abstract
and
lack
a
tangible
interpretation
be
yond
their
use
as
a
quantum
demonstration
tool.
In
this
w
ork,
we
propose
a
g
amied
conte
xtualization
that
brings
the
technical
implementation
to
life,
making
it
more
eng
aging
and
r
elatable.
In
our
g
ame,
users
are
placed
in
a
scenario
in
v
olving
multiple
lamps,
some
of
which
are
brok
en
yet
visually
identical
to
the
functional
ones.
The
task
is
to
identi
fy
the
defecti
v
e
lamps
by
interacting
with
an
oracle.
The
oracle
can
toggle
the
lamps’
connection
to
an
electrical
source
based
on
the
user’
s
query
and
e
v
aluate
whether
each
lamp
is
capable
of
lighting
up.
While
the
user
cannot
directly
observ
e
which
lamps
light
up,
the
oracle
pro
vides
feedback
by
re
v
ealing
only
the
parity
of
the
number
of
operational
lamps.
The
specic
details
of
ho
w
the
oracle
operates
in
this
conte
xtualized
scenario
are
pro
vided
in
T
able
1.
A
more
detailed
e
xplanation
of
the
AND
bitwise
operator
within
the
oracle
conte
xtualization
is
pro
vided
in
T
able
2.
T
able
1.
BV
g
amied
conte
xtualization
BV
concept
Conte
xtualization
Illustrati
v
e
instance
Secret
binary
string
s
,
each
bit
is
unkno
wn
to
the
user
.
n
untoggled
lamps:
0
corresponds
to
brok
en
lamp
and
1
to
functional
lamp
(both
appear
to
be
of
f
since
the
y
are
untoggled).
Secret
w
ord
s
=
1001
;
appears
as
4
untog-
gled
lamps
that
look
alik
e.
Binary
string
x
,
queried
to
the
oracle.
Electricity
setup
of
the
n
lamps
queried
to
the
oracle:
0
means
the
lamp
is
untoggled
and
1
toggled.
Queried
w
ord
x
=
1010
;
appears
as
a
conguration
of
toggling
the
lamps
to
electricity
.
AND-bitwise-
operator
in
the
oracle
applied
to
s
and
x
.
The
actual
lights
of
each
lamp’
s
internal
condition
(ei-
ther
brok
en
or
functional)
and
its
electricity
a
v
ailabil-
ity
(either
toggled
or
not).
See
T
able
2
for
more
e
x-
planations.
Bitwise
AND
operat
ion
of
s
and
x
.
Only
functional
and
toggled
lamps
w
ould
realize
f
actual
light.
XOR
operation.
The
parity
of
the
actual
number
of
lamps
with
lights
on:
0
means
e
v
en
and
1
odd.
Return
1
since
there
is
1
(odd)
f
actual
lamp
with
on
condition.
Realization
of
Bernstein-V
azir
ani
quantum
algorithm
in
an
inter
active
educational
game
(David
Gosal)
Evaluation Warning : The document was created with Spire.PDF for Python.
1250
❒
ISSN:
1693-6930
T
able
2.
Conte
xtualization
of
the
AND
bitwise
operator
between
s
and
x
inside
the
oracle
function
AND
Untoggled
(
x
i
=
0
)
T
oggled
(
x
i
=
1
)
Brok
en
(
s
i
=
0
)
Lamp
is
of
f
(
s
i
x
i
=
0
)
Lamp
is
of
f
(
s
i
x
i
=
0
)
Functional
(
s
i
=
1
)
Lamp
is
of
f
(
s
i
x
i
=
0
)
Lamp
is
on
(
s
i
x
i
=
1
)
2.2.
Classical
solv
er
Figure
1
outlines
the
o
w
diagram
of
a
classical
computer
which
deterministically
infers
the
secret
number
based
on
interactions
with
the
oracle.
In
this
section,
we
only
describe
the
best
classical
algorithm
to
solv
e
BV
problem.
The
process
be
gins
with
the
user
inputting
the
length
of
the
secret
number
(
n
)
and
initializing
a
counter
v
ariable
(
i
)
to
be
zero.
F
or
each
bit
position
i
(with
1
≤
i
≤
n
),
a
specic
pattern,
asked
bit
,
is
dened
to
be
a
binary
string
of
n
length
where
the
i
-th
bit
is
1
while
all
the
others
are
0.
This
pattern
is
sent
to
t
he
oracle,
and
the
oracle
w
ould
return
a
response
indicating
whether
the
result
is
e
v
en
or
odd.
Based
on
the
oracle’
s
response,
the
solv
er
w
ould
guess
the
i
-th
bit
iterati
v
ely
.
Specically
,
the
i
-th
bit
of
the
guessed
sequence
(
guessed
bit
)
is
equal
to
0
if
the
response
is
e
v
en,
and
1
if
it
is
odd.
The
counter
i
is
then
incremented,
and
the
process
is
repeated
for
all
bit
positions
until
the
guessed
sequence
reaches
the
specied
length
n
.
Finally
,
the
complete
guessed
bit
sequence
is
returned
as
the
output.
This
algorithm
ef
ciently
determines
the
secret
number
one
bit
at
a
time
by
le
v
eraging
the
oracle’
s
feedback.
Figure
1.
Classical
solv
er
o
wchart
2.3.
Quantum
solv
er
In
this
section,
we
apply
the
original
BV
algorithm
[13]
inside
our
quantum
solv
er
.
Figure
2
describes
the
process
of
a
quantum
solv
er
to
determine
the
guessed
bit
sequence.
The
algorithm
be
gins
with
the
user
pro
viding
the
length
of
the
secret
number
(
n
).
An
initial
quantum
state
is
prepared
as
the
input
(
asked
bit
),
using
n
qubits
all
initialized
to
zero.
The
quantum
oracle
is
queried
using
this
state,
producing
a
measurement
that
reects
the
probability
dis
trib
ution
of
potential
solutions.
From
the
measurement
result
s,
the
guessed
bit
sequence
is
determined
by
selecting
the
outcome
with
the
highest
probabil
ity
(using
ar
gmax).
Finally
,
the
guessed
bit
sequence
is
returned
as
the
solution.
This
process
le
v
erages
quantum
computation
to
ef
ciently
e
xplore
and
identify
the
correct
sequence.
On
the
other
hand,
the
quantum
oracle
is
implemented
separately
,
as
described
in
Figure
2.
The
process
be
gins
by
preparing
the
initial
quantum
state
|
0
⟩
⊗
n
|
1
⟩
.
In
this
state,
the
rst
n
qubits
are
initialized
to
|
0
⟩
,
and
the
(
n
+
1)
-th
qubit,
which
serv
es
as
an
auxiliary
qubit,
is
initialized
to
|
1
⟩
.
Ne
xt,
the
Hadamard
g
ates
H
are
applied
to
all
n
+
1
qubits,
denoted
by
H
⊗
(
n
+1)
,
transforming
the
system
into
an
equal
superposition
of
all
possible
states.
The
oracle
is
then
applied
as
a
unitary
operat
or
U
f
,
which
incorporates
the
information
re
g
arding
the
secret
number
into
the
quantum
system.
The
unitary
operator
U
f
is
implemented
using
controlled-
NO
T
(CNO
T)
g
ates,
that
entangle
the
qubits
and
encode
the
oracle’
s
logic.
F
ollo
wing
this,
Hadamard
g
ates
are
applied
ag
ain
to
all
qubits,
represented
as
H
⊗
(
n
+1)
,
creating
quantum
interference
patterns
that
re
v
eal
the
TELK
OMNIKA
T
elecommun
Comput
El
Control,
V
ol.
23,
No.
5,
October
2025:
1247–1257
Evaluation Warning : The document was created with Spire.PDF for Python.
TELK
OMNIKA
T
elecommun
Comput
El
Control
❒
1251
solution
to
the
encoded
problem.
Finally
,
the
rst
n
qubits
are
measured
in
the
computational
basis,
yielding
the
secret
number
s
0
s
1
.
.
.
s
n
−
1
.
Figure
2.
Quantum
solv
er
o
wchart
2.4.
W
eb-app
design
Figure
3
illustrates
the
o
wchart
of
the
web
application.
The
user
be
gins
at
the
inde
x
page,
which
serv
es
as
the
starting
point.
From
there,
the
y
na
vig
ate
to
the
homepage
where
the
user
is
required
to
input
se
v
eral
parameters,
such
as
the
length
of
the
secret
number
,
the
w
ay
the
secret
number
is
determined,
and
the
type
of
solv
er
to
be
used.
The
application
pro
vides
tw
o
w
ays
of
determining
the
secret
number:
1)
the
secret
number
can
be
manually
predetermined
by
the
user
,
or
2)
it
can
also
be
randomly
generated.
Once
all
the
necessary
inputs
had
been
entered,
the
user
is
directed
to
the
appropriate
g
ame
page.
Upon
completing
the
g
ame,
the
user
is
presented
with
tw
o
options:
the
y
can
either
choose
to
play
ag
ain,
which
redirects
them
back
to
the
homepage,
or
e
xit,
which
returns
them
to
the
inde
x
page.
Figure
3.
W
eb-App
design
o
wchart
3.
RESUL
T
AND
DISCUSSION
3.1.
Classical
solv
er
web-app
r
ealization
The
implementation
of
the
classical
solv
er
using
Python
code
is
pro
vided
in
Figure
4.
Speci
cally
,
the
solv
er
mak
es
n
queries
to
the
oracle,
where
n
denotes
the
length
of
the
secr
et
number
.
F
or
each
query
,
the
oracle
e
v
aluates
the
current
guess
by
returning
whether
the
res
ult
is
”e
v
en”
or
”odd.
”
If
the
oracle
returns
an
”e
v
en”
response,
the
solv
er
appends
a
0
to
the
guessed
number
.
Con
v
ersely
,
if
the
oracle
responds
with
”odd,
”
the
solv
er
appends
a
1.
This
method
is
computationally
ef
cient,
wit
h
a
time
comple
xity
of
O
(
n
)
,
as
it
requires
only
n
queries
to
the
oracle
to
determine
the
secret
number
.
In
contrast,
a
nai
v
e
brute-force
approac
h
w
ould
in
v
olv
e
generating
and
checking
all
O
(2
n
)
possible
binary
strings
of
length
n
,
making
it
e
xponentially
slo
wer
as
n
increases.
The
O
(
n
)
comple
xity
of
the
classical
solv
er
highlights
its
adv
antage
in
ef
cienc
y
,
particularly
for
lar
ge
v
alues
of
n
,
where
the
brute-force
method
becomes
impractical.
Figure
5
illustrates
the
solution
display
of
the
classical
solv
er
.
Figure
5(a)
presents
the
r
esult
for
the
secret
number
s
=
0001
,
whil
e
Figure
5(b)
demonstrates
the
outcome
for
the
secret
number
s
=
111100
.
From
the
screenshots,
it
is
e
vident
that
the
solv
er
is
able
to
iterati
v
ely
guess
each
correct
bit
by
asking
the
oracles
n
times.
Realization
of
Bernstein-V
azir
ani
quantum
algorithm
in
an
inter
active
educational
game
(David
Gosal)
Evaluation Warning : The document was created with Spire.PDF for Python.
1252
❒
ISSN:
1693-6930
Figure
4.
Classical
code
(a)
(b)
Figure
5.
Realization
of
the
classical
solv
er
for
(a)
s
=
0001
and
(b)
s
=
111100
3.2.
Quantum
solv
er
web-app
r
ealization
In
this
section,
we
e
xpose
ho
w
the
quantum
algorithm
is
simulated
using
classical
de
vices.
In
our
w
orks,
all
quantum
simulation
computations
are
performed
using
IBM’
s
Qiskit
p
ython
package.
The
imple-
mentation
of
the
BV
algorithm
using
the
Qiskit
library
simulation
is
described
in
Figure
6.
Specically
,
in
Figure
6(a),
the
function
be
gins
by
determining
the
length
of
the
secret
binary
number
using
len(secret)
.
A
QuantumCircuit
is
then
initialized
with
length
+
1
qubits.
Ne
xt,
the
apply
oracle
function
is
called
to
construct
a
subcircuit
(the
oracle)
that
encodes
the
secret
into
the
quantum
system.
Afterw
ard,
a
mea-
surement
operation
is
applied
to
the
rst
length
qubits.
Finally
,
the
function
returns
the
QuantumCircuit
TELK
OMNIKA
T
elecommun
Comput
El
Control,
V
ol.
23,
No.
5,
October
2025:
1247–1257
Evaluation Warning : The document was created with Spire.PDF for Python.
TELK
OMNIKA
T
elecommun
Comput
El
Control
❒
1253
object
that
has
been
measured.
Meanwhile,
in
Figure
6(b),
the
quantum
circuit
is
ag
ain
initialized
with
length
+
1
qubits.
The
Hadamard
g
ate
(
.h
)
is
applied
to
all
qubits
to
create
a
superposition
of
all
possible
states.
The
oracle
is
implemented
using
a
series
of
CNO
T
g
ates
(
.cx
)
applied
among
bits
according
to
the
secret
number
information.
Consequently
,
another
Hadamard
g
ate
(
.h
)
is
applied
to
the
length
qubits,
completing
the
quantum
operation.
The
function
returns
the
quantum
circuit
with
all
applied
operations
ready
for
mea-
surement.
Once
the
ci
rcuit
has
been
fully
constructed
and
prepared
to
encode
the
secret
number
,
the
function
quantum()
(as
seen
in
Figure
6(c))
tak
es
it
and
uses
a
quantum
simulator
to
e
x
ecute
the
circuit
and
retrie
v
e
the
results.
First,
the
function
initializes
an
instance
of
AerSimulator
,
which
i
s
a
classical
simulation
tool
pro-
vided
by
Qiski
t
for
running
quantum
circuits
without
needing
access
to
a
ph
ysical
quantum
computer
.
The
circuit
is
then
transpiled
for
the
simulator
using
transpile(circuit,
simulator)
,
optimizing
the
circuit’
s
instructions
to
match
the
simulator’
s
requirements.
(a)
(b)
(c)
Figure
6.
Quantum
code
of
(a)
quantum
circuit
initialization
code,
(b)
quantum
oracle
code,
and
(c)
quantum
simulation
code
The
function
then
retrie
v
es
the
secret
number
by
acquiring
the
count
v
alues
of
each
measure
ment
simulation
shot.
It
also
retrie
v
es
the
frequenc
y
of
this
result,
stored
in
count.
Finally
,
the
function
returns
the
secret
number
,
count,
and
the
full
counts
dictionary
,
ef
fecti
v
ely
decoding
the
secret
number
from
the
quantum
simulation
and
pro
viding
a
record
of
the
simulation’
s
outcome.
This
completes
the
process
of
encoding
the
secret,
running
the
circuit,
and
e
xtracting
the
result.
In
Figure
7,
the
quantum
solv
er
could
nd
the
correct
answer
in
one
shot
of
the
simula
tion.
Figure
7(a)
displays
the
plot
for
the
secret
number
s
=
1101
,
while
Figure
7(b)
presents
the
plot
for
the
secret
number
s
=
011001
.
The
plot
sho
ws
that
no
matter
the
length
of
the
secret
number
,
the
result
will
al
w
ays
be
the
same,
pointing
to
the
correct
answer
.
Realization
of
Bernstein-V
azir
ani
quantum
algorithm
in
an
inter
active
educational
game
(David
Gosal)
Evaluation Warning : The document was created with Spire.PDF for Python.
1254
❒
ISSN:
1693-6930
(a)
(b)
Figure
7.
Measurement
histograms;
(a)
plot
secret
number
1101
and
(b)
plot
secret
number
011001
This
sho
ws
that
the
adv
antage
of
quantum
algorithms,
such
as
the
BV
algorithm,
is
their
O
(1)
com-
ple
xity
.
This
means
that
the
algorithm
requires
only
a
single
e
x
ecution
to
determine
the
secret
binary
number
,
re
g
ardless
of
its
length.
In
comparison,
classical
algorithms
for
solving
the
same
problem
ha
v
e
a
comple
xity
of
O
(
n
)
,
where
n
is
the
length
of
the
secret
binary
number
.
In
other
w
ords,
the
best
clas
sical
algorithm
requires
a
linear
iteration
o
v
er
each
bit
to
nd
the
result.
Therefore
,
quantum
algorithms
pro
vide
a
signicant
ef
-
cienc
y
impro
v
ement,
particularly
for
problems
with
lar
ge-scale
inputs,
making
them
a
highly
superior
solution
in
certain
scenarios.
3.3.
Ov
erall
web-app
r
ealization
The
web
application
brings
the
BV
algorithm
to
life
through
an
interacti
v
e
g
ame
where
players
de-
code
a
binary
”secret
number
,
”
creati
v
ely
represented
as
a
series
of
lamps.
Built
using
Flask
and
hosted
on
DOM
Cloud
at
citb
vg
ame.domcloud.de
v,
the
app
allo
ws
players
to
customize
their
e
xperiences
by
selecting
the
secret
number’
s
length,
whether
it
is
randomly
generated
or
predened,
and
the
solv
er
type:
human,
clas-
sical
computer
,
or
quantum
computer
.
Figure
8
pro
vides
snippets
of
the
web
application
interf
ace.
Figure
8(a)
displays
the
”about”
section,
pro
viding
an
o
v
ervie
w
of
the
web
app,
while
Figure
8(b)
illustrates
the
”rules
and
input”
interf
ace,
detailing
user
instructions
and
input
options.
This
interacti
v
e
setup
highlights
the
distinct
approaches
tak
en
by
humans,
c
lassical
computers,
and
quantum
computers
t
o
solv
e
the
problem,
sho
wcas-
ing
the
ef
cienc
y
and
ele
g
ance
of
quantum
computing.
By
combining
theoretical
concepts
with
an
intuiti
v
e,
g
ame-based
interf
ace,
the
app
mak
es
learning
about
quantum
algorithms
eng
aging
and
accessible.
TELK
OMNIKA
T
elecommun
Comput
El
Control,
V
ol.
23,
No.
5,
October
2025:
1247–1257
Evaluation Warning : The document was created with Spire.PDF for Python.
TELK
OMNIKA
T
elecommun
Comput
El
Control
❒
1255
(a)
(b)
Figure
8.
W
eb
application
interf
ace;
(a)
about
and
(b)
rules
and
input
4.
CONCLUSION
This
paper
presents
a
g
amied
implementation
of
the
BV
algorithm
to
mak
e
quantum
algorithms
more
understandable
and
enjo
yable.
By
narrating
the
algorithm
i
nto
a
relatable
scenario,
this
g
ame
ef
fecti
v
ely
bridges
the
technical
g
ap
between
the
quantum
algorithm
and
the
general
public.
Players
e
xperience
the
fundamental
principles
of
quantum
speed-up
in
an
intuiti
v
e
and
eng
aging
manner
,
making
the
core
concepts
of
quantum
computing
more
approachable
to
di
v
erse
audiences,
including
educators,
students,
and
enthusiasts
with
little
or
no
technical
background.
The
implementation
le
v
erages
the
Qiskit-Aer
library
for
simulation
and
is
ef
fecti
v
ely
deplo
yed
on
DOM
Cloud
using
the
Flask
frame
w
ork,
illustrating
a
practical
pathw
ay
for
inte
grating
quantum
algorithms
into
modern
web-based
applications.
Future
de
v
elopments
could
e
xpand
this
g
amied
education
approach
on
other
more
comple
x
quantum
algorithms,
such
as
Gro
v
er’
s
search
and
Shor’
s
f
actoring
algorithms.
Quantum
operations
such
as
dif
fuser
and
reector
in
Gro
v
er
algorithm;
period
nding
and
phase
estimation
in
Shor
algorithm
are
intuiti
v
ely
dif
cult
to
learn,
and
an
interacti
v
e
g
ame
may
help
bridge
this
education
g
ap.
This
w
ork
contrib
utes
to
quantum
education
by
transforming
a
dif
cult
quantum
algorithm
into
a
fun
interacti
v
e
g
ame.
Through
v
arious
tools
lik
e
this
g
ame,
we
can
support
the
global
ef
fort
to
prepare
for
the
wider
adoption
of
these
technologies
by
training
a
ne
w
generation
of
quantum
inno
v
ators.
FUNDING
INFORMA
TION
This
w
ork
w
as
funded
by
PT
.
Lancs
Arche
Consumma
(MOU.003/CIT/XI/2022).
A
UTHOR
CONTRIB
UTIONS
ST
A
TEMENT
This
journal
uses
the
Contrib
utor
Roles
T
axonomy
(CRediT)
to
recognize
indi
vidual
author
contrib
u-
tions,
reduce
authorship
disputes,
and
f
acilitate
collaboration.
Realization
of
Bernstein-V
azir
ani
quantum
algorithm
in
an
inter
active
educational
game
(David
Gosal)
Evaluation Warning : The document was created with Spire.PDF for Python.
1256
❒
ISSN:
1693-6930
Name
of
A
uthor
C
M
So
V
a
F
o
I
R
D
O
E
V
i
Su
P
Fu
Da
vid
Gosal
✓
✓
✓
✓
✓
✓
✓
✓
T
imoth
y
Rudolf
T
an
✓
✓
✓
✓
✓
✓
✓
✓
Y
ozef
Tjandra
✓
✓
✓
✓
✓
✓
✓
✓
✓
Hendrik
Santoso
Sugiarto
✓
✓
✓
✓
✓
✓
✓
✓
✓
C
:
C
onceptualization
I
:
I
n
v
estig
ation
V
i
:
V
i
sualization
M
:
M
ethodology
R
:
R
esources
Su
:
Su
pervision
So
:
So
ftw
are
D
:
D
ata
Curation
P
:
P
roject
Administration
V
a
:
V
a
lidation
O
:
Writing
-
O
riginal
Draft
Fu
:
Fu
nding
Acquisition
F
o
:
F
o
rmal
Analysis
E
:
Writing
-
Re
vie
w
&
E
diting
CONFLICT
OF
INTEREST
ST
A
TEMENT
Authors
state
no
conict
of
interest.
D
A
T
A
A
V
AILABILITY
Data
a
v
ailability
is
not
applicable
to
this
paper
as
no
ne
w
data
were
created
or
analyzed
in
this
study
.
REFERENCES
[1]
H.
Y
.
W
ong,
”Shor’
s
Algorithm,
”
Intr
oduction
to
Quantum
Computing
.
Spring
er
,
Cham,
2024,
pp.
289-298,
doi:
10.1007/978-3-
031-36985-8
29.
[2]
S.
Jaques,
M.
Naehrig,
M.
Roetteler
,
and
F
.
V
irdia,
“Implementing
gro
v
er
oracles
for
quantum
k
e
y
search
on
aes
and
lo
wmc,
”
in
Ad-
vances
in
Cryptolo
gy–EUR
OCR
YPT
2020:
39th
Annual
International
Confer
ence
on
the
Theory
and
Applications
of
Crypto
gr
aphic
T
ec
hniques,
Za
gr
eb,
Cr
oatia,
May
10–14,
2020,
Pr
oceedings,
P
art
II
30
,
Springer
,
2020,
pp.
280–310,
doi:
10.1007/978-3-030-
45724-2
10.
[3]
J
.
R.
Fin
ˇ
zg
ar
,
A.
K
erschbaumer
,
M.
J.
Schuetz,
C.
B.
Mendl,
and
H.
G.
Katzgraber
,
“Quantum-informed
recursi
v
e
optimiz
ation
algorithms,
”
PRX
Quantum
,
v
ol.
5,
no.
2,
p.
020327,
2024.
[4]
A.
Abbas
et
al.
,
“Challenges
and
opportunities
in
quantum
optimization,
”
Natur
e
Re
vie
ws
Physics
,
pp.
1–18,
2024,
doi:
11245.1/e3a25092-f400-4b62-9456-672855c76e8c.
[5]
M.
Cerezo,
G.
V
erdon,
H.-Y
.
Huang,
L.
Cincio,
and
P
.
J.
Coles,
“Challenges
and
opportunities
in
quantum
machine
learning,
”
Natur
e
computational
science
,
v
ol.
2,
no.
9,
pp.
567–576,
2022,
doi:
10.1002/wcms.1580.
[6]
Y
.
Tjandra
and
H.
S.
Sugiarto,
“
An
e
v
olutionary
algorithm
design
for
pauli-based
quantum
k
ernel
classication,
”
in
VLDB
W
ork-
shops
,
2023.
[7]
Y
.
Tjandra
and
H.
S.
Sugiarto,
“Metaheuristic
optimization
scheme
for
quantum
k
ernel
classiers
using
entanglement-directed
graphs,
”
ETRI
J
ournal
,
v
ol.
46,
no.
5,
pp.
793–805,
2024,
doi:
10.4218/etrij.2024-0144.
[8]
M
.
Motta
and
J.
E.
Rice,
“Emer
ging
quantum
computi
ng
algorithms
for
quantum
chemistry
,
”
W
ile
y
Inter
disciplinary
Re
vie
ws:
Computational
Molecular
Science
,
v
ol.
12,
no.
3,
p.
e1580,
2022,
doi:
10.1002/wcms.1580.
[9]
R
.
W
olf,
”Quantum
K
e
y
Distrib
ution,
”
in
Lectur
e
Notes
in
Physics,
vol.
988.
Cham:
Spring
er
International
Publishing
,
2021,
doi:
10.1007/978-3-030-73991-1.
[10]
F
.
Arute
et
al.
,
“Quantum
supremac
y
using
a
programmable
superconducting
processor
,
”
Natur
e
,
v
ol.
574,
no.
7779,
pp.
505–510,
Oct.
2019,
doi:
10.1038/s41586-019-1666-5.
[11]
N.
Zobrist
et
al.
,
“Quantum
error
correction
belo
w
the
surf
ace
code
threshold,
”
Natur
e
,
v
ol.
638,
no.
8052,
pp.
920–926,
Feb
.
2025,
doi:
10.1038/s41586-024-08449-y
.
[12]
M.
Aghaee
et
al.
,
“Interferometric
single-shot
parity
measurement
in
InAs–Al
h
ybrid
de
vices,
”
Natur
e
,
v
ol.
638,
no.
8051,
pp.
651–655,
Feb
.
2025,
doi:
10.1038/s41586-024-08445-2.
[13]
C
.
Easttom,
Quantum
Computing
Fundamentals,
[F
ir
st
edition]
.
Addison-W
esle
y
Professional,
2023.
[14]
R
.
Portug
al,
“Basic
quantum
algorithms,
”
arXiv
,
2022,
doi:
10.48550/arXi
v
.2201.10574.
[15]
K.
Nag
ata,
D.
N.
Diepm,
A.
F
arouk,
and
T
.
Nakamura,
Simplied
quantum
computing
with
applications
.
IOP
Publishing,
2022,
doi:
10.1088/978-0-7503-4700-6.
[16]
H.
Xie
and
L.
Y
ang,
“Us
ing
bernstein–v
azirani
algorithm
to
attack
block
ciphers,
”
Designs,
Codes
and
Crypto
gr
aphy
,
v
ol.
87,
pp.
1161–1182,
2019,
doi:
10.1007/s10623-018-0510-5.
[17]
S
.
F
allek,
C.
Herold,
B.
McMahon,
K.
Maller
,
K.
Bro
wn,
and
J.
Amini,
“T
ransport
implementation
of
the
bernstein–v
azirani
algorithm
with
ion
qubits,
”
Ne
w
J
ournal
of
Physics
,
v
ol.
18,
no.
8,
p.
083030,
2016,
doi:
10.1088/1367-2630/18/8/083030.
[18]
K
.
Wright
et
al
.
,
“Benchmarking
an
11-qubit
quantum
computer
,
”
Natur
e
communications
,
v
ol.
10,
no.
1,
p.
5464,
2019,
doi:
10.1038/s41467-019-13534-2.
[19]
B.
Pokharel
and
D.
Lidar
,
“Demonstrati
on
of
algorithmic
quantum
speedup,
”
Physical
Re
vie
w
Letter
s
,
v
ol.
130,
no.
21,
p.
210602,
2023,
doi:
10.1103/Ph
ysRe
vLett.130.210602.
[20]
T
.
Chu,
“Simulation
and
visualization
of
the
bernstein-v
azirani
quantum
protocol,
”
2023,
accessed
on
11
December
2024,
[Online].
A
v
ailable:
https://bernstein-v
azirani.streamlit.app.
TELK
OMNIKA
T
elecommun
Comput
El
Control,
V
ol.
23,
No.
5,
October
2025:
1247–1257
Evaluation Warning : The document was created with Spire.PDF for Python.