Shor's Algorithm - From Factoring to Period Finding
Let’s devise a framework to find the non-trivial square root X. In doing so, we shall translate our problem of factorization to a problem that closely relates to period finding.
As a refresher, when we want to factor an integer , we want to find the non-trivial square root of the congruence . Then we feed the obtained into an efficient algorithm that calculates the greatest common divisor of two numbers to obtain two factors of with . Now, the agenda of this lesson is to find . So, let’s get started.
Let’s revisit our problem from the previous lesson. We want to factor . Let’s pick an at random, where . The inequality exists as we are not interested in obtaining or itself as its own factor, defeating the purpose of our original problem. Let’s say we pick . Now, we create a table with two columns and multiple rows. In the first column, we have , which is the number to which we shall be raising . In the second column, we have a function , which shows us the remainder we get after raising to that and then dividing it by .