Skip to content

Commit 17ec574

Browse files
committed
Added referred website and handle type hints
1 parent 7655bf3 commit 17ec574

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

quantum/shor_algorithm.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
In this implementation, I have used a very simple construct without
1010
the use of qiskit or cirq to help understand how Shor algorithm's
1111
idea actually works.
12+
13+
Website referred for shor algorithm:
14+
https://www.geeksforgeeks.org/shors-factorization-algorithm/
1215
"""
1316
class Shor:
1417
def period_find(self, num: int, number: int) -> int:
@@ -26,7 +29,7 @@ def period_find(self, num: int, number: int) -> int:
2629
start += 1
2730
return start
2831

29-
def shor_algorithm(self, number:int) -> list[int]:
32+
def shor_algorithm(self, number:int) -> tuple[int, int]:
3033
"""
3134
Run Shor's algorithm to factor a number.
3235
>>> shor = Shor()

0 commit comments

Comments
 (0)