<s>
Quantum	B-Algorithm
counting	I-Algorithm
algorithm	I-Algorithm
is	O
a	O
quantum	B-Device
algorithm	I-Device
for	O
efficiently	O
counting	O
the	O
number	O
of	O
solutions	O
for	O
a	O
given	O
search	O
problem	O
.	O
</s>
<s>
The	O
algorithm	O
is	O
based	O
on	O
the	O
quantum	B-Algorithm
phase	I-Algorithm
estimation	I-Algorithm
algorithm	I-Algorithm
and	O
on	O
Grover	B-Algorithm
's	I-Algorithm
search	I-Algorithm
algorithm	I-Algorithm
.	O
</s>
<s>
As	O
for	O
quantum	B-Architecture
computing	I-Architecture
,	O
the	O
ability	O
to	O
perform	O
quantum	B-Algorithm
counting	I-Algorithm
efficiently	O
is	O
needed	O
in	O
order	O
to	O
use	O
Grover	B-Algorithm
's	I-Algorithm
search	I-Algorithm
algorithm	I-Algorithm
(	O
because	O
running	O
Grover	B-Algorithm
's	I-Algorithm
search	I-Algorithm
algorithm	I-Algorithm
requires	O
knowing	O
how	O
many	O
solutions	O
exist	O
)	O
.	O
</s>
<s>
From	O
the	O
properties	O
of	O
rotation	O
matrices	O
we	O
know	O
that	O
is	O
a	O
unitary	B-Algorithm
matrix	I-Algorithm
with	O
the	O
two	O
eigenvalues	O
.	O
</s>
<s>
From	O
here	O
onwards	O
,	O
we	O
follow	O
the	O
quantum	B-Algorithm
phase	I-Algorithm
estimation	I-Algorithm
algorithm	I-Algorithm
scheme	O
:	O
we	O
apply	O
controlled	O
Grover	O
operations	O
followed	O
by	O
inverse	O
quantum	B-Algorithm
Fourier	I-Algorithm
transform	I-Algorithm
;	O
and	O
according	O
to	O
the	O
analysis	O
,	O
we	O
will	O
find	O
the	O
best	O
-bit	O
approximation	O
to	O
the	O
real	O
number	O
(	O
belonging	O
to	O
the	O
eigenvalues	O
of	O
the	O
Grover	O
operator	O
)	O
with	O
probability	O
higher	O
than	O
.	O
</s>
<s>
Note	O
that	O
the	O
second	O
register	O
is	O
actually	O
in	O
a	O
superposition	O
of	O
the	O
eigenvectors	O
of	O
the	O
Grover	O
operator	O
(	O
while	O
in	O
the	O
original	O
quantum	B-Algorithm
phase	I-Algorithm
estimation	I-Algorithm
algorithm	I-Algorithm
,	O
the	O
second	O
register	O
is	O
the	O
required	O
eigenvector	O
)	O
.	O
</s>
<s>
Assuming	O
that	O
the	O
size	O
of	O
the	O
space	O
is	O
at	O
least	O
twice	O
the	O
number	O
of	O
solutions	O
(	O
namely	O
,	O
assuming	O
that	O
)	O
,	O
a	O
result	O
of	O
the	O
analysis	O
of	O
Grover	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
is	O
:	O
</s>
<s>
The	O
quantum	B-Algorithm
phase	I-Algorithm
estimation	I-Algorithm
algorithm	I-Algorithm
finds	O
,	O
with	O
high	O
probability	O
,	O
the	O
best	O
-bit	O
approximation	O
of	O
;	O
this	O
means	O
that	O
if	O
is	O
large	O
enough	O
,	O
we	O
will	O
have	O
,	O
hence	O
.	O
</s>
<s>
In	O
Grover	B-Algorithm
's	I-Algorithm
search	I-Algorithm
algorithm	I-Algorithm
,	O
the	O
number	O
of	O
iterations	O
that	O
should	O
be	O
done	O
is	O
.	O
</s>
<s>
Thus	O
,	O
if	O
is	O
known	O
and	O
is	O
calculated	O
by	O
the	O
quantum	B-Algorithm
counting	I-Algorithm
algorithm	I-Algorithm
,	O
the	O
number	O
of	O
iterations	O
for	O
Grover	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
is	O
easily	O
calculated	O
.	O
</s>
<s>
The	O
quantum	B-Algorithm
counting	I-Algorithm
algorithm	I-Algorithm
can	O
be	O
used	O
to	O
speed	O
up	O
solution	O
to	O
problems	O
which	O
are	O
NP-complete	O
.	O
</s>
<s>
Searching	O
through	O
all	O
the	O
possible	O
orderings	O
of	O
the	O
graph	O
's	O
vertices	O
can	O
be	O
done	O
with	O
quantum	B-Algorithm
counting	I-Algorithm
followed	O
by	O
Grover	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
,	O
achieving	O
a	O
speedup	O
of	O
the	O
square	O
root	O
,	O
similar	O
to	O
Grover	B-Algorithm
's	I-Algorithm
algorithm	I-Algorithm
.	O
</s>
<s>
This	O
approach	O
finds	O
a	O
Hamiltonian	O
cycle	O
(	O
if	O
exists	O
)	O
;	O
for	O
determining	O
whether	O
a	O
Hamiltonian	O
cycle	O
exists	O
,	O
the	O
quantum	B-Algorithm
counting	I-Algorithm
algorithm	I-Algorithm
itself	O
is	O
sufficient	O
(	O
and	O
even	O
the	O
quantum	O
existence	O
algorithm	O
,	O
described	O
below	O
,	O
is	O
sufficient	O
)	O
.	O
</s>
<s>
Quantum	O
existence	O
problem	O
is	O
a	O
special	O
case	O
of	O
quantum	B-Algorithm
counting	I-Algorithm
where	O
we	O
do	O
not	O
want	O
to	O
calculate	O
the	O
value	O
of	O
,	O
but	O
we	O
only	O
wish	O
to	O
know	O
whether	O
or	O
not	O
.	O
</s>
<s>
A	O
trivial	O
solution	O
to	O
this	O
problem	O
is	O
directly	O
using	O
the	O
quantum	B-Algorithm
counting	I-Algorithm
algorithm	I-Algorithm
:	O
the	O
algorithm	O
yields	O
,	O
so	O
by	O
checking	O
whether	O
we	O
get	O
the	O
answer	O
to	O
the	O
existence	O
problem	O
.	O
</s>
<s>
Quantum	B-Algorithm
phase	I-Algorithm
estimation	I-Algorithm
can	O
be	O
optimized	O
to	O
eliminate	O
this	O
overhead	O
.	O
</s>
