Skip to content

Commit

Permalink
Session doc changes (#594)
Browse files Browse the repository at this point in the history
* doc changes

* doc changes

* doc changes

* doc changes

* doc changes

* delete whitespace

* fix docs

* fix docs

* fix docs

* fix docs

* black reformat

* fix docs

* fix docs

* changelog entry

* temp fix

* temp fix

* delete some lines

* revert back

* revert back

* black

* black

* typo

* redo after fixing typo

* ok nvm just leave it off for now

* Update pennylane_qiskit/qiskit_device.py

Co-authored-by: soranjh <[email protected]>

* Update pennylane_qiskit/qiskit_device.py

Co-authored-by: soranjh <[email protected]>

* Update pennylane_qiskit/qiskit_device.py

Co-authored-by: soranjh <[email protected]>

---------

Co-authored-by: soranjh <[email protected]>
  • Loading branch information
austingmhuang and soranjh authored Oct 31, 2024
1 parent e684a34 commit a90a1d9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

### Documentation 📝

* Added warning in the documentation of `qiskit_session` due to recent reports of unexpected behavior.
[(#594)](https://github.com/PennyLaneAI/pennylane-qiskit/pull/594)

### Bug fixes 🐛

* Fix deprecated import path for `QubitDevice`.
Expand Down
25 changes: 16 additions & 9 deletions pennylane_qiskit/qiskit_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,27 @@ def execute(self, circuits, execution_config=DefaultExecutionConfig):
# pylint: disable=protected-access
@contextmanager
def qiskit_session(device, **kwargs):
"""A context manager that creates a Qiskit Session and sets it as a session
on the device while the context manager is active. Using the context manager
will ensure the Session closes properly and is removed from the device after
completing the tasks. Any Session that was initialized and passed into the
"""
A context manager that creates a Qiskit Session and sets it as a session
on the device while the context manager is active.
.. warning::
Currently, sessions cannot be used by IBM users on
the Open plan. We recommend referring to the Qiskit Session
`documentation <https://docs.quantum.ibm.com/api/qiskit-ibm-runtime/qiskit_ibm_runtime.Session>`_
and opening a session with Qiskit's session directly.
Using the context manager will ensure the Session closes properly and is removed from the
device after completing the tasks. Any Session that was initialized and passed into the
device will be overwritten by the Qiskit Session created by this context
manager.
Args:
device (QiskitDevice2): the device that will create remote tasks using the session
**kwargs: session keyword arguments to be used for settings for the Session. At the
time of writing, the only relevant keyword argument is "max_time", which lets you
set the maximum amount of time the session is open. For the most up to date information,
please refer to the Qiskit Session
`documentation <https://docs.quantum.ibm.com/api/qiskit-ibm-runtime/qiskit_ibm_runtime.Session>`_.
**kwargs: keyword arguments for session settings. Currently, the only relevant
keyword argument is "max_time", which allows setting the maximum amount of time the session
is open.
**Example:**
Expand Down

0 comments on commit a90a1d9

Please sign in to comment.