From 713e5e2bf2e81e4f4f0752cbef5f2626060bccb7 Mon Sep 17 00:00:00 2001 From: Ville Bergholm <1044345+smite@users.noreply.github.com> Date: Fri, 7 Feb 2025 11:20:20 +0200 Subject: [PATCH] Update docs. --- CHANGELOG.rst | 5 +++++ docs/user_guide.rst | 24 ++++++++++++------------ src/iqm/cirq_iqm/iqm_sampler.py | 17 ++++++----------- 3 files changed, 23 insertions(+), 23 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 12f0b3e9..3c7b4d72 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,11 @@ Changelog ========= +Version 15.4 +============ + +* Updated the documentation. `#144 `_ + Version 15.3 ============ diff --git a/docs/user_guide.rst b/docs/user_guide.rst index 2e0bf8a7..e586c2b6 100644 --- a/docs/user_guide.rst +++ b/docs/user_guide.rst @@ -259,7 +259,7 @@ Running on a real quantum computer .. note:: - You can access IQM quantum computers via `IQM Resonance `_ + You can access IQM quantum computers via `IQM Resonance `_ or via one of the IQM quantum computers deployed at HPC centers and research institutions around the globe. Cirq contains various simulators which you can use to simulate the circuits constructed above. @@ -353,8 +353,17 @@ as explained in the :ref:`routing` section above. Authentication ^^^^^^^^^^^^^^ -IQM Server (on-premise devices) -""""""""""""""""""""""""""""""" +IQM Resonance +""""""""""""" + +If you are using IQM Resonance, you have two options to authenticate: + +1. Set the :envvar:`IQM_TOKEN` environment variable with the API token obtained from the Resonance dashboard. +2. Pass the ``token`` parameter to :class:`.IQMSampler`. This will be forwarded to + :class:`~iqm.iqm_client.iqm_client.IQMClient`. + +On-premises devices +""""""""""""""""""" If the IQM server you are connecting to requires authentication, you may use `Cortex CLI `_ to retrieve and automatically refresh access tokens, @@ -366,15 +375,6 @@ Alternatively, you may authenticate yourself using the :envvar:`IQM_AUTH_SERVER` arguments to :class:`.IQMSampler`, but this approach is less secure and considered deprecated. -IQM Resonance -""""""""""""" -If you are using ``IQM Resonance``, you have two options to authenticate: - -1. Set the :envvar:`IQM_TOKEN` environment variable with the API token obtained from the IQM Resonance dashboard. -2. Pass the `token` parameter to :class:`.IQMSampler`. This will be forwarded to `IQM Client `_, - i.e. `IQMSampler(server_url, token="")` - - Batch execution ^^^^^^^^^^^^^^^ diff --git a/src/iqm/cirq_iqm/iqm_sampler.py b/src/iqm/cirq_iqm/iqm_sampler.py index 0a8a2bcb..ee907c92 100644 --- a/src/iqm/cirq_iqm/iqm_sampler.py +++ b/src/iqm/cirq_iqm/iqm_sampler.py @@ -35,8 +35,13 @@ class IQMSampler(cirq.work.Sampler): """Circuit sampler for executing quantum circuits on IQM quantum computers. + IQMSampler connects to a quantum computer through an IQM server. + If the server requires user authentication, you can provide it either using environment + variables, or as keyword arguments to IQMSampler. The user authentication kwargs are passed + through to :class:`~iqm.iqm_client.iqm_client.IQMClient` as is, and are documented there. + Args: - url: Endpoint for accessing the server interface. Has to start with http or https. + url: URL of the IQM server. Has to start with http or https. device: Device to execute the circuits on. If ``None``, the device will be created based on the calibration-specific dynamic quantum architecture obtained from :class:`~iqm.iqm_client.iqm_client.IQMClient`. @@ -45,16 +50,6 @@ class IQMSampler(cirq.work.Sampler): run_sweep_timeout: Timeout for polling sweep results, in seconds. If ``None``, use the client default value. compiler_options: The compilation options to use for the circuits, as defined by IQM Client. - - Keyword Args: - auth_server_url (str): URL of user authentication server, if required by the IQM Cortex server. It is not required for IQM Resonance. - This can also be set in the IQM_AUTH_SERVER environment variable. - username (str): Username, if required by the IQM Cortex server. It is not required for IQM Resonance. - This can also be set in the IQM_AUTH_USERNAME environment variable. - password (str): Password, if required by the IQM Cortex server. - This can also be set in the IQM_AUTH_PASSWORD environment variable. It is not required for IQM Resonance. - token: API token retrieved from IQM Resonance, not required for on-premise quantum computers. - Can also be set in the ``IQM_TOKEN`` environment variable. """ def __init__(