Shor-Algorithm-on-IBM-Quantum-Experience icon indicating copy to clipboard operation
Shor-Algorithm-on-IBM-Quantum-Experience copied to clipboard

What about the other possible factor: gcd(a**(r/2) - 1, N)

Open cjoverbay opened this issue 4 years ago • 0 comments

https://github.com/amitabhyadav/Shor-Algorithm-on-IBM-Quantum-Experience/blob/master/Shor_version1_5bit_hardware.py#L118 https://github.com/amitabhyadav/Shor-Algorithm-on-IBM-Quantum-Experience/blob/master/Shor_version1_5bit_hardware.py#L159

According to the algorithm, at least one of the following is a nontrivial factor of N:

  • gcd(a^{r/2}+1,N)
  • gcd(a^{r/2}-1,N)

It seems that the code is neglecting the second possible factor

cjoverbay avatar Mar 30 '20 16:03 cjoverbay