  This paper is concerned with the phase estimation algorithm in quantum
computing algorithms, especially the scenarios where (1) the input vector is
not an eigenvector; (2) the unitary operator is not exactly implemented; (3)
random approximations are used for the unitary operator, e.g., the QDRIFT
method. We characterize the probability of computing the phase values in terms
of the consistency error, including the residual error, Trotter splitting
error, or statistical mean-square error. In the first two cases, we show that
in order to obtain the phase value with {error less or equal to $2^{-n}$ } and
probability at least $1-\epsilon$, the required number of qubits is $ t \geq n
+ \log \big(2 + \frac{\delta^2 }{2 \epsilon \Delta\!E^2 } \big).$ The parameter
$\delta$ quantifies the error associated with the inexact eigenvector and/or
the unitary operator, and $\Delta\! E$ characterizes the spectral gap, i.e.,
the separation from the rest of the phase values. For the third case, we found
a similar estimate, but the number of random steps has to be sufficiently
large.
