From f6e75d11895ebca74a356d106ec5b9fe5d6516f9 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Fri, 16 Feb 2024 16:48:20 -0500 Subject: [PATCH 1/3] Update tests for Qiskit 1.0 This commit updates the execute tests to remove the use of execute() which was removed in Qiskit 1.0 after being deprecated in 0.46. How this managed to merge, I'm not entirely clear on because it should have failed CI on the removal PR, so there is likely a configuration issue in the neko custom action as well that will need to be fixed. --- qiskit_neko/tests/circuits/test_execute.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/qiskit_neko/tests/circuits/test_execute.py b/qiskit_neko/tests/circuits/test_execute.py index 87c93ab..67da338 100644 --- a/qiskit_neko/tests/circuits/test_execute.py +++ b/qiskit_neko/tests/circuits/test_execute.py @@ -15,7 +15,7 @@ import math from qiskit.circuit import QuantumCircuit -from qiskit import execute +from qiskit import transpile from qiskit_neko import decorators from qiskit_neko.tests import base @@ -40,7 +40,7 @@ def test_bell_execute_fixed_shots(self): circuit.h(0) circuit.cx(0, 1) circuit.measure_all() - job = execute(circuit, self.backend, shots=100) + job = self.backend.run(transpile(circuit, self.backend), shots=100) result = job.result() counts = result.get_counts() self.assertDictAlmostEqual(counts, {"00": 50, "11": 50}, delta=10) @@ -53,7 +53,7 @@ def test_bell_execute_default_shots(self): circuit.cx(0, 1) circuit.measure_all() expected_count = self.backend.options.shots / 2 - job = execute(circuit, self.backend) + job = self.backends.run(transpile(circuit, self.backend)) result = job.result() counts = result.get_counts() delta = 10 ** (math.log10(self.backend.options.shots) - 1) @@ -69,7 +69,7 @@ def test_bell_execute_backend_shots_set_options(self): circuit.cx(0, 1) circuit.measure_all() self.backend.set_options(shots=100) - job = execute(circuit, self.backend) + job = self.backend.run(transpile(circuit, self.backend)) result = job.result() counts = result.get_counts() self.assertDictAlmostEqual(counts, {"00": 50, "11": 50}, delta=10) From 5d4e38f722573860e0190084afc830b02749f714 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Fri, 16 Feb 2024 17:43:59 -0500 Subject: [PATCH 2/3] Fix fake provider usage --- qiskit_neko/aer_plugin.py | 2 +- requirements.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/qiskit_neko/aer_plugin.py b/qiskit_neko/aer_plugin.py index 8623499..981795a 100644 --- a/qiskit_neko/aer_plugin.py +++ b/qiskit_neko/aer_plugin.py @@ -13,7 +13,7 @@ """Qiskit Aer default backend plugin.""" import qiskit_aer as aer -from qiskit.providers import fake_provider +from qiskit_ibm_runtime import fake_provider from qiskit_neko import backend_plugin diff --git a/requirements.txt b/requirements.txt index 67cee99..77384a7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,6 +4,7 @@ qiskit-aer qiskit-nature[pyscf] qiskit-experiments qiskit-machine-learning +qiskit-ibm-runtime>=0.19 stestr>=3.2.0 testtools>=2.5.0 fixtures>=3.0.0 From 9aa2bc57678b4bb55b04b49a290b80266868f078 Mon Sep 17 00:00:00 2001 From: Matthew Treinish Date: Fri, 23 Feb 2024 07:39:38 -0500 Subject: [PATCH 3/3] Fix typo --- qiskit_neko/tests/circuits/test_execute.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qiskit_neko/tests/circuits/test_execute.py b/qiskit_neko/tests/circuits/test_execute.py index 67da338..75004bf 100644 --- a/qiskit_neko/tests/circuits/test_execute.py +++ b/qiskit_neko/tests/circuits/test_execute.py @@ -53,7 +53,7 @@ def test_bell_execute_default_shots(self): circuit.cx(0, 1) circuit.measure_all() expected_count = self.backend.options.shots / 2 - job = self.backends.run(transpile(circuit, self.backend)) + job = self.backend.run(transpile(circuit, self.backend)) result = job.result() counts = result.get_counts() delta = 10 ** (math.log10(self.backend.options.shots) - 1)