From 03a36a554f6b997da3534f6cc77924b00b43f8b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=B6nberger?= <101660501+danielschoenberger@users.noreply.github.com> Date: Mon, 11 Nov 2024 15:45:37 +0100 Subject: [PATCH 1/6] initial --- run_benchmarks.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/run_benchmarks.py b/run_benchmarks.py index 719d954..9577070 100644 --- a/run_benchmarks.py +++ b/run_benchmarks.py @@ -27,7 +27,7 @@ def run_simulation_for_architecture(arch, seeds, pz, max_timesteps, compilation= m, n, v, h = arch graph = GraphCreator(m, n, v, h, pz).get_graph() n_of_traps = len([trap for trap in graph.edges() if graph.get_edge_data(trap[0], trap[1])["edge_type"] == "trap"]) - num_ion_chains = 24#math.ceil(n_of_traps / 2) + num_ion_chains = math.ceil(n_of_traps / 2) try: ion_chains, number_of_registers = create_starting_config(num_ion_chains, graph, seed=seed) @@ -38,7 +38,7 @@ def run_simulation_for_architecture(arch, seeds, pz, max_timesteps, compilation= filename = f"QASM_files/QFT_no_swaps/qft_no_swaps_nativegates_quantinuum_tket_{num_ion_chains}.qasm" print(f"arch: {arch}, seed: {seed}, registers: {number_of_registers}\n") - time_2qubit_gate = 3 + time_2qubit_gate = 1 time_1qubit_gate = 1 max_chains_in_parking = 3 @@ -80,16 +80,16 @@ def log_results(arch, timestep_arr, cpu_time_arr, number_of_registers, n_of_trap print(cpu_time_mean) print(f"timestep mean: {timestep_mean}, timestep var: {timestep_var}, cpu time mean: {cpu_time_mean}") - # file_path = Path("results.txt") - # try: - # with file_path.open("a") as file: - # line = ( - # f"& {arch[0]} {arch[1]} {arch[2]} {arch[3]} & {number_of_registers}/{n_of_traps} & {seq_length} " - # f"& {timestep_mean} & {cpu_time_mean} s & Gate Selection={compilation} \\\\" - # ) - # file.write(f"array ts: {timestep_arr}\n" + line + "\n\n") - # except: - # pass + file_path = Path("results.txt") + try: + with file_path.open("a") as file: + line = ( + f"& {arch[0]} {arch[1]} {arch[2]} {arch[3]} & {number_of_registers}/{n_of_traps} & {seq_length} " + f"& {timestep_mean} & {cpu_time_mean} s & Gate Selection={compilation} \\\\" + ) + file.write(f"array ts: {timestep_arr}\n" + line + "\n\n") + except: + pass def main(): archs = [ From fff224c4e3d7e70cf78464f1200431fd02064d89 Mon Sep 17 00:00:00 2001 From: Daniel Schoenberger Date: Mon, 11 Nov 2024 18:38:46 +0100 Subject: [PATCH 2/6] initial --- __pycache__/Cycles.cpython-311.pyc | Bin 21086 -> 21098 bytes __pycache__/compilation.cpython-311.pyc | Bin 5622 -> 5634 bytes __pycache__/graph_utils.cpython-311.pyc | Bin 24857 -> 25699 bytes __pycache__/plotting.cpython-311.pyc | Bin 4751 -> 4765 bytes __pycache__/scheduling.cpython-311.pyc | Bin 19544 -> 18399 bytes graph_utils.py | 12 ++++++++++++ 6 files changed, 12 insertions(+) diff --git a/__pycache__/Cycles.cpython-311.pyc b/__pycache__/Cycles.cpython-311.pyc index b863a839e0d1774b62f8ea6c2d717fdf8cea3cff..81fef903986364e026f73a59deb45db2c510b79f 100644 GIT binary patch delta 62 zcmcb&gz?o9MxN!oyj%=Gpl5HCzLDn^JEPm==j@8ofu)IgC7F4prMddKg(bR~`FXm< Q8Kos9IjKdP#W~!)0CQdx$N&HU delta 50 zcmaF0gz?@IMxN!oyj%=GuxUqC+D4vR?2J~EpR+6Sd*EiBQ^%+J#;&L}M@ N$w@8RJd-I_7y#?l5_bRq delta 47 zcmZqD`KHaioR^o20SHnSif`nOWn#3SoXMof@0p($oKad*l9O7bYouqec_~w@FaRy> B4O0LB diff --git a/__pycache__/graph_utils.cpython-311.pyc b/__pycache__/graph_utils.cpython-311.pyc index f7d410899d6e27397d2e8866b72f14810e8dadad..8cb7b694453aae7edd1bc86b283d2ba590c2c02d 100644 GIT binary patch delta 2446 zcmbW1drXs86u`gR()tzp07@-I3Q``ngu-};55(7u(eY3;Q;^3;u~q8q!`oH?Q8Aki zH(}~=44qS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9aD3^T5VDl&gd&#{VbkL~Y6&H< zwR;G@>8>NA@OO7JW22{lT!X`&SHn99*_2SM&N*(Mzt{VO(3L_85{lJ1$L;fLc=>Mr E126;9*8l(j diff --git a/__pycache__/plotting.cpython-311.pyc b/__pycache__/plotting.cpython-311.pyc index 10b1ed65ef9ea1287feeba55b90b2d9ffbe15b1d..90a60460ff38b1814a50760cbda5a854c9eaec40 100644 GIT binary patch delta 53 zcmeBIovX^ToR^o20SNT$jnX&roa1Eln0%X4Q6#W5F|Q;uue3B*Kew<%H#0v^w|FxX HS1$(ui!~4Y delta 39 tcmbQM+ONv9oR^o20SK!0WTtK8ImgLpHTgEDBAah%PDy6)W&y5V4glNy3xEIs diff --git a/__pycache__/scheduling.cpython-311.pyc b/__pycache__/scheduling.cpython-311.pyc index 70d1c24e05828177727f4032005e6270db01a2c7..d27a379aff889703068f9650c15747bc5cf70892 100644 GIT binary patch delta 848 zcmZ9JUr19?9LLYO+pc%cd*{sQHvizz>%5i!+Kj@bD{7inAlgGBh;XK^++E$>C9Jbh z5rQ5vIzfg}>%|01hzq9l=fQ^{0)u=pUySIbH+zU6NIFMbga_{D{C@n-@Av)v?r(h> zZcah*i74g*dg@va4V`%|w!;AlNl)#w902q5+dUAd9Ln$YqEh6TguRuhU=s9Jp)yoR zJsCNvSB;7&eW;kS2DvB|@vu2IRZBh%8h{&YKQw)p9Vn2(xjO z$7H$jq3;yp(+~?NCneGxLAPfg0DuH+nE}X3(*zRoH#%~em5tMgjZFBf?R%@f@Q398 ztK?xziU(kpO3(k3hX9GBG~nJRQgzdq2b;&a4ln^RpRtnhfTY zFD8#951%$+kjdLgqNAGAl3qgA12UAzcAyyANl{a)E&tNaj?;9O>^~usO%*Q0V~9D- z;~Xq732Ys-($zW0^~2l7?2(_4QzQ~?K1tp-Kd^0B6T|V*ezs0B6!h~8v^{P5PK}!^ z2NiLJdR=tB#9b;ywu1M$A09(!`3Si!mvKHsIJjzjJJDt;H|WEju;!wdB5FQXWQpM@ z!zwu!_VIJfTp`!O$E)5j^A*EuhAD>I3@;f*8J5WBa35SVj0krT_o{ delta 1546 zcmbW0ZA@EL7{|}KrFXrhx9^m~2DGq_)j3`YC@;%KC$N{KCJRg4Py@_!VL)l|_99Dj z3Cv(7`T>&jVJvR0CL0T5iI_$-#w?i4DDi`3DY0on<_ACc5hKe;)Wqjd%f_N6dUN{g zbDneV^Zd_0=RTamsTnNZ5=A|NXRi4`Z}}(Uaon9ta_<;tIfUlnmw7M>am3W&CcBAw z0(X=V%LMA!OZE^O%sj*nvwb8FSWXT~EmGW??Gb(z{dImkD({tPt@U+Jh+;<#qqgS=={1z!PpoE7iPlQA5=Z6&~D9HzX z6;<(+Hs%%QIN1yeB>l4bLwt+A>MJaT6 zG1Gg#eJr`-5SzYc&y&+4V#!FHg-!F@8!;kQ`g%=)#X5>r&3K`jbCElV-o`3V7pzWt zy~gG)$#z0W)u=ho-Uh`@hm3{%sAdwyEMP`y&ZtrG(1KbIw$UTC`PfchsXe048`!!* zqXIL%wJOx5n4Z)H={sF^{GH2V+b-un>+&`3|9hO30aoxTRymbdcd0sdR8{B^;F3CD zmYMc6&8d4#ODfM=FSa;j z3)|sh@G-o{ut@9buWRK`A*K)OYfK9)IRl7T0bSJH&|qAK=oGYwybq>q(%yzEV{1C= zbYs$1mdd&TXaBY%894VtpzlGTZzV903=BYS#Slyyf&SD*fJH&fjL?GX34}-^=Wl?=yVOFvT# Date: Thu, 14 Nov 2024 17:11:42 +0100 Subject: [PATCH 3/6] first solution --- .DS_Store | Bin 10244 -> 10244 bytes .gitignore | 2 + Cycles.py | 21 +-- QASM_files/.DS_Store | Bin 14340 -> 14340 bytes QASM_files/full_register_access/.DS_Store | Bin 8196 -> 6148 bytes .../full_register_access_50.qasm | 2 +- __pycache__/Cycles.cpython-311.pyc | Bin 21098 -> 20652 bytes __pycache__/graph_utils.cpython-311.pyc | Bin 25699 -> 26847 bytes __pycache__/plotting.cpython-311.pyc | Bin 4765 -> 4765 bytes __pycache__/scheduling.cpython-311.pyc | Bin 18399 -> 19572 bytes graph_utils.py | 143 +++++++++++++++--- plotting.py | 2 +- results.txt | 21 +++ run_benchmarks.py | 14 +- scheduling.py | 39 ++--- 15 files changed, 183 insertions(+), 61 deletions(-) create mode 100644 results.txt diff --git a/.DS_Store b/.DS_Store index 0d0422c015f4a81ba63fc79694a100a586c63bc8..408eb0ec22c0f38186e562b0e6da12e6dabd82f1 100644 GIT binary patch delta 24 fcmZn(XbIS`PMY1+LPx>W)O7Mf0sGBgqy=~YXY~i- delta 16 XcmZn(XbIS`PI~e@5x31>qy=~YJtqc> diff --git a/.gitignore b/.gitignore index 7bd37a7..e50a0dc 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,5 @@ __pycache__/ # Ignore macOS system files .DS_Store + +QASM_files/ \ No newline at end of file diff --git a/Cycles.py b/Cycles.py index 3aeebb7..7b47b13 100644 --- a/Cycles.py +++ b/Cycles.py @@ -2,7 +2,7 @@ import networkx as nx import numpy as np from more_itertools import distinct_combinations, pairwise -from graph_utils import get_idc_from_idx, get_idx_from_idc, get_path_to_node, calc_dist_to_pz, MZGraphCreator, GraphCreator +from graph_utils import get_idc_from_idx, get_idx_from_idc, get_path_to_node, calc_dist_to_pz, order_edges, MZGraphCreator, GraphCreator class MemoryZone: def __init__( @@ -206,20 +206,7 @@ def find_next_edge(self, edge_idc, towards=(0, 0)): return get_idc_from_idx(self.idc_dict, next_edge_idx) def find_ordered_edges(self, edge1, edge2): - # Find the common node shared between the two edges - common_node = set(edge1).intersection(set(edge2)) - - if len(common_node) != 1 and edge1 != edge2: - msg = f"The input edges are not connected. Edges: {edge1}, {edge2}" - raise ValueError(msg) - - common_node = common_node.pop() - if edge1[0] == common_node: - edge1_in_order = (edge1[1], common_node) - edge2_in_order = (common_node, edge2[1]) if edge2[0] == common_node else (common_node, edge2[0]) - else: - edge1_in_order = (edge1[0], common_node) - edge2_in_order = (common_node, edge2[1]) if edge2[0] == common_node else (common_node, edge2[0]) + edge1_in_order, edge2_in_order = order_edges(edge1, edge2) # new if same edge twice don't change order if get_idx_from_idc(self.idc_dict, edge1_in_order) == get_idx_from_idc(self.idc_dict, edge2_in_order): @@ -245,6 +232,10 @@ def have_common_junction_node(self, edge1, edge2): return len(common_junction_nodes) == 1 def create_outer_circle(self, edge_idc, next_edge, other_next_edges, towards=(0, 0)): + if towards == (0, 0): + # towards is first edge in graph (can't be (0,0) because it may be deleted) + towards = list(self.graph.edges())[0][0] + # move from entry to memory zone if get_idx_from_idc(self.idc_dict, edge_idc) == get_idx_from_idc( self.idc_dict, self.graph_creator.entry_edge diff --git a/QASM_files/.DS_Store b/QASM_files/.DS_Store index 5837f70735ea5af30887d7e4fdd38cf87ae3f272..b8489ad975342b1d1ed35f7dbca878a9d27154fd 100644 GIT binary patch delta 99 zcmZoEXepR*m~rREi)QQ-AMkEw=dh7r+&MX1tdK{ty4uj#)IvwW)YNqH0R?Hs?#b`P zv<+05YOD)BK?#RDmnoG`gtSp delta 1480 zcmeH{U1$_n6vyxX+M1bqP43zxySdqDOw`nLYZA3FmDnZ*vzqutvq?5lDjR2lqsi=c zccMm+RScGvKGci~K1CEkeef#^f?sI06iN{#2u2_DK`QuCL1^>P(mNk0>QkS5aUSl> z|J-}#oHM^aGn5)i{q!>~p1o6>v+vQ=(Hx~dWOo!^9-g@nmGuVK4aa6rkj@0Yv^e^ zHxSCk%tXH)KtxsDBcUQ8;sZU#w*!VX$jcSQjh0LoY`vDS^i@gCN!9oT#XDa%U5Itg zPE%T!tL7)nsSqrdk)82`fAG@?W3erUsqu_os=9`W_H19GNAKgB>J|FDmWj@-dOBky zP2TDU7w0n(-s2o>(isR`^|I1Luah)vywlY^zP)1~PW4 zyeOORee0Jih(b!p98yObNR0H7B-u@VBqQWJxk9dz-^o4lnEXMWlL_)K0E$UqC_oS) z6rl`NsKI!D*a`p^#(+prT^?80vRfME^$aR3J~g5x-WlNiMf z+{7*Xg4-C!13bhN{Dr?UK`CW)D$S)q8lr+0(|NRt*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W!;%}c5*{D`&F&P&emsv z3*}oAF%tw)W4nue*tk6B5qD$B+PqC+B*RiJm1S ztm$}sEQt)wInNLRA>#^o%XNJ5c+;HBQ⋙YjWl+j%#bc%I-B4S1qEwRMne!^y63ZF>sC#Qy*w0lcgccoSC09I#{!BMGbD8bYaUy&Jskwb zRjr04J^L$zD&%AZw&N>-_A+uWzepZMoj7Mf=mn6abS~x9lD;hZB`v5>FXnAdMWrWU zqb_MadPqqn>C<@r3{GbvBVMrSnHX-oOOL{midV>^%>anGuQ#_k{)S5dBk-i+#6Ow` z2)so5H&9OxtiUU`P;2q`7#>Z0RC%&jF+pJP!bdM)*2$PkTJL!(pegPr43J^0<;Q1x1v@} zy4@e5{$Z%Y0wKS~MN)0BY^cU7-CdgwkjBLKHra%|`0Nrc zTXaE!E>dMAdL&g}SU{=bo@&r!YtJ5XlU?o!<)cu&;Edd{@VHE%Oe@@37w$${ymZ`) zy#a&(LI@#>KoP!)@G`<{2yY`?MR*tCHo`Q*9Rz-(+>OxLshtD6x$_52dDi*|rUj_Y zv3eeu7NDZR`s4%CQV6hDdwmk8g=FMhX6su^3RrXB?rKhVDX-6M8%Lsnv0-Hsy$9Pd m->C`q{l4zQbEf0T|K|6=5*1111JmR2k9__wU$DyS&3^-=mRnB% diff --git a/__pycache__/graph_utils.cpython-311.pyc b/__pycache__/graph_utils.cpython-311.pyc index 8cb7b694453aae7edd1bc86b283d2ba590c2c02d..4a9b3d0772341f6e86386e4fded45bdbc3bb3086 100644 GIT binary patch delta 5879 zcmb_geNbH06@T~bCoC*q3k0&T%Qp)ILI{$OV3L}IM3R&w8XF8*2>XCdV0XRyh=_}z z#uVGA!D}aIqD7-Ij2f+LM`r5Oq@A{QY9|XrC-k*xQR~!L+ma@K)Q*$sIrqWBk`J9u zAH3ha_uPB#x%b?2&pG=(`GEX+jF?}Ijg1!INw(eAR^2#gUPJrS#)u$oWMRp2~guxdaF%I#P2B?>`06+TG zV?<|xiXpgNEGCIYs5HWRveWJAcD7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zl(8zYBz-`aT7m*8KHAm0Z&gwidJL^U4lpl@ zeK0gCU59LCWd|@GeG=DlPV7TYq)#FI3Sfp0@f~SwbU}_HEUCP|-HlpKpcEF#oK_qO z6tnV57GzEcNy6@HDP{lMy_}?2S$MVM)`R8)<^!fdlo4nX+v+VXOyZ*HPqKhL5MF|v zi3vK8RyG-4KE1|xqcy=EzDC3~kG&}qcDl!ve~|E&-_Xva{&h88*a3d{+=O2SPFb2M z(Ho^XmFYz`)Vq@0$KLH<+{6hWPcuSY)6<66?);b%jSTd~sj3+vG3S1kLZjHh%4D~{ z8Frv+5Y_@{;_QN)pEEsjYf~TiNG%39BwVbhd}jF6a9Z?Cxk|IH#gnf330Hl_)sS^H zTo&^4?6M+Crfu1#ZJGM*+4}7nS69~6m3DP~JLU0ZJq?qdTP8fWob_istFoR|y4L@pd+(1> ze%Z{8vBwev7-MkSnQ?V%v&u~UZRa&h2VfJ7};@N{dbwW5GFd|jkF^+I6iVqr+ zMz+fA9)l>C%=V@bObz{PPS9v98PwZx&Cwr^#gzV}qL&U;%jeAi4>;~HL$umWd|7y& z_-JKL=I6?cP3zo`;lnxw9izK^(%m%SZpyfqXWh$>I4(#5Y)!o!j%>JSFFqE`*gaXh zC(Zw1cdAcvFSG}X=tBT r_JI(zQX2=V6YB{9Td$2@@$s*(p6xR1F%mHU+V~Y8|N1(!{DA)jMG& diff --git a/__pycache__/scheduling.cpython-311.pyc b/__pycache__/scheduling.cpython-311.pyc index d27a379aff889703068f9650c15747bc5cf70892..6292267fd1fb07b38a7af3ef88ce7d0e9050f4e6 100644 GIT binary patch delta 2048 zcmbVNZA?>F7(VB=z4W%d{cb5Bw7?KLKadLYAyJFKf(s^_CR66(*C`As1#hp@kb8qJ zE{-h`%vmC2bM}Yg95W-i(Kxqk-PC3C#|8#7)`aN4?bpI0CM^52_p~d*vMt$8?tSii z-gD0TKIiFqPah8Bg;6YC5k(V%R_@=_Re4U#!)MQxUw0F8hd<(%S~(Qqi3L!9BtWb5 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Qpd?pG6Cc4QYV<>m5))EF2!8Qv6V!wR6VGhfYT`-ecjx@? znKLuz%pbFG=M)$h48zOFHt*c}!jm&b6TCCi^?9h!Y~?go(7B)JJd(l@N26A0!IADL zCZWyMT4=4bRlTPn@pvm=%fr)fu$|XWvx6Nx$s^=-@+f)hcq6fk$B65BoM`eU;v+mk z+`!imH`<@Uq!XI$cD)mz!_L>`0TMR4^G-{00@5YOd zej7jOVC+Qr3==wsCQ?^S`f#Krjvu8XLBWndO`g;RE~L-H9vt7A@N>6teaN_nBHWnI zq{Ch{tHshEAHJJe_rCVxc+nh2`UW0eLJDUR2Oauqm9Ob^WnqTTXh^cKmJ)sFr ziIQ^B&5m!|jK!W9gz-erH&DQQZ`S_wF&*H2yw*1lvsm2TtC<0``Umi*{hbW2rgtzV}aZes#WPd+6nJxKhXY6*x?<&fVLdBpWTI; zYmp-6@vkR-Ppy`T6oUqJf!*6q>&`G$1AMSM9rkdC^m3>4k>VFFY2c25WP3ma1RGmz ziSP@Upv82YTNF#xu4t+(AsH&yRrM-F2(J#jG7&B}{6}LVEF8isd~+@;8I2V?M2C^} zGAJ9==H+NjXG}0rFT!*5|B^az)nud`tIZ!qL_|re4#L@L#xNI)QhlgpgElM{zg;P)>6!VYS;_**xo4o0~1&r&Hw-a diff --git a/graph_utils.py b/graph_utils.py index 2e5784b..38411d6 100644 --- a/graph_utils.py +++ b/graph_utils.py @@ -1,5 +1,7 @@ import networkx as nx from more_itertools import distinct_combinations, pairwise +global delete_node +delete_node = (3, 4) # create dictionary to swap from idx to idc and vice versa def create_idc_dictionary(nx_g): @@ -15,6 +17,45 @@ def get_idx_from_idc(edge_dictionary, idc): def get_idc_from_idx(edge_dictionary, idx): return edge_dictionary[idx] +def order_edges(edge1, edge2): + # Find the common node shared between the two edges + common_node = set(edge1).intersection(set(edge2)) + + if len(common_node) != 1 and edge1 != edge2: + msg = f"The input edges are not connected. Edges: {edge1}, {edge2}" + raise ValueError(msg) + + common_node = common_node.pop() + if edge1[0] == common_node: + edge1_in_order = (edge1[1], common_node) + edge2_in_order = (common_node, edge2[1]) if edge2[0] == common_node else (common_node, edge2[0]) + else: + edge1_in_order = (edge1[0], common_node) + edge2_in_order = (common_node, edge2[1]) if edge2[0] == common_node else (common_node, edge2[0]) + + return edge1_in_order, edge2_in_order + +# def sort_edges_with_shared_node(edge1, edge2): +# # Extract the nodes from each edge +# nodes1 = set(edge1) +# nodes2 = set(edge2) + +# # Find the shared node +# shared_node = nodes1.intersection(nodes2) + +# # There should be exactly one shared node between the two edges +# if len(shared_node) != 1: +# raise ValueError("Edges do not share exactly one node") + +# shared_node = shared_node.pop() + +# # Determine the non-shared nodes in each edge +# node1 = (nodes1 - {shared_node}).pop() +# node2 = (nodes2 - {shared_node}).pop() + +# # Sort to ensure shared node is in the middle +# sorted_edges = ((node1, shared_node), (shared_node, node2)) +# return sorted_edges def get_path_to_node(nx_g, src, tar, exclude_exit=False, exclude_first_entry_connection=True): edge_path = [] @@ -93,7 +134,7 @@ def create_graph(self): if self.pz == 'mid': self._remove_mid_part(networkx_graph) nx.set_edge_attributes(networkx_graph, "trap", "edge_type") - self._remove_node(networkx_graph, (0, 0)) + self._delete_junction(networkx_graph, delete_node) return networkx_graph @@ -135,10 +176,42 @@ def _set_junction_nodes(self, networkx_graph): for j in range(0, self.n_extended, self.ion_chain_size_horizontal): networkx_graph.add_node((i, j), node_type="junction_node", color="g") - def _remove_node(self, networkx_graph, node): - networkx_graph.remove_node(node) - for edge in list(networkx_graph.edges(node)): - networkx_graph.remove_edge(*edge) + # def _remove_node(self, networkx_graph, node): + # networkx_graph.remove_node(node) + # for edge in list(networkx_graph.edges(node)): + # networkx_graph.remove_edge(*edge) + + def _delete_junction(self, networkx_graph, junction_node): + # # Helper function to traverse and delete edges until another junction + # def remove_edges_until_junction(current_node, previous_node): + # for neighbor in list(networkx_graph.neighbors(current_node)): + # print('neighbor', neighbor) + # print('previous_node', previous_node) + # # Skip the previous node to avoid looping back + # if neighbor == previous_node: + # continue + + # # Check if this neighbor is another junction + # # if neighbor in junction_nodes: + # if ( + # nx.get_node_attributes(networkx_graph, "node_type")[neighbor] + # not in ("junction_node", "exit_node", "exit_connection_node", "entry_node", "entry_connection_node") + # ): + # print('continue') + # continue + + # # Remove the edge to this neighbor + # networkx_graph.remove_edge(current_node, neighbor) + + # # Recursively remove edges from this neighbor + # remove_edges_until_junction(neighbor, current_node) + + # # Traverse from each node connected to the deleted junction + # for neighbor in list(networkx_graph.neighbors(junction_node)): + # remove_edges_until_junction(neighbor, None) + + # Remove the junction node + networkx_graph.remove_node(junction_node) def get_graph(self): return self.networkx_graph @@ -183,7 +256,7 @@ def create_graph(self): self._remove_mid_part(networkx_graph) nx.set_edge_attributes(networkx_graph, "trap", "edge_type") self._set_processing_zone(networkx_graph) - self._remove_node(networkx_graph, (0, 0)) + self._delete_junction(networkx_graph, delete_node) return networkx_graph @@ -342,10 +415,40 @@ def _set_processing_zone(self, networkx_graph): else: raise ValueError("pz must be 'mid' or 'outer'") - def _remove_node(self, networkx_graph, node): - networkx_graph.remove_node(node) - for edge in list(networkx_graph.edges(node)): - networkx_graph.remove_edge(*edge) + # def _remove_node(self, networkx_graph, node): + # networkx_graph.remove_node(node) + # for edge in list(networkx_graph.edges(node)): + # networkx_graph.remove_edge(*edge) + + def _delete_junction(self, networkx_graph, junction_node): + # # Helper function to traverse and delete edges until another junction + # def remove_edges_until_junction(current_node, previous_node): + # for neighbor in list(networkx_graph.neighbors(current_node)): + # # Skip the previous node to avoid looping back + # if neighbor == previous_node: + # continue + + # # Check if this neighbor is another junction + # # if neighbor in junction_nodes: + # if ( + # nx.get_node_attributes(networkx_graph, "node_type")[neighbor] + # not in ("junction_node", "exit_node", "exit_connection_node", "entry_node", "entry_connection_node") + # ): + # continue + + # # Remove the edge to this neighbor + # networkx_graph.remove_edge(current_node, neighbor) + + # # Recursively remove edges from this neighbor + # remove_edges_until_junction(neighbor, current_node) + + # # Traverse from each node connected to the deleted junction + # for neighbor in list(networkx_graph.neighbors(junction_node)): + # remove_edges_until_junction(neighbor, None) + + # Remove the junction node + networkx_graph.remove_node(junction_node) + def get_graph(self): return self.networkx_graph @@ -353,28 +456,30 @@ def get_graph(self): def find_connected_edges(self): connected_edge_pairs = set() - for edge in self.networkx_graph.edges(): node1, node2 = edge # Find edges connected to node1 for neighbor in self.networkx_graph.neighbors(node1): if neighbor != node2: # avoid the original edge - connected_edge_pairs.add(tuple(sorted([edge, (node1, neighbor)]))) + edge_pair = tuple(sorted([edge, (node1, neighbor)])) + connected_edge_pairs.add(edge_pair) # Find edges connected to node2 for neighbor in self.networkx_graph.neighbors(node2): if neighbor != node1: # avoid the original edge - connected_edge_pairs.add(tuple(sorted([edge, (node2, neighbor)]))) - + edge_pair = tuple(sorted([edge, (node2, neighbor)])) + connected_edge_pairs.add(edge_pair) + # order edges (also include reverse order -> opposite direction moves are now needed if a junction fails) + connected_edge_pairs = [order_edges(edge_pair[0], edge_pair[1]) for edge_pair in connected_edge_pairs] + [order_edges(edge_pair[1], edge_pair[0]) for edge_pair in connected_edge_pairs] # Convert set of tuples to a list of lists connected_edge_pairs = [list(pair) for pair in connected_edge_pairs] return connected_edge_pairs - # Example of how to call this method - def print_connected_edges(self): - connected_edges = self.find_connected_edges() - for edge_pair in connected_edges: - print(edge_pair) + # # Example of how to call this method + # def print_connected_edges(self): + # connected_edges = self.find_connected_edges() + # for edge_pair in connected_edges: + # print(edge_pair) # gc = GraphCreator(m=3, n=3, ion_chain_size_vertical=2, ion_chain_size_horizontal=2, pz='mid') # gc.print_connected_edges() \ No newline at end of file diff --git a/plotting.py b/plotting.py index 3282d43..83699a5 100644 --- a/plotting.py +++ b/plotting.py @@ -49,7 +49,7 @@ def plot_state(graph, ion_moves, labels, plot_ions=True, show_plot=False, save_p edge_labels = nx.get_edge_attributes(graph, "ion_chain") # plt.figure(figsize=(25, 15)) - plt.figure(figsize=(max(pos.keys())[0]*10, max(pos.keys())[1]*10))#self.n * self.ion_chain_size_horizontal, self.m * self.ion_chain_size_vertical)) + plt.figure(figsize=(max(pos.keys())[0]*3, max(pos.keys())[1]*3))#self.n * self.ion_chain_size_horizontal, self.m * self.ion_chain_size_vertical)) nx.draw_networkx( graph, pos=pos, diff --git a/results.txt b/results.txt new file mode 100644 index 0000000..a94fd7d --- /dev/null +++ b/results.txt @@ -0,0 +1,21 @@ +array ts: [23] +& 3 3 2 2 & 11/22 & 11 & 23.0 & 17.398945808410645 s & Gate Selection=False \\ + +array ts: [27] +& 3 3 2 2 & 10/20 & 10 & 27.0 & 12.028406858444214 s & Gate Selection=False \\ + +array ts: [8] +& 3 3 1 1 & 6/12 & 6 & 8.0 & 0.04474687576293945 s & Gate Selection=True \\ + +array ts: [20] +& 3 3 2 2 & 11/22 & 11 & 20.0 & 61.66305589675903 s & Gate Selection=False \\ + +array ts: [20] +& 3 3 2 2 & 11/22 & 11 & 20.0 & 0.6196222305297852 s & Gate Selection=False \\ + +array ts: [20] +& 3 3 2 2 & 11/22 & 11 & 20.0 & 0.6263039112091064 s & Gate Selection=False \\ + +array ts: [20] +& 3 3 2 2 & 11/22 & 11 & 20.0 & 0.6150369644165039 s & Gate Selection=False \\ + diff --git a/run_benchmarks.py b/run_benchmarks.py index 9577070..944be14 100644 --- a/run_benchmarks.py +++ b/run_benchmarks.py @@ -34,8 +34,8 @@ def run_simulation_for_architecture(arch, seeds, pz, max_timesteps, compilation= except: continue print(f"ion chains: {ion_chains}, number of registers: {number_of_registers}") - #filename = f"QASM_files/full_register_access/full_register_access_{num_ion_chains}.qasm" - filename = f"QASM_files/QFT_no_swaps/qft_no_swaps_nativegates_quantinuum_tket_{num_ion_chains}.qasm" + filename = f"QASM_files/full_register_access/full_register_access_{num_ion_chains}.qasm" + #filename = f"QASM_files/QFT_no_swaps/qft_no_swaps_nativegates_quantinuum_tket_{num_ion_chains}.qasm" print(f"arch: {arch}, seed: {seed}, registers: {number_of_registers}\n") time_2qubit_gate = 1 @@ -52,8 +52,9 @@ def run_simulation_for_architecture(arch, seeds, pz, max_timesteps, compilation= memorygrid.distance_map, filename, compilation=compilation ) seq_length = len(seq) + print(f"seq: {seq}") timestep = run_simulation( - memorygrid, max_timesteps, seq, flat_seq, dag_dep, next_node_initial, max_length=10, show_plot=False + memorygrid, max_timesteps, seq, flat_seq, dag_dep, next_node_initial, max_length=10 ) timestep_arr.append(timestep) cpu_time = time.time() - start_time @@ -93,17 +94,18 @@ def log_results(arch, timestep_arr, cpu_time_arr, number_of_registers, n_of_trap def main(): archs = [ - [7, 7, 2, 2], + [3, 3, 2, 2], ] seeds = [0]#, 1, 2, 3, 4] pz = 'outer' max_timesteps = 10000000 + compilation = False for arch in archs: timestep_arr, cpu_time_arr, number_of_registers, n_of_traps, seq_length = run_simulation_for_architecture( - arch, seeds, pz, max_timesteps, compilation=True + arch, seeds, pz, max_timesteps, compilation=compilation ) - log_results(arch, timestep_arr, cpu_time_arr, number_of_registers, n_of_traps, seq_length, compilation=True) + log_results(arch, timestep_arr, cpu_time_arr, number_of_registers, n_of_traps, seq_length, compilation=compilation) if __name__ == "__main__": main() diff --git a/scheduling.py b/scheduling.py index 33839bd..ebf4dec 100644 --- a/scheduling.py +++ b/scheduling.py @@ -14,6 +14,7 @@ from Cycles import get_idc_from_idx, get_idx_from_idc from plotting import plot_state +show_plot = False save_plot = False if save_plot: # Create a folder for each run with a timestamp (plot widget) @@ -358,16 +359,16 @@ def update_sequence_and_process_gate( gate_execution_finished = False time_in_pz_counter += 1 - # plot_state(memorygrid.graph, - # [get_idx_from_idc(memorygrid.idc_dict, edge_idc) for edge_idc in memorygrid.ion_chains.values()], - # labels=[ - # "time step %s" % timestep, - # f"seq elem {seq[0]} execution", - # ], - # show_plot=show_plot, - # save_plot=save_plot, - # filename=[plot_filename if save_plot else None][0], - # ) + plot_state(memorygrid.graph, + [get_idx_from_idc(memorygrid.idc_dict, edge_idc) for edge_idc in memorygrid.ion_chains.values()], + labels=[ + "time step %s" % timestep, + f"seq elem {seq[0]} execution", + ], + show_plot=show_plot, + save_plot=save_plot, + filename=[plot_filename if save_plot else None][0], + ) # print time step and gate (gate x out of y) print(f"time step: {timestep}, execution of gate ({memorygrid.seq_length-len(seq)+1}/{memorygrid.seq_length}) on qubit(s) {seq[0]}") @@ -415,14 +416,14 @@ def update_sequence_and_process_gate( for gate_element in seq[0]: new_gate_starting = gate_element in chains_in_parking - # else: - # plot_state(memorygrid.graph, - # [get_idx_from_idc(memorygrid.idc_dict, edge_idc) for edge_idc in memorygrid.ion_chains.values()], - # labels=["time step %s" % timestep, f"next seq elem: {seq[0]}"], - # show_plot=show_plot, - # save_plot=save_plot, - # filename=[plot_filename if save_plot else None][0], - # ) + else: + plot_state(memorygrid.graph, + [get_idx_from_idc(memorygrid.idc_dict, edge_idc) for edge_idc in memorygrid.ion_chains.values()], + labels=["time step %s" % timestep, f"next seq elem: {seq[0]}"], + show_plot=show_plot, + save_plot=save_plot, + filename=[plot_filename if save_plot else None][0], + ) return ( False, @@ -454,7 +455,7 @@ def check_duplicates(lst, memorygrid, parking_idc, max_number_parking): raise AssertionError(message) -def run_simulation(memorygrid, max_timesteps, seq, flat_seq, dag_dep, next_node_initial, max_length, show_plot): +def run_simulation(memorygrid, max_timesteps, seq, flat_seq, dag_dep, next_node_initial, max_length): time_in_pz_counter = 0 next_gate_is_two_qubit_gate = len(seq[0]) == 2 gate_execution_finished = True From 81839f13fd72aacedeec45eaebc863f942a0bdf0 Mon Sep 17 00:00:00 2001 From: Daniel Schoenberger Date: Thu, 14 Nov 2024 17:24:35 +0100 Subject: [PATCH 4/6] first solution --- graph_utils.py | 106 +++------------------------------------------- results.txt | 21 --------- run_benchmarks.py | 20 ++++----- 3 files changed, 16 insertions(+), 131 deletions(-) delete mode 100644 results.txt diff --git a/graph_utils.py b/graph_utils.py index 38411d6..33295f6 100644 --- a/graph_utils.py +++ b/graph_utils.py @@ -1,7 +1,7 @@ import networkx as nx from more_itertools import distinct_combinations, pairwise -global delete_node -delete_node = (3, 4) +# global delete_node +# delete_node = (3, 4) # create dictionary to swap from idx to idc and vice versa def create_idc_dictionary(nx_g): @@ -35,28 +35,6 @@ def order_edges(edge1, edge2): return edge1_in_order, edge2_in_order -# def sort_edges_with_shared_node(edge1, edge2): -# # Extract the nodes from each edge -# nodes1 = set(edge1) -# nodes2 = set(edge2) - -# # Find the shared node -# shared_node = nodes1.intersection(nodes2) - -# # There should be exactly one shared node between the two edges -# if len(shared_node) != 1: -# raise ValueError("Edges do not share exactly one node") - -# shared_node = shared_node.pop() - -# # Determine the non-shared nodes in each edge -# node1 = (nodes1 - {shared_node}).pop() -# node2 = (nodes2 - {shared_node}).pop() - -# # Sort to ensure shared node is in the middle -# sorted_edges = ((node1, shared_node), (shared_node, node2)) -# return sorted_edges - def get_path_to_node(nx_g, src, tar, exclude_exit=False, exclude_first_entry_connection=True): edge_path = [] if exclude_first_entry_connection is True: @@ -134,7 +112,7 @@ def create_graph(self): if self.pz == 'mid': self._remove_mid_part(networkx_graph) nx.set_edge_attributes(networkx_graph, "trap", "edge_type") - self._delete_junction(networkx_graph, delete_node) + #self._delete_junction(networkx_graph, delete_node) return networkx_graph @@ -176,40 +154,7 @@ def _set_junction_nodes(self, networkx_graph): for j in range(0, self.n_extended, self.ion_chain_size_horizontal): networkx_graph.add_node((i, j), node_type="junction_node", color="g") - # def _remove_node(self, networkx_graph, node): - # networkx_graph.remove_node(node) - # for edge in list(networkx_graph.edges(node)): - # networkx_graph.remove_edge(*edge) - def _delete_junction(self, networkx_graph, junction_node): - # # Helper function to traverse and delete edges until another junction - # def remove_edges_until_junction(current_node, previous_node): - # for neighbor in list(networkx_graph.neighbors(current_node)): - # print('neighbor', neighbor) - # print('previous_node', previous_node) - # # Skip the previous node to avoid looping back - # if neighbor == previous_node: - # continue - - # # Check if this neighbor is another junction - # # if neighbor in junction_nodes: - # if ( - # nx.get_node_attributes(networkx_graph, "node_type")[neighbor] - # not in ("junction_node", "exit_node", "exit_connection_node", "entry_node", "entry_connection_node") - # ): - # print('continue') - # continue - - # # Remove the edge to this neighbor - # networkx_graph.remove_edge(current_node, neighbor) - - # # Recursively remove edges from this neighbor - # remove_edges_until_junction(neighbor, current_node) - - # # Traverse from each node connected to the deleted junction - # for neighbor in list(networkx_graph.neighbors(junction_node)): - # remove_edges_until_junction(neighbor, None) - # Remove the junction node networkx_graph.remove_node(junction_node) @@ -256,7 +201,7 @@ def create_graph(self): self._remove_mid_part(networkx_graph) nx.set_edge_attributes(networkx_graph, "trap", "edge_type") self._set_processing_zone(networkx_graph) - self._delete_junction(networkx_graph, delete_node) + #self._delete_junction(networkx_graph, delete_node) return networkx_graph @@ -413,39 +358,9 @@ def _set_processing_zone(self, networkx_graph): networkx_graph.add_edge(self.parking_edge[0], self.parking_edge[1], edge_type="parking_edge", color="g") else: - raise ValueError("pz must be 'mid' or 'outer'") - - # def _remove_node(self, networkx_graph, node): - # networkx_graph.remove_node(node) - # for edge in list(networkx_graph.edges(node)): - # networkx_graph.remove_edge(*edge) + raise ValueError("pz must be 'mid' or 'outer'") def _delete_junction(self, networkx_graph, junction_node): - # # Helper function to traverse and delete edges until another junction - # def remove_edges_until_junction(current_node, previous_node): - # for neighbor in list(networkx_graph.neighbors(current_node)): - # # Skip the previous node to avoid looping back - # if neighbor == previous_node: - # continue - - # # Check if this neighbor is another junction - # # if neighbor in junction_nodes: - # if ( - # nx.get_node_attributes(networkx_graph, "node_type")[neighbor] - # not in ("junction_node", "exit_node", "exit_connection_node", "entry_node", "entry_connection_node") - # ): - # continue - - # # Remove the edge to this neighbor - # networkx_graph.remove_edge(current_node, neighbor) - - # # Recursively remove edges from this neighbor - # remove_edges_until_junction(neighbor, current_node) - - # # Traverse from each node connected to the deleted junction - # for neighbor in list(networkx_graph.neighbors(junction_node)): - # remove_edges_until_junction(neighbor, None) - # Remove the junction node networkx_graph.remove_node(junction_node) @@ -473,13 +388,4 @@ def find_connected_edges(self): # Convert set of tuples to a list of lists connected_edge_pairs = [list(pair) for pair in connected_edge_pairs] - return connected_edge_pairs - - # # Example of how to call this method - # def print_connected_edges(self): - # connected_edges = self.find_connected_edges() - # for edge_pair in connected_edges: - # print(edge_pair) - -# gc = GraphCreator(m=3, n=3, ion_chain_size_vertical=2, ion_chain_size_horizontal=2, pz='mid') -# gc.print_connected_edges() \ No newline at end of file + return connected_edge_pairs \ No newline at end of file diff --git a/results.txt b/results.txt deleted file mode 100644 index a94fd7d..0000000 --- a/results.txt +++ /dev/null @@ -1,21 +0,0 @@ -array ts: [23] -& 3 3 2 2 & 11/22 & 11 & 23.0 & 17.398945808410645 s & Gate Selection=False \\ - -array ts: [27] -& 3 3 2 2 & 10/20 & 10 & 27.0 & 12.028406858444214 s & Gate Selection=False \\ - -array ts: [8] -& 3 3 1 1 & 6/12 & 6 & 8.0 & 0.04474687576293945 s & Gate Selection=True \\ - -array ts: [20] -& 3 3 2 2 & 11/22 & 11 & 20.0 & 61.66305589675903 s & Gate Selection=False \\ - -array ts: [20] -& 3 3 2 2 & 11/22 & 11 & 20.0 & 0.6196222305297852 s & Gate Selection=False \\ - -array ts: [20] -& 3 3 2 2 & 11/22 & 11 & 20.0 & 0.6263039112091064 s & Gate Selection=False \\ - -array ts: [20] -& 3 3 2 2 & 11/22 & 11 & 20.0 & 0.6150369644165039 s & Gate Selection=False \\ - diff --git a/run_benchmarks.py b/run_benchmarks.py index 944be14..f5dc2aa 100644 --- a/run_benchmarks.py +++ b/run_benchmarks.py @@ -81,16 +81,16 @@ def log_results(arch, timestep_arr, cpu_time_arr, number_of_registers, n_of_trap print(cpu_time_mean) print(f"timestep mean: {timestep_mean}, timestep var: {timestep_var}, cpu time mean: {cpu_time_mean}") - file_path = Path("results.txt") - try: - with file_path.open("a") as file: - line = ( - f"& {arch[0]} {arch[1]} {arch[2]} {arch[3]} & {number_of_registers}/{n_of_traps} & {seq_length} " - f"& {timestep_mean} & {cpu_time_mean} s & Gate Selection={compilation} \\\\" - ) - file.write(f"array ts: {timestep_arr}\n" + line + "\n\n") - except: - pass + # file_path = Path("results.txt") + # try: + # with file_path.open("a") as file: + # line = ( + # f"& {arch[0]} {arch[1]} {arch[2]} {arch[3]} & {number_of_registers}/{n_of_traps} & {seq_length} " + # f"& {timestep_mean} & {cpu_time_mean} s & Gate Selection={compilation} \\\\" + # ) + # file.write(f"array ts: {timestep_arr}\n" + line + "\n\n") + # except: + # pass def main(): archs = [ From 8159f1e6f5abffadb4e4175666652b8694f587ce Mon Sep 17 00:00:00 2001 From: Daniel Schoenberger Date: Thu, 14 Nov 2024 17:35:16 +0100 Subject: [PATCH 5/6] first solution --- Cycles.py | 1 - 1 file changed, 1 deletion(-) diff --git a/Cycles.py b/Cycles.py index 7b47b13..7d31106 100644 --- a/Cycles.py +++ b/Cycles.py @@ -1,6 +1,5 @@ import matplotlib.pyplot as plt import networkx as nx -import numpy as np from more_itertools import distinct_combinations, pairwise from graph_utils import get_idc_from_idx, get_idx_from_idc, get_path_to_node, calc_dist_to_pz, order_edges, MZGraphCreator, GraphCreator From 65bd09ac821736fb94ddfdb5397a74b7d25c0493 Mon Sep 17 00:00:00 2001 From: Daniel Schoenberger Date: Thu, 14 Nov 2024 17:57:07 +0100 Subject: [PATCH 6/6] first solution --- __pycache__/Cycles.cpython-311.pyc | Bin 20652 -> 20621 bytes __pycache__/graph_utils.cpython-311.pyc | Bin 26847 -> 26611 bytes __pycache__/scheduling.cpython-311.pyc | Bin 19572 -> 19572 bytes run_heuristic.py | 2 +- 4 files changed, 1 insertion(+), 1 deletion(-) diff --git a/__pycache__/Cycles.cpython-311.pyc b/__pycache__/Cycles.cpython-311.pyc index 886fe1ef1636454db73ef9e97df2d6234bccfbd1..aa3f64190d6ff4694197d6b159c25f273b33cafb 100644 GIT binary patch delta 348 zcmXAl&nrYx9L3+c?|E;2xWgp#qe-tU42djcvQZKXjov~wHw$Wtn44lsp@afPlq?j=%1ZtO8!t|sI_GnC=e&gN68I_SKF!r#OV89zmPeD*ZrRgP zS_)}RLNNSiT^KH7=^AMYQ(D6M<9ga7y}~Pf!YBR0FKb1u9S3!$6*%2cy6meGi3n94a<^g(BSye*h;`Ohy2cE=ERy apz=6fYQUNHy}OUW^}?sRbXwJybN>tD{Act4 delta 416 zcmXX>JxE(o7`^Ad_mby}FENTSK_r4ulfj>Y)J_ElD=lh-;NXQqhgVAR-4GCwQl%gw zRuF3MpokWAFa%w~=TCI7OGOza73$|OO7ry+$g11OG&1z5!CS^vOKcru^fT7ZF-89y!@wjNO(w^@ z3dZyJLdE#84=XhBWEeP97p+D7pxHzO_)2TZsE!itx4q@Kq=wE_9XGVwHObLTPrE1l zNKpPolZF;L?SYOZI`54E)AaXcM8kJ=_v#3%wDygH1_di9J%CrB3bv7#((b diff --git a/__pycache__/graph_utils.cpython-311.pyc b/__pycache__/graph_utils.cpython-311.pyc index 4a9b3d0772341f6e86386e4fded45bdbc3bb3086..d88abfaa05a2fff22c93344d6f1322c2a9a2171c 100644 GIT binary patch delta 3829 zcma)94Qx}_7523q$FURQ#4N;4oH+k+2ni+|fhL(sp@jhp4WVmEJB;J^;y6FHb)QqR z^oP)fb=}k-dbbW0Sj*bA%}O^i53NGoD4MjNY8!My>-4tKXh>bhG$~aW+K{^KeD~$2 zjzU#KzIX4r=bU@)x##D-_ugT%7ubqd^70%e`kkvtmMmmJP)PG}K*DH5G~}qoF>Y7^Xpld&M^#QY>8SnZ%vM2y+$YvLYFL5zk|W5P#Md0PwCfKYn?Jjj76WD;q=#-*M`J0z z4(x^uMlA%Ig}@J!Kxq|Mopo%z=ycXgB_8p#v#Ak^_(s5|RL~&`b795C+n8 znEz$b0A8JSh^dw*(r>POi0wdFWpzs5>z3h|qFYluoaFL~T*j8zO?M23)X|h0S5(EY z0o&`2_#(AUoGm)c?iIJLYN(hr^L@0=agv450^vS_v63(Lh<~p4WcOk9zb28_x=j=o zpLWdHOs=wvb{~h&-z;0upj&Y#nE}x!&U&iY0dd*0o17Q)RvR^=*`Uq_Glg3(8rUJyv`To&PD*W_^rf;6cDGb#Gt^~TEfp`A z4kt|77ER}eu-PMkM+tPMWk$k@l17_!++*T7|6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ad0bf15 100644 GIT binary patch delta 21 bcmew|gYnA@My}<&yj%=GP^-3)E6WD}PIU$Z delta 21 bcmew|gYnA@My}<&yj%=Gpf10WE6WD}Oil%- diff --git a/run_heuristic.py b/run_heuristic.py index 9836995..0da3d47 100644 --- a/run_heuristic.py +++ b/run_heuristic.py @@ -45,7 +45,7 @@ def run_simulation_for_architecture(arch, seeds, pz, max_timesteps, time_1qubit_ memorygrid.distance_map, filename, compilation=compilation ) timestep = run_simulation( - memorygrid, max_timesteps, seq, flat_seq, dag_dep, next_node_initial, max_length=10, show_plot=False + memorygrid, max_timesteps, seq, flat_seq, dag_dep, next_node_initial, max_length=10 ) timestep_arr.append(timestep) cpu_time = time.time() - start_time