From c78c30323b7fa6309cdde2fc1c6d9b89baf55091 Mon Sep 17 00:00:00 2001 From: Miguel Dias Costa Date: Wed, 31 Jan 2024 18:00:47 +0800 Subject: [PATCH] use del as a statement instead of a method --- benchmarks/scripts.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/benchmarks/scripts.py b/benchmarks/scripts.py index 01db305..a1cb2cf 100644 --- a/benchmarks/scripts.py +++ b/benchmarks/scripts.py @@ -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): @@ -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, @@ -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") @@ -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):