TITLE: Why is integer factorization considered to be in NP if a quantum computer can compute a factorization in polynomial time?
QUESTION [8 upvotes]: Sorry if this seems off topic, the cstheory guys told me it was off topic over there, and sent me here.
Shor's algorithm on a quantum computer can solve an integer factorization problem in polynomial time. So why is this problem considered to not be in P? Do quantum computers not count? I have looked around and see some discussion on the matter, but no clear answers.

REPLY [10 votes]: The title of the question is different from the question's content. Since the version you asked over cstheory is the one in the title, I will answer that.
Factoring is both in $\mathsf{NP}$ and $\mathsf{BQP}$ (polynomial time quantum TM).  This is not strange at all, e.g. every problem in $\mathsf{P}$ is also in both of them. Being in $\mathsf{NP}$ does not mean the problem is difficult, it is an upperbound on difficulty of the problem. A problem in $\mathsf{NP}$ can be arbitrary easy. I am guessing that you are confusing $\mathsf{NP}$ and $\mathsf{NP\text{-}complete}$. It is not known (in fact very unlikely) that Factoring is $\mathsf{NP\text{-}complete}$.