The quantum phase estimation algorithm has been utilized by a variety of quantum algorithms, most notably Shor’s algorithm, to obtain information regarding the period of a function that is appropriately encoded into a unitary operator. In many cases, it is desired to estimate whether a specific state exhibits a certain pattern quickly. In this paper, we exhibit a methodology based on the QPE algorithm to identify certain patterns. In particular, starting from a properly encoded state, we demonstrate how to construct unitary operators whose eigenvectors correspond to states with proper diagonals. QPE will then output an eigenphase equal to zero with certainty for these states, thereby identifying this class of matrices. For partial matches, our algorithm, based on the tolerance threshold used, will show areas of high similarity, and it will outperform classical ones when the number of mismatches defined by the tolerance is significantly low when compared to the size of the diagonal.