Shor-Algorithm-on-IBM-Quantum-Experience
Shor-Algorithm-on-IBM-Quantum-Experience copied to clipboard
What about the other possible factor: gcd(a**(r/2) - 1, N)
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