-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshors_algorithm.py
More file actions
36 lines (29 loc) · 1.09 KB
/
shors_algorithm.py
File metadata and controls
36 lines (29 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#******************************************************************************#
# #
# Main function for Shor's #
# factoring algorithm. #
# #
#******************************************************************************#
import sys
import random
import math
import numpy as np
from numpy.linalg import norm
import cmath
import matplotlib.pyplot as plt
from src.Shors_algorithm import *
from src.sparse_matrix import SparseMatrix
from src.quantum_register import QuantumRegister
from src.quantum_operator import Operator
from src.operators import *
from src.QFT import *
from src.quantum_shor import *
def main(args):
if len(args) != 2:
print("python shors_algorithm.py n_qubits test_value")
sys.exit()
n_qubits = int(args[0])
n = int(args[1])
all_Shor(n, n_qubits)
if __name__ == '__main__':
main(sys.argv[1:])