-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontrol_script_cluster.py
More file actions
36 lines (28 loc) · 1.44 KB
/
control_script_cluster.py
File metadata and controls
36 lines (28 loc) · 1.44 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
import pandas as pd
from run_tn_sim import run_tn_sim
import time
import argparse
import os
def process_task(args):
topology, size, cycle, error = args
if not os.path.exists(f"./errors_meas_actualfix_crosstalk/output_c{cycle}_a{topology}_s{size}_e{error}.csv"):
vnes, tmi, shuttles = run_tn_sim(2000, error, topology, f"./compiled_circuits/c{cycle}_a{topology}_s{size}.qasm")
data = {"vnes": vnes, "tmi": tmi, "shuttles":shuttles}
dframe = pd.DataFrame(data)
dframe.to_csv(f"./errors_meas_actualfix_crosstalk/output_c{cycle}_a{topology}_s{size}_e{error}.csv")
# print("done")
if __name__ == '__main__':
parser = argparse.ArgumentParser()
# Add arguments for the task ranges
parser.add_argument('--topology', type=int, choices=range(1, 4), help="Error value")
parser.add_argument('--size', type=int,choices=[4, 5, 6, 7], help="Error value ")
parser.add_argument('--cycle', type=int, choices=range(1, 11), help="Error value ")
parser.add_argument('--error', type=float, choices=[0.01, 0.03, 0.05 , 0.08, 0.1], help="Error value")
# Number of worker processes to use
# Parse the arguments
args = parser.parse_args()
topology, size, cycle, error = vars(args).values()
start_time = time.time()
process_task((topology, size, cycle, error))
end_time = time.time()
print(f"Time taken for specific block: {end_time - start_time:.2f} seconds")