Skip to content

Commit

Permalink
Removed deepcopy dependences in my_benchmark_execution.py files
Browse files Browse the repository at this point in the history
  • Loading branch information
gonfeco committed Apr 3, 2024
1 parent 5d3d42f commit 6cc6e63
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions tnbs/BTC_01_PL/my_benchmark_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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")

Expand Down Expand Up @@ -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
}
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tnbs/BTC_03_QPE/my_benchmark_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import sys
from datetime import datetime
from copy import deepcopy
import numpy as np
import pandas as pd

Expand Down Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions tnbs/BTC_04_PH/my_benchmark_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import ast
import logging
from datetime import datetime
from copy import deepcopy
import pandas as pd

l_sys = sys.path
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand All @@ -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,
Expand Down

0 comments on commit 6cc6e63

Please sign in to comment.