From 6cc6e63acc82491c960f16b0e904d47eec0e9035 Mon Sep 17 00:00:00 2001 From: gonfeco Date: Wed, 3 Apr 2024 19:51:58 +0200 Subject: [PATCH] Removed deepcopy dependences in my_benchmark_execution.py files --- tnbs/BTC_01_PL/my_benchmark_execution.py | 8 ++++---- tnbs/BTC_03_QPE/my_benchmark_execution.py | 4 ++-- tnbs/BTC_04_PH/my_benchmark_execution.py | 14 +++++++------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tnbs/BTC_01_PL/my_benchmark_execution.py b/tnbs/BTC_01_PL/my_benchmark_execution.py index 978be27..365fc59 100644 --- a/tnbs/BTC_01_PL/my_benchmark_execution.py +++ b/tnbs/BTC_01_PL/my_benchmark_execution.py @@ -6,7 +6,7 @@ import sys import json from datetime import datetime -from copy import deepcopy +# from copy import deepcopy import pandas as pd from get_qpu import get_qpu @@ -60,7 +60,7 @@ def run_code(iterator_step, repetitions, stage_bench, **kwargs): raise ValueError("repetitions CAN NOT BE None") #Here the code for configuring and execute the benchmark kernel - kernel_configuration = deepcopy(kwargs.get("kernel_configuration", None)) + kernel_configuration = kwargs.get("kernel_configuration", None) if kernel_configuration is None: raise ValueError("kernel_configuration can not be None") @@ -297,7 +297,7 @@ def exe(self): kernel_configuration = { "load_method" : "multiplexor", - "qpu" : "linalg", #"c", python, qlmass, default + "qpu" : "c", #"c", python, qlmass, default "relative_error": None, "absolute_error": None } @@ -319,7 +319,7 @@ def exe(self): "min_meas": None, "max_meas": None, #List number of qubits tested - "list_of_qbits": [4, 6, 8, 10], + "list_of_qbits": [4], } # Selecting the QPU diff --git a/tnbs/BTC_03_QPE/my_benchmark_execution.py b/tnbs/BTC_03_QPE/my_benchmark_execution.py index bf14270..77bc825 100644 --- a/tnbs/BTC_03_QPE/my_benchmark_execution.py +++ b/tnbs/BTC_03_QPE/my_benchmark_execution.py @@ -4,7 +4,6 @@ import sys from datetime import datetime -from copy import deepcopy import numpy as np import pandas as pd @@ -65,7 +64,8 @@ def run_code(iterator_step, repetitions, stage_bench, **kwargs): raise ValueError("samples CAN NOT BE None") #Here the code for configuring and execute the benchmark kernel - kernel_configuration_ = deepcopy(kwargs.get("kernel_configuration", None)) + #kernel_configuration_ = deepcopy(kwargs.get("kernel_configuration", None)) + kernel_configuration_ = kwargs.get("kernel_configuration", None) if kernel_configuration_ is None: raise ValueError("kernel_configuration can not be None") # Here we built the dictionary for the QPE_RZ class diff --git a/tnbs/BTC_04_PH/my_benchmark_execution.py b/tnbs/BTC_04_PH/my_benchmark_execution.py index cf55d0d..5124d5b 100644 --- a/tnbs/BTC_04_PH/my_benchmark_execution.py +++ b/tnbs/BTC_04_PH/my_benchmark_execution.py @@ -7,7 +7,6 @@ import ast import logging from datetime import datetime -from copy import deepcopy import pandas as pd l_sys = sys.path @@ -73,10 +72,11 @@ def run_code(iterator_step, repetitions, stage_bench, **kwargs): if repetitions is None: raise ValueError("samples CAN NOT BE None") #Here the code for configuring and execute the benchmark kernel - kernel_configuration = deepcopy(kwargs.get("kernel_configuration", None)) - del kernel_configuration["gse_error"] - del kernel_configuration["time_error"] - del kernel_configuration["depth"] + #kernel_configuration = deepcopy(kwargs.get("kernel_configuration", None)) + kernel_configuration = kwargs.get("kernel_configuration", None) + #del kernel_configuration["gse_error"] + #del kernel_configuration["time_error"] + #del kernel_configuration["depth"] if kernel_configuration is None: raise ValueError("kernel_configuration can not be None") # Configuring kernel @@ -368,7 +368,7 @@ def exe(self): from get_qpu import get_qpu #Anstaz depth = [1] - qpu_ph = "c" + qpu_ph = "c" #qlmass_linalg, python, c, linalg nb_shots = 0 truncation = None @@ -389,7 +389,7 @@ def exe(self): "time_error": None, } - list_of_qbits = list(range(3, 9)) + list_of_qbits = list(range(3, 4)) benchmark_arguments = { #Pre benchmark sttuff "pre_benchmark": True,