Skip to content

Commit

Permalink
use del as a statement instead of a method
Browse files Browse the repository at this point in the history
  • Loading branch information
migueldiascosta committed Jan 31, 2024
1 parent 0995870 commit c78c303
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions benchmarks/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ def circuit_benchmark(nqubits, backend, circuit_name, circuit_options=None,
result = result.numpy()
logs.log(dry_run_transfer_time=time.time() - start_time)
dtype = str(result.state().dtype)
del(result)
del(circuit)
del result
del circuit

creation_times, simulation_times, transfer_times = [], [], []
for _ in range(nreps):
Expand All @@ -74,8 +74,8 @@ def circuit_benchmark(nqubits, backend, circuit_name, circuit_options=None,
if transfer:
result = result.numpy()
transfer_times.append(time.time() - start_time)
del(result)
del(circuit)
del result
del circuit

logs.log(dtype=dtype, creation_times=creation_times,
simulation_times=simulation_times,
Expand Down Expand Up @@ -131,14 +131,14 @@ def library_benchmark(nqubits, library, circuit_name, circuit_options=None,
result = backend(circuit)
logs.log(dry_run_time=time.time() - start_time)
dtype = str(result.dtype)
del(result)
del result

simulation_times = []
for _ in range(nreps):
start_time = time.time()
result = backend(circuit)
simulation_times.append(time.time() - start_time)
del(result)
del result

logs.log(dtype=dtype, simulation_times=simulation_times)
logs.average("simulation_times")
Expand Down Expand Up @@ -180,7 +180,7 @@ def evolution_benchmark(nqubits, dt, solver, backend, platform=None,
result = evolution(final_time=1.0)
logs.log(dry_run_time=time.time() - start_time)
dtype = str(result.dtype)
del(result)
del result

simulation_times = []
for _ in range(nreps):
Expand Down

0 comments on commit c78c303

Please sign in to comment.