Skip to content

Commit

Permalink
expand data from the benchmarking
Browse files Browse the repository at this point in the history
  • Loading branch information
danlkv committed Feb 8, 2024
1 parent 0987cd3 commit ca06c62
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions qtensor/tools/benchmarking/simulators.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,20 +162,21 @@ def optimize_qaoa_energy(self, G, p,
opt_time = 0
ests = []
opts = []
times = []
for edge in self.iterate_edges(G, p):
with profiles.timing() as t:
circuit = sim._edge_energy_circuit(G, gamma, beta, edge)
tn = qtensor.optimisation.TensorNet.QtreeTensorNet.from_qtree_gates(circuit)
peo, _ = opt.optimize(tn)
opt_time += t.result
times.append(t.result)
mems, flops = tn.simulation_cost(peo)
ests.append(ContractionEstimation(
width=opt.treewidth,
mems=16*max(mems),
flops=sum(flops)
))
opts.append(peo)
return opts, ests, opt_time
return opts, ests, times

def simulate_qaoa_energy(self, G, p, opt):
gamma, beta = get_test_gamma_beta(p)
Expand Down Expand Up @@ -437,7 +438,7 @@ def optimize_qaoa_energy(self, G, p, opt_type=None,
infos.append((rehs['info'], rehs['tn']))
ests.append(self._rehs2est(rehs))

return infos, ests, sum(times)
return infos, ests, times


def simulate_qaoa_energy(self, G, p, opts,
Expand Down

0 comments on commit ca06c62

Please sign in to comment.