Skip to content

Commit

Permalink
doc: remote setup deduped
Browse files Browse the repository at this point in the history
  • Loading branch information
Henri-ColibrITD committed May 13, 2024
1 parent 2f0c34c commit 28fc785
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 77 deletions.
33 changes: 0 additions & 33 deletions docs/execution.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,39 +20,6 @@ Devices

.. automodule:: mpqp.execution.devices

.. _Remote setup:

Setting up a remote device
--------------------------

Installing MPQP gives you access to a script facilitating the setting up of
remote QPU connections. The three supported providers can be setup from this
script, called ``setup_connections``. Each of these providers have their own set
of data needed to setup the connection, summed up here:

- IBM quantum (qiskit): for this provider, you only need your account ``API
token``, which you can find in your `account page <https://quantum.ibm.com/account>`_;
- Atos/Eviden (Qaptiva/QLM): for this provider, several connection methods
exist. For now we only support the username/password method. You should have
received you username and password by email;
- AWS (braket): for this provider, you will need more information: all of them can
be found in your
`AWS console <https://console.aws.amazon.com/console/home?nc2=h_ct&src=header-signin>`_.
In the console go to the ``IAM service``, in the ``Users`` tab, click on your
username, in the ``Security credential`` tab, you'll find an ``Access keys``
section. In this section, you can create a new access key for MPQP, you should
save it because you will not be able to get back your secret latter on.
This will give you your key and your secret, but for the configuration you also
need a region (for example ``us-east-1``).
In short, one would need:

+ ``AWS Access Key ID``,
+ ``AWS Secret Access Key`` and
+ ``Default region name``.

.. TODO: this is a duplicate from a section in the getting-started page, merge
.. the two to keep only what's better.
Run a circuit
-------------

Expand Down
71 changes: 29 additions & 42 deletions docs/getting-started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,48 +46,35 @@ Your first circuit
c: 2/═══════════╩══╩═
0 1
Setup remote connection
-----------------------

After you installed MPQP package using ``pip install``, the script
:mod:`setup_connections.py<mpqp.execution.connection.setup_connections>` can be
called to setup your connection to the remote backends supported, using the
following command:

.. code-block:: console
$ setup_connections
IBM Quantum
^^^^^^^^^^^

Each IBM Quantum account is associated to a unique token. It is accessible by
first logging in the `IBM Quantum Platform <https://quantum.ibm.com/>`_ and then
looking for the ``API Token`` on the top right (that you can copy). This token
is sufficient to configure your account, and to be able to submit jobs to remote
devices. When inputting your token in the MPQP configuration script, this will
configure the account for all your current environments, meaning that this
account will still be configured outside of MPQP.

QLMaaS / Qaptiva
^^^^^^^^^^^^^^^^

QLM proposes several ways of setting up the account to submit jobs on their
simulators. We made the choice to use the ``username`` and ``password``
credentials to identify yourself on the QLM. When configuring the connection
with ``setup_connections`` script, we ask you to choose between configuring
the account only in the scope of MPQP, or for your whole environment.

AWS Braket
^^^^^^^^^^

For setting up your AWS Braket account, we call the CLI ``aws configure`` that
handles it for us. It will ask you your ``AWS Access Key ID``, ``AWS Secret
Access Key`` and ``Default region name``. Note that it will configure the
account not only in MPQP scope.

.. _Remote setup:

Setup remote accesses
---------------------

Installing MPQP gives you access to ``setup_connections`` a script facilitating
the setting up of remote QPU connections. The three supported providers (qiskit,
Qaptiva and braket) can be setup from this script. Each of these providers have
their own set of data needed to setup the connection, summed up here:

- IBM quantum (qiskit): for this provider, you only need your account ``API
token``, which you can find in your `account page <https://quantum.ibm.com/account>`_;
- Atos/Eviden (Qaptiva/QLM): for this provider, several connection methods
exist. For now we only support the username/password method. You should have
received you username and password by email;
- AWS (braket): for this provider, you will need more information: all of them can
be found in your
`AWS console <https://console.aws.amazon.com/console/home?nc2=h_ct&src=header-signin>`_.
In the console go to the ``IAM service``, in the ``Users`` tab, click on your
username, in the ``Security credential`` tab, you'll find an ``Access keys``
section. In this section, you can create a new access key for MPQP, you should
save it because you will not be able to get back your secret latter on.
This will give you your key and your secret, but for the configuration you also
need a region (for example ``us-east-1``).
In short, one would need:

+ ``AWS Access Key ID``,
+ ``AWS Secret Access Key`` and
+ ``Default region name``.

Execute examples
----------------
Expand Down
7 changes: 5 additions & 2 deletions mpqp_scripts/setup_connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@


def print_config_info():
"""Displays the information stored for each provider."""
import mpqp.execution.connection.aws_connection as awsc
import mpqp.execution.connection.env_manager as env_m
import mpqp.execution.connection.ibm_connection as ibmqc
Expand Down Expand Up @@ -45,8 +46,10 @@ def print_config_info():


def main_setup():
"""Function called by the script bellow to setup all connections or to get
information about the existing ones."""
"""Main function of the script, triggering the choice selection, and guiding
you through the steps needed to configure each provider access. This
function has to be executed from a terminal like environment, allowing you
to type tokens and alike."""
import mpqp.execution.connection.aws_connection as awsc
import mpqp.execution.connection.ibm_connection as ibmqc
import mpqp.execution.connection.qlm_connection as qlmc
Expand Down

0 comments on commit 28fc785

Please sign in to comment.