#     if use_Astar_search == True or use_Astar_lookahead == True or use_RemotoCNOTandWindow == True or use_UDecompositionFullConnectivity == True or use_HeuristicGreedySearch == True:
#         possible_swap_combination = ct.FindAllPossibleSWAPParallel(G)
# =============================================================================
'''only use single swap'''
possible_swap_combination = []
edges = list(G.edges()).copy()
for current_edge in edges:
    possible_swap_combination.append([current_edge])

num_file = 0
original_cir_size = []

for file in QASM_files:
    if file[-5:-1] != '.qasm': file += '.qasm'
    num_file += 1
    res_qasm = ct.CreateDGfromQASMfile(file)
    x_lable_filename.append(file)
    results[file[0:-5]]['gates'] = [None] * repeat_time
    results[file[0:-5]]['gates time'] = [None] * repeat_time

    print('Number of circuits is', num_file)
    for repeat in range(repeat_time):
        print('The repeating time is ', repeat)
        '''initialize logical quantum circuit'''
        q_log = res_qasm[1][2]
        cir_log = res_qasm[0]
        x_label.append(cir_log.size())
        if repeat == 0: original_cir_size.append(cir_log.size())
        '''initialize physical quantum circuit'''
        q_phy = QuantumRegister(num_vertex, 'v')
        cir_phy = QuantumCircuit(q_phy)
Beispiel #2
0
    '4gt13_90.qasm', 'alu-v4_36.qasm', '4gt5_77.qasm',
    'one-two-three-v1_99.qasm', 'rd53_138.qasm', 'one-two-three-v0_98.qasm',
    '4gt10-v1_81.qasm', 'decod24-v3_45.qasm', 'aj-e11_165.qasm',
    '4mod7-v0_94.qasm', 'alu-v2_32.qasm', '4mod7-v1_96.qasm',
    'cnt3-5_179.qasm', 'mod10_176.qasm', '4gt4-v0_80.qasm', '4gt12-v0_88.qasm',
    '0410184_169.qasm', '4_49_16.qasm', '4gt12-v1_89.qasm', '4gt4-v0_79.qasm',
    'hwb4_49.qasm', '4gt4-v0_78.qasm', 'mod10_171.qasm', '4gt12-v0_87.qasm',
    '4gt12-v0_86.qasm', '4gt4-v0_72.qasm', '4gt4-v1_74.qasm',
    'mini-alu_167.qasm', 'one-two-three-v0_97.qasm', 'rd53_135.qasm',
    'ham7_104.qasm', 'decod24-enable_126.qasm', 'mod8-10_178.qasm',
    '4gt4-v0_73.qasm', 'ex3_229.qasm', 'mod8-10_177.qasm', 'alu-v2_31.qasm',
    'C17_204.qasm', 'rd53_131.qasm', 'alu-v2_30.qasm', 'mod5adder_127.qasm',
    'rd53_133.qasm', 'majority_239.qasm', 'ex2_227.qasm', 'cm82a_208.qasm',
    'sf_276.qasm', 'sf_274.qasm', 'con1_216.qasm', 'rd53_130.qasm',
    'f2_232.qasm', 'rd53_251.qasm', 'hwb5_53.qasm', 'radd_250.qasm',
    'rd73_252.qasm', 'cycle10_2_110.qasm', 'hwb6_56.qasm', 'cm85a_209.qasm',
    'rd84_253.qasm', 'root_255.qasm', 'mlp4_245.qasm', 'urf2_277.qasm',
    'sym9_148.qasm', 'hwb7_59.qasm', 'clip_206.qasm', 'sym9_193.qasm',
    'dist_223.qasm', 'sao2_257.qasm', 'urf5_280.qasm', 'urf1_278.qasm',
    'sym10_262.qasm', 'hwb8_113.qasm', 'urf2_152.qasm'
]

for file in QASM_files2:
    num_file += 1
    res = ct.CreateDGfromQASMfile(file)
    DG = res[1][0]
    CNOT_list = ct.CreateCNOTList(DG)
    f = open('CNOT_lists/' + file + '.txt', 'w')
    f.write(str(CNOT_list))
    f.close()