Quantum Computing, Quantum, Quantum Physics, Shors Algorithm, Qiskit.
# Get fraction that most closely resembles 0.666 # with denominator < 15 Fraction(0.666).limit_denominator(15) Out: Fraction(2, 3) Much nicer! The order (r) must be less than N, so we will set the maximum denominator to be 15: rows = [] for phase in measured_phases: frac =