Talk:Shor's algorithm: Difference between revisions

Content deleted Content added
Line 765:
 
The article says things like "square root <math>b</math> of 1 modulo <math>N</math>" or <math>a^r \equiv 1 \;\rm{mod} \; N</math>. Maybe I'm just being thick, or too much of a programmer, but without an explanation of that notation, or at least parentheses to bring it in line with the linked [[Modular arithmetic|modulo]] page, I find it confusing. I read "1 mod N" as "the remainder when you divide 1 by N", which is always 1 if N is a positive integer, but that's obviously not right in context. I guess it means something like <math>a^r \; \rm{mod} \; N = 1</math> in the notation I'm used to. If people feel that more traditional notation would decrease clarity or accuracy, I suggest adding parentheses around "mod <math>N</math>" and a sentence or two explaining that it applies to both sides of the equation (as done in [[Modular arithmetic]]) or at least an explanation of the notation used and why it's different from other texts. [[Special:Contributions/207.224.243.154|207.224.243.154]] ([[User talk:207.224.243.154|talk]]) 20:29, 31 August 2022 (UTC)
 
== inconsistency in register sizes ==
 
I think there is a minor error in sizing of the second register, apologies if not, I found the notation confusing!
There is a statement "The input and output qubit registers need to hold superpositions of values from 0 to Q-1, and so have q qubits each". Also the equation under point 2 in section "Quantum part: period-finding subroutine" indicates the second register initially has "q" qubits. But immediately following that is the sentence: "However, the (q+n) qubits, i.e, the q input qubits and n (>log2(N)) output qubits, are now entangled or not..." This sentence implies the second register has "n" qubits. Also the figure indicates the second register has "n" qubits.
 
I suspect the second register using "n" qubits is correct, since it only needs to store a number of maximum size approximately N (as the computations into that register are mod N). The first register needs to be able to store numbers of maximum size Q which is somewhere between N^2 and 2N^2 and therefore needs more (ie "q~log2(Q)") qubits. But this is assuming what is meant by "n" is the the number of bits to represent N, that is, n=floor(log2(N))+1, which is a common notation? I couldn't see it defined per se. If this is correct then the subscript on the QFT^{-1} in the figure should also be fixed, the QFT is over N not 2n.
 
As a separate issue I would also quibble with the statement about phase kickback. At that point in the algorithm all phases are still +1. Phase kickback refers to cases where the phase of a state has a form something like (-1)^f(x), or exp(i*f(x)) or similar. Here I think its misleading to call the evaluation into the second register "phase kickback". [[Special:Contributions/86.11.100.180|86.11.100.180]] ([[User talk:86.11.100.180|talk]]) 05:33, 13 October 2022 (UTC)