Skip to content

Commit

Permalink
Update docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
smite committed Feb 7, 2025
1 parent 8750309 commit 713e5e2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Changelog
=========

Version 15.4
============

* Updated the documentation. `#144 <https://github.com/iqm-finland/cirq-on-iqm/pull/144>`_

Version 15.3
============

Expand Down
24 changes: 12 additions & 12 deletions docs/user_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ Running on a real quantum computer

.. note::

You can access IQM quantum computers via `IQM Resonance <https://www.meetiqm.com/products/iqm-resonance>`_
You can access IQM quantum computers via `IQM Resonance <https://www.meetiqm.com/products/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.
Expand Down Expand Up @@ -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 <https://github.com/iqm-finland/cortex-cli>`_ to retrieve and automatically refresh access tokens,
Expand All @@ -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 <https://iqm-finland.github.io/docs/iqm-client/>`_,
i.e. `IQMSampler(server_url, token="<YOUR_API_TOKEN>")`



Batch execution
^^^^^^^^^^^^^^^
Expand Down
17 changes: 6 additions & 11 deletions src/iqm/cirq_iqm/iqm_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand All @@ -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__(
Expand Down

0 comments on commit 713e5e2

Please sign in to comment.