Added referred website and handle type hints

This commit is contained in:
Joelkurien 2024-10-29 21:35:43 +11:00
parent 7655bf3f65
commit 17ec57437e

View File

@ -9,6 +9,9 @@ prime numbers that are used to create the public key value, n
In this implementation, I have used a very simple construct without In this implementation, I have used a very simple construct without
the use of qiskit or cirq to help understand how Shor algorithm's the use of qiskit or cirq to help understand how Shor algorithm's
idea actually works. idea actually works.
Website referred for shor algorithm:
https://www.geeksforgeeks.org/shors-factorization-algorithm/
""" """
class Shor: class Shor:
def period_find(self, num: int, number: int) -> int: def period_find(self, num: int, number: int) -> int:
@ -26,7 +29,7 @@ class Shor:
start += 1 start += 1
return start return start
def shor_algorithm(self, number:int) -> list[int]: def shor_algorithm(self, number:int) -> tuple[int, int]:
""" """
Run Shor's algorithm to factor a number. Run Shor's algorithm to factor a number.
>>> shor = Shor() >>> shor = Shor()