Skip to content

Commit

Permalink
Refactoring BTC_04_PH/PH library
Browse files Browse the repository at this point in the history
  • Loading branch information
gonfeco committed May 30, 2024
1 parent f02f23c commit 8e9a885
Show file tree
Hide file tree
Showing 53 changed files with 3,616 additions and 680 deletions.
27 changes: 24 additions & 3 deletions tests/test_btc_04_ph.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,30 @@
sys.path.append(l_path)
sys.path.append(l_path+"BTC_04_PH")
from BTC_04_PH.my_benchmark_execution import KERNEL_BENCHMARK
from get_qpu import get_qpu
from BTC_04_PH.PH.qpu.select_qpu import select_qpu

# Naive qpu configuration
qpu_conf = {
"qpu_type": "c",
"t_gate_1qb" : None,
"t_gate_2qbs" : None,
"t_readout": None,
"depol_channel" : {
"active": False,
"error_gate_1qb" : None,
"error_gate_2qbs" : None
},
"idle" : {
"amplitude_damping": False,
"dephasing_channel": False,
"t1" : None,
"t2" : None
},
"meas": {
"active":False,
"readout_error": None
}
}

def create_folder(folder_name):
"""
Expand Down Expand Up @@ -55,7 +77,6 @@ def test_ph():
"depth": depth,
"t_inv": True,
# Ground State Energy
"qpu_ph" : qpu_ph,
"nb_shots" : nb_shots,
"truncation": truncation,
# Saving
Expand All @@ -65,7 +86,7 @@ def test_ph():
"gse_error" : None,
"time_error": None,
}
kernel_configuration.update({"qpu_ph": get_qpu(kernel_configuration["qpu_ph"])})
kernel_configuration.update({"qpu_ph": select_qpu(qpu_conf)})

list_of_qbits = [3]
benchmark_arguments = {
Expand Down
7 changes: 3 additions & 4 deletions tnbs/BTC_01_PL/PL/notebooks/01_ProbabilityLoadingKernel.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"\n",
"$$\\newcommand{\\braket}[2]{\\left\\langle{#1}\\middle|{#2}\\right\\rangle}$$\n",
"$$\\newcommand{\\ket}[1]{\\left|{#1}\\right\\rangle}$$\n",
"$$\\newcommand{\\bra}[1]{\\left\\langle{#1}\\right|}$$\n",
"\n"
"$$\\newcommand{\\bra}[1]{\\left\\langle{#1}\\right|}$$\n"
]
},
{
Expand Down Expand Up @@ -78,7 +77,7 @@
"qpu_config = {\n",
" #the following strings can be used:\n",
" #c,python, linalg, mps, qlmass_linalg, qlmass_mps\n",
" \"qpu_type\": ideal_qpus[2], \n",
" \"qpu_type\": ideal_qpus[0], \n",
" # The following keys are used for configuring noisy simulations\n",
" \"t_gate_1qb\" : None,\n",
" \"t_gate_2qbs\" : None,\n",
Expand Down Expand Up @@ -909,7 +908,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.16"
"version": "3.9.9"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit 8e9a885

Please sign in to comment.