mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-24 05:21:09 +00:00
Added referred website and handle type hints
This commit is contained in:
parent
7655bf3f65
commit
17ec57437e
|
@ -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()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user