quantum.shor_algorithm ====================== .. py:module:: quantum.shor_algorithm Attributes ---------- .. autoapisummary:: quantum.shor_algorithm.shor Classes ------- .. autoapisummary:: quantum.shor_algorithm.Shor Module Contents --------------- .. py:class:: Shor .. py:method:: period_find(num: int, number: int) -> int Find the period of a^x mod N. >>> shor = Shor() >>> shor.period_find(2, 15) 4 >>> shor.period_find(3, 7) 6 .. py:method:: shor_algorithm(number: int) -> tuple[int, int] Run Shor's algorithm to factor a number. >>> shor = Shor() >>> random.seed(0) >>> factors = shor.shor_algorithm(15) >>> isinstance(factors, tuple) and len(factors) == 2 True >>> factors (3, 5) .. py:data:: shor