diff --git a/src/qututor/H2_VQE/host.py b/src/qututor/H2_VQE/host.py index 639d67c6209fb2e54f2b7df17a797535932958a9..5dcc9d72dd77677bd4c7c701bf8097da4c9301d3 100644 --- a/src/qututor/H2_VQE/host.py +++ b/src/qututor/H2_VQE/host.py @@ -129,7 +129,7 @@ def get_ansatz(circ_name, theta): task = Quingo_task(qu_file, circ_name) qasm_file = compile(task, (theta,), config_file=cfg_file) res = execute(qasm_file, BackendType.QUANTUM_SIM, ExeConfig(ExeMode.SimStateVector)) - return [i for i in res["quantum"][1]] + return res[1] def get_real(c): diff --git a/src/qututor/bell/test_bell.py b/src/qututor/bell/test_bell.py index 162533eb2cd4b9a0c9ba3513745aa9abddc7a1c2..e3a6c51c18a72632ed40045b6765269ed05922c5 100644 --- a/src/qututor/bell/test_bell.py +++ b/src/qututor/bell/test_bell.py @@ -11,7 +11,7 @@ class Test_Bell: def test_bell(self): task = Quingo_task(qu_file, circ_name) num_shots = 10 - cfg = ExeConfig(ExeMode.SimFinalResult, num_shots) + cfg = ExeConfig(ExeMode.SimShots, num_shots) res = call(task, (), BackendType.QUANTUM_SIM, cfg) assert len(res[0]) == 2 assert len(res[1]) == num_shots diff --git a/src/qututor/classical_tools/test_utils.py b/src/qututor/classical_tools/test_utils.py index 932794aa23489acbe93c5f3f8b298575a29a9253..a3bba58e1a97eaece6c5427c9f8e212f4bc1acf2 100644 --- a/src/qututor/classical_tools/test_utils.py +++ b/src/qututor/classical_tools/test_utils.py @@ -11,7 +11,7 @@ class Test_Utils: def test_individual(self): circ_name = "get_bin" task = Quingo_task(kernel_file, circ_name, qisa=Qisa.QCIS) - cfg = ExeConfig(ExeMode.SimFinalResult, 1) + cfg = ExeConfig(ExeMode.SimShots, 1) for i in range(7): res = call( task, diff --git a/src/qututor/ghz/test_ghz.py b/src/qututor/ghz/test_ghz.py index 3c4acb90761e6c4d9e9286a316193b4b363e86b6..482cff77cb0c6327a2251b6a1a2e2c4fe1750b5c 100644 --- a/src/qututor/ghz/test_ghz.py +++ b/src/qututor/ghz/test_ghz.py @@ -10,7 +10,7 @@ class Test_GHZ: num_qubits = 3 num_shots = 10 task = Quingo_task(qu_file, circ_name) - cfg = ExeConfig(ExeMode.SimFinalResult, num_shots) + cfg = ExeConfig(ExeMode.SimShots, num_shots) res = call(task, (num_qubits,), BackendType.TEQUILA, cfg) assert len(res[0]) == num_qubits assert len(res[1]) == num_shots diff --git a/src/qututor/grover/test_grover.py b/src/qututor/grover/test_grover.py index 27d4a57c3ba3585c5ec2cfef4d72b6248c61e79e..28fb8e738d34df747ff68fdba996963d0f66eecb 100644 --- a/src/qututor/grover/test_grover.py +++ b/src/qututor/grover/test_grover.py @@ -11,7 +11,7 @@ class Test_Grover: def test_grover(self): task = Quingo_task(qu_file, circ_name) num_shots = 1 - cfg = ExeConfig(ExeMode.SimFinalResult, num_shots) + cfg = ExeConfig(ExeMode.SimShots, num_shots) res = call(task, (), BackendType.QUANTUM_SIM, cfg) assert len(res[0]) == 2 assert len(res[1]) == num_shots diff --git a/src/qututor/qft/test_qft_bb.py b/src/qututor/qft/test_qft_bb.py index eeea3eca24b5f7bfa520fd06c43b8c3e54ec9530..bb2e1c503f40d74bb2d1ac9030e393023309fcbe 100644 --- a/src/qututor/qft/test_qft_bb.py +++ b/src/qututor/qft/test_qft_bb.py @@ -37,7 +37,7 @@ def get_first_non_zero_res(qcis_result): return to_int(msmt_count[0]) -cfg = ExeConfig(ExeMode.SimFinalResult, 1) +cfg = ExeConfig(ExeMode.SimShots, 1) class Test_QFT_BB: @@ -48,13 +48,18 @@ class Test_QFT_BB: blist = [int(b) for b in str_bin] print("input :", str_bin) blist.reverse() + # Specifying ISA as QUIET-S by + # task = Quingo_task(qu_file, "test_qft_bb", qisa=Qisa.QUIET) task = Quingo_task(qu_file, "test_qft_bb", qisa=Qisa.QCIS) res = call( task, (blist,), + # To simulate QUIET-S assembly, use QualeSim backend + # BackendType.QUALESIM_QUANTUMSIM, BackendType.QUANTUM_SIM, cfg, ) + print(res) k = get_first_non_zero_res(res) assert k == i