Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support IBMBackend.run() #1138

Merged
merged 70 commits into from
Nov 7, 2023
Merged
Changes from 4 commits
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
2ff792e
initial support for backend.run()
merav-aharoni Oct 9, 2023
c877f1e
Added temporary session support
merav-aharoni Oct 9, 2023
cb4c0b0
Merge branch 'main' into backend_run
merav-aharoni Oct 9, 2023
af9f907
Copied test_backend.py from the provider
merav-aharoni Oct 10, 2023
7ce7531
Merge branch 'main' of github.com:merav-aharoni/qiskit-ibm-runtime in…
merav-aharoni Oct 10, 2023
cc6d58a
Merge branch 'backend_run' of github.com:merav-aharoni/qiskit-ibm-run…
merav-aharoni Oct 10, 2023
7867c17
Added all status types from the provider
merav-aharoni Oct 10, 2023
0c4e0cb
Added test_ibm_job_states.py from provider. Added 'transpiler' direct…
merav-aharoni Oct 10, 2023
17c4ec2
lint
merav-aharoni Oct 10, 2023
7b9f6cc
black
merav-aharoni Oct 10, 2023
aab2a87
lint
merav-aharoni Oct 10, 2023
71cb86d
Added integration tests from the provider
merav-aharoni Oct 12, 2023
0878511
Merge branch 'main' into backend_run
merav-aharoni Oct 12, 2023
d0a5a5b
added test_ibm_job and made necessary changes
merav-aharoni Oct 15, 2023
e99cd2e
Merge branch 'backend_run' of github.com:merav-aharoni/qiskit-ibm-run…
merav-aharoni Oct 15, 2023
8ca95c5
Fixed several tests
merav-aharoni Oct 16, 2023
b17413b
Fixed missing job methods in test
merav-aharoni Oct 16, 2023
2a95e9b
Changed exception type
merav-aharoni Oct 16, 2023
40917a4
Added test_ibm_job_attributes.py
merav-aharoni Oct 16, 2023
d117151
Added test_ibm_job_attributes.py that was missed in previous commit
merav-aharoni Oct 17, 2023
e72524d
Added test class TestBackendRunInSession for backend.run with session
merav-aharoni Oct 17, 2023
03c8fb8
Cleaning up code
merav-aharoni Oct 17, 2023
ac1e464
lint, added missing parameter
merav-aharoni Oct 17, 2023
e5ac535
Merge branch 'main' into backend_run
merav-aharoni Oct 17, 2023
ef7b314
Merge branch 'main' into backend_run
merav-aharoni Oct 19, 2023
535c875
Added more tests from qiskit-ibm-provider
merav-aharoni Oct 19, 2023
f173124
Inherit from BaseQiskitTestCase
merav-aharoni Oct 19, 2023
21103e6
Merge branch 'backend_run' of github.com:merav-aharoni/qiskit-ibm-run…
merav-aharoni Oct 19, 2023
757af8e
Enabled several tests
merav-aharoni Oct 19, 2023
862723e
removed method _deprecate_id_instruction
merav-aharoni Oct 22, 2023
3697ec3
lint, unused imports
merav-aharoni Oct 22, 2023
373ace1
Merge branch 'main' into backend_run
merav-aharoni Oct 22, 2023
b74f848
Merge branch 'main' into backend_run
kt474 Oct 24, 2023
b9dcf5e
Merge branch 'main' into backend_run
merav-aharoni Oct 26, 2023
e98456b
Removed instance parameter from tests with backend.run()
merav-aharoni Oct 26, 2023
3806d0a
Removed instance from decorator
merav-aharoni Oct 26, 2023
191837e
Changed test to run on quantum channel only
merav-aharoni Oct 26, 2023
ddcc326
Removed instance parameter when getting backend
merav-aharoni Oct 26, 2023
2f24d01
lint
merav-aharoni Oct 26, 2023
f900340
Copied transpiler directory from the provider
merav-aharoni Oct 26, 2023
60c5ecd
black
merav-aharoni Oct 26, 2023
c3b8b79
Merge branch 'main' into backend_run
merav-aharoni Oct 26, 2023
5906284
fix more tests
kt474 Oct 27, 2023
9b8d4aa
update test_session
kt474 Oct 27, 2023
064a8c0
added tranpiler passes entry point
merav-aharoni Oct 29, 2023
f53e227
Merge branch 'backend_run' of github.com:merav-aharoni/qiskit-ibm-run…
merav-aharoni Oct 29, 2023
15daa81
Merge branch 'main' into backend_run
merav-aharoni Oct 29, 2023
7d1c885
Removed obsolete JobStatus types, and removed the tests that were che…
merav-aharoni Oct 29, 2023
99c27f0
Removed unnecessary check
merav-aharoni Oct 29, 2023
37f2bf1
Merge branch 'backend_run' of github.com:merav-aharoni/qiskit-ibm-run…
merav-aharoni Oct 29, 2023
ebf5647
Removed exception parameter from validate_job_tags. Use 'import_job_t…
merav-aharoni Oct 29, 2023
349e12d
Put back the check if circuit is indeed of type 'QuantumCircuit'. Upd…
merav-aharoni Oct 29, 2023
db9afb4
Update qiskit_ibm_runtime/ibm_backend.py
merav-aharoni Oct 31, 2023
7bb3447
Cleaned up code involving session setup
merav-aharoni Oct 31, 2023
bdbcdae
Removed setting of 'skip_transpilation' because set by default by Qasm3
merav-aharoni Oct 31, 2023
c13d879
Replaced in path 'qiskit-ibm-provider' with 'qiskit-ibm-runtime'.
merav-aharoni Oct 31, 2023
9f9c099
Added None to get() statement
merav-aharoni Oct 31, 2023
bd10133
Merge branch 'main' into backend_run
kt474 Oct 31, 2023
f3b295e
Merge branch 'main' into backend_run
merav-aharoni Nov 2, 2023
b78acfc
Changed warning to error when init_circuit is boolean
merav-aharoni Nov 6, 2023
7a53693
Merge branch 'backend_run' of github.com:merav-aharoni/qiskit-ibm-run…
merav-aharoni Nov 6, 2023
f85c85c
Merge branch 'main' into backend_run
merav-aharoni Nov 6, 2023
c004bbb
Fixed setting of start_session
merav-aharoni Nov 6, 2023
e6022c2
Removed max_time parameter, because wasn't reaching the server.
merav-aharoni Nov 6, 2023
db9534c
Merge branch 'main' into backend_run
kt474 Nov 6, 2023
7dbe1d4
Release note
merav-aharoni Nov 7, 2023
4edc1d4
Merge branch 'backend_run' of github.com:merav-aharoni/qiskit-ibm-run…
merav-aharoni Nov 7, 2023
9c71052
Merge branch 'main' into backend_run
merav-aharoni Nov 7, 2023
47c5ceb
Merge branch 'main' into backend_run
kt474 Nov 7, 2023
12fa82f
address comment
kt474 Nov 7, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion qiskit_ibm_runtime/ibm_backend.py
Original file line number Diff line number Diff line change
@@ -752,7 +752,9 @@ def _runtime_run(
image: Optional[str] = None,
) -> RuntimeJob:
"""Runs the runtime program and returns the corresponding job object"""
hgp_name = self._instance or self._service._get_hgp().name
hgp_name = None
if self._service._channel == "ibm_quantum":
hgp_name = self._instance or self._service._get_hgp().name

session = self._session

6 changes: 4 additions & 2 deletions test/integration/test_backend.py
Original file line number Diff line number Diff line change
@@ -82,7 +82,7 @@ def setUpClass(cls):
super().setUpClass()
if cls.dependencies.channel == "ibm_cloud":
# TODO use real device when cloud supports it
cls.backend = cls.dependencies.service.least_busy(min_num_qubits=5)
cls.backend = cls.dependencies.service.least_busy(simulator=False, min_num_qubits=5)
if cls.dependencies.channel == "ibm_quantum":
cls.backend = cls.dependencies.service.least_busy(
simulator=False, min_num_qubits=5, instance=cls.dependencies.instance
@@ -234,9 +234,11 @@ def test_paused_backend_warning(self):
with self.assertWarns(Warning):
backend.run(ReferenceCircuits.bell())

@quantum_only
def test_backend_wrong_instance(self):
"""Test that an error is raised when retrieving a backend not in the instance."""
if self.dependencies.channel == "ibm_cloud":
raise SkipTest("Cloud channel does not have instance.")

backends = self.service.backends()
hgps = self.service._hgps.values()
if len(hgps) >= 2:
1 change: 1 addition & 0 deletions test/integration/test_session.py
Original file line number Diff line number Diff line change
@@ -120,6 +120,7 @@ def test_backend_run_with_session(self):
backend = self.service.backend("ibmq_qasm_simulator")
backend.open_session()
result = backend.run(circuits=ReferenceCircuits.bell(), shots=shots).result()
backend.cancel_session()
self.assertIsInstance(result, Result)
self.assertEqual(result.results[0].shots, shots)
self.assertAlmostEqual(
Loading