From c2599f38792a704aba207246c121f5f15e376b30 Mon Sep 17 00:00:00 2001 From: Valentin Senicourt Date: Tue, 10 Jan 2023 19:54:51 -0800 Subject: [PATCH 1/2] Fix import for latest version of qiskit / qiskit-runtime --- tangelo/linq/qpu_connection/ibm_connection.py | 4 ++-- tangelo/linq/tests/test_ibm_connection.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tangelo/linq/qpu_connection/ibm_connection.py b/tangelo/linq/qpu_connection/ibm_connection.py index 06937d31e..e83461002 100644 --- a/tangelo/linq/qpu_connection/ibm_connection.py +++ b/tangelo/linq/qpu_connection/ibm_connection.py @@ -10,8 +10,8 @@ try: from qiskit.providers.jobstatus import JobStatus - from qiskit_ibm_runtime import QiskitRuntimeService, Sampler, Estimator, Session, Options, \ - SamplerResult, EstimatorResult + from qiskit.primitives import SamplerResult, EstimatorResult + from qiskit_ibm_runtime import QiskitRuntimeService, Sampler, Estimator, Session, Options is_qiskit_installed = True except ModuleNotFoundError: is_qiskit_installed = False diff --git a/tangelo/linq/tests/test_ibm_connection.py b/tangelo/linq/tests/test_ibm_connection.py index 67672dabf..2dc5454cf 100644 --- a/tangelo/linq/tests/test_ibm_connection.py +++ b/tangelo/linq/tests/test_ibm_connection.py @@ -24,7 +24,7 @@ sim = get_backend() ref_estimator = sim.get_expectation_value(op, circ2) -os.environ['IBM_TOKEN'] = 'insert valid token' +os.environ['IBM_TOKEN'] = 'INSERT VALID TOKEN HERE FOR TESTS. REMOVE AFTERWARDS' @unittest.skip("We do not want to store login information for automated testing. Manual testing only.") From f829c3774cc9d454fd5c702f47bcde70c59fe906 Mon Sep 17 00:00:00 2001 From: Valentin Senicourt <41597680+ValentinS4t1qbit@users.noreply.github.com> Date: Wed, 11 Jan 2023 14:56:12 -0800 Subject: [PATCH 2/2] Update test_ibm_connection.py small change to update PR and see if automated tests run. --- tangelo/linq/tests/test_ibm_connection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tangelo/linq/tests/test_ibm_connection.py b/tangelo/linq/tests/test_ibm_connection.py index 2dc5454cf..fdbadf07f 100644 --- a/tangelo/linq/tests/test_ibm_connection.py +++ b/tangelo/linq/tests/test_ibm_connection.py @@ -24,7 +24,7 @@ sim = get_backend() ref_estimator = sim.get_expectation_value(op, circ2) -os.environ['IBM_TOKEN'] = 'INSERT VALID TOKEN HERE FOR TESTS. REMOVE AFTERWARDS' +os.environ['IBM_TOKEN'] = 'INSERT VALID TOKEN HERE, FOR TESTS. REMOVE AFTERWARDS' @unittest.skip("We do not want to store login information for automated testing. Manual testing only.")