Skip to content

Commit

Permalink
Use new Session.from_id() method in qiskit-ibm-runtime (#421)
Browse files Browse the repository at this point in the history
* Use new `Session.from_id()` method in qiskit-ibm-runtime

* Bump qiskit & qiskit-ibm-runtime versions

qiskit-ibm-runtime depends on qiskit>0.44.1, so we are forced to
bump qiskit as well for the minimum version tests to pass.

* Bump rustworkx version

rustworkx 0.13 is required by qiskit 0.44.1
  • Loading branch information
garrison authored Nov 7, 2023
1 parent 0ed06fe commit d855eac
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![Release](https://img.shields.io/pypi/v/circuit-knitting-toolbox.svg?label=Release)](https://github.com/Qiskit-Extensions/circuit-knitting-toolbox/releases)
![Platform](https://img.shields.io/badge/%F0%9F%92%BB%20Platform-Linux%20%7C%20macOS%20%7C%20Windows-informational)
[![Python](https://img.shields.io/pypi/pyversions/circuit-knitting-toolbox?label=Python&logo=python)](https://www.python.org/)
[![Qiskit](https://img.shields.io/badge/Qiskit-%E2%89%A5%200.43.0-6133BD?logo=qiskit)](https://github.com/Qiskit/qiskit)
[![Qiskit](https://img.shields.io/badge/Qiskit-%E2%89%A5%200.44.1-6133BD?logo=qiskit)](https://github.com/Qiskit/qiskit)
[![Qiskit Nature](https://img.shields.io/badge/Qiskit%20Nature-%E2%89%A5%200.6.0-6133BD?logo=qiskit)](https://github.com/Qiskit/qiskit-nature)
<br />
[![Docs (stable)](https://img.shields.io/badge/%F0%9F%93%84%20Docs-stable-blue.svg)](https://qiskit-extensions.github.io/circuit-knitting-toolbox/)
Expand Down
8 changes: 4 additions & 4 deletions circuit_knitting/forging/entanglement_forging_knitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,9 @@ def close_sessions(self) -> None:
f"There was a problem closing session id ({session_id}). "
"No backend to associate with session."
)
session = Session(service=self.service, backend=self._backend_names[i])
session._session_id = session_id
session = Session.from_id(
session_id, service=self.service, backend=self._backend_names[i]
)
session.close()

return
Expand Down Expand Up @@ -658,8 +659,7 @@ def _estimate_expvals(
"If passing a QiskitRuntimeService, a list of backend names must be specified."
)
service = QiskitRuntimeService(**service_args)
session = Session(service=service, backend=backend_name)
session._session_id = session_id
session = Session.from_id(session_id, service=service, backend=backend_name)
estimator = Estimator(session=session, options=options)

job = estimator.run(
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ requires-python = ">=3.8"
dependencies = [
"numpy>=1.23.0",
"scipy>=1.5.2",
"rustworkx>=0.12.0",
"rustworkx>=0.13.0",
"qiskit-aer>=0.12.0",
"qiskit>=0.43.0",
"qiskit>=0.44.1",
"qiskit-algorithms>=0.2.1",
"qiskit-nature>=0.6.0, <0.7",
"qiskit-ibm-runtime>=0.9.2",
"qiskit-ibm-runtime>=0.12.2",
]

[project.optional-dependencies]
Expand Down
5 changes: 5 additions & 0 deletions releasenotes/notes/qiskit-0.44-required-5eec7abe45b88ecc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
upgrade:
- |
The minimum supported version of ``qiskit`` is now 0.44.1, and the
minimum supported version of ``qiskit-ibm-runtime`` is now 0.12.2.

0 comments on commit d855eac

Please sign in to comment.