You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Emulation mode will still contact the configured IQM Server to retrieve the dynamic quantum architecture resulting from the active calibration unless a QPU architecture file is explicitly specified.
20
+
This can be done by setting `mapping_file` to point to a file describing the QPU architecture which should be emulated.
21
+
If an architecture is specified no server URL is needed anymore.
Emulation mode will still contact the configured IQM Server to retrieve the dynamic quantum architecture resulting from the active calibration unless a QPU architecture file is explicitly specified.
53
+
This can be done by specifying a file with the architecture either at compile time or in an variable in the environment executing the binary.
54
+
If an architecture is specified no server URL is needed anymore.
55
+
56
+
.. code:: bash
57
+
58
+
// With this binary multiple QPU architectures can be tested without recompilation.
59
+
nvq++ --target iqm --emulate src.cpp -o program
60
+
IQM_QPU_QA="<path+filename of QPU architecture file>" ./program
61
+
62
+
.. code:: bash
63
+
64
+
// This binary will use the given QPU architecture file until overwritten by environment variable "IQM_QPU_QA".
65
+
nvq++ --target iqm --emulate --mapping-file <path+filename of QPU architecture file> src.cpp -o program
66
+
./program
67
+
68
+
The folder ``targettests/Target/IQM/`` contains sample QPU architecture files.
69
+
Find there files for the IQM Crystal architecture as well as files from real life QPUs which can be found on the IQM Resonance portal.
70
+
71
+
The QPU architecture of a test with an IQM server can be saved forlater usein emulation runs.
72
+
To do so the environment variable ``IQM_SAVE_QPU_QA`` must be set to point to a filename in addition to setting the URL of a Resonance server.
73
+
The test can even run as emulation as long as a server URL is given to retrieve the current dynamic quantum architecture from.
74
+
75
+
.. code:: bash
76
+
77
+
nvq++ --target iqm --emulate src.cpp -o program
78
+
IQM_SERVER_URL="https://demo.qc.iqm.fi/" IQM_SAVE_QPU_QA="<path+filename for QPU architecture file>" ./program
79
+
80
+
81
+
To see a complete example, take a look at :ref:`IQM examples <iqm-examples>`.
82
+
83
+
84
+
Setting the Number of Shots
85
+
+++++++++++++++++++++++++++
86
+
87
+
.. tab:: Python
88
+
89
+
The number of shots for a kernel execution can be set through
90
+
the ``shots_count`` argument to ``cudaq.sample`` or ``cudaq.observe``. By default,
91
+
the ``shots_count`` is set to 1000.
92
+
93
+
.. code:: python
94
+
95
+
cudaq.sample(kernel, shots_count=10000)
96
+
97
+
98
+
Using Credentials Saved in a File
99
+
+++++++++++++++++++++++++++++++++
100
+
101
+
The preferred way to pass the "API Token" to the IQM backend is through the environment variable ``IQM_TOKEN``. For compatibility the earlier used storage of the "API Token"in a file can still be used as follows:
102
+
103
+
The previously used ``IQM_TOKENS_FILE`` environment variable can still be used to point to a tokens file but will be ignored if the ``IQM_TOKEN`` variable is set.
104
+
The tokens file cannot be generated by the ``iqmclient`` tool anymore but can be created manually using the "API Token" obtained from the Resonance profile page.
105
+
A tokens file can be created and the environment variable set like this:
Copy file name to clipboardExpand all lines: docs/sphinx/using/backends/hardware/superconducting.rst
+39-54Lines changed: 39 additions & 54 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,89 +109,74 @@ To see a complete example, take a look at :ref:`Anyon examples <anyon-examples>`
109
109
110
110
111
111
IQM
112
-
+++++++++
112
+
+++
113
113
114
114
.. _iqm-backend:
115
115
116
-
Support for submissions to IQM is currently under development.
117
-
In particular, two-qubit gates can only be performed on adjacent qubits. For more information, we refer to the respective hardware documentation.
118
-
Support for automatically injecting the necessary operations during compilation to execute arbitrary multi-qubit gates will be added in future versions.
116
+
`IQM Resonance <https://meetiqm.com/products/iqm-resonance/>`__ offers access to various different IQM quantum computers.
117
+
The machines available there will be constantly extended as development progresses.
118
+
Programmers of CUDA-Q may use IQM Resonance with either C++ or Python.
119
119
120
-
Setting Credentials
121
-
`````````````````````````
120
+
With this version it is no longer necessary to define the target QPU architecture in the code or at compile time.
121
+
The IQM backend integration now contacts at runtime the configured IQM server and fetches the active dynamic quantum architecture of the QPU.
122
+
This is then used as input to transpile the quantum kernel code just-in-time for the target QPU topology.
123
+
By setting the environment variable ``IQM_SERVER_URL`` the target server can be selected just before executing the program.
124
+
As result the python script or the compiled C++ program can be executed on different QPUs without recompilation or code changes.
122
125
123
-
Programmers of CUDA-Q may access the IQM Server from either C++ or Python. Following the `quick start guide <https://iqm-finland.github.io/cortex-cli/readme.html#using-cortex-cli>`__, install `iqm-cortex-cli` and login to initialize the tokens file.
124
-
The path to the tokens file can either be passed explicitly via an environment variable or it will be loaded automatically if located in
125
-
the default location :code:`~/.cache/iqm-cortex-cli/tokens.json`.
126
+
Please find also more documentation after logging in to the IQM Resonance portal.
126
127
127
-
.. code:: bash
128
128
129
-
export IQM_TOKENS_FILE="path/to/tokens.json"
129
+
Setting Credentials
130
+
```````````````````
131
+
132
+
Create a free account on the `IQM Resonance portal <https://meetiqm.com/products/iqm-resonance/>`__ and log-in.
133
+
Navigate to the account profile (top right). There generate an "API Token" and copy the generated token-string.
134
+
Set the environment variable ``IQM_TOKEN`` to contain the value of the token-string.
135
+
The IQM backend integration will use this as authorization token at the IQM server.
130
136
131
137
132
-
133
138
Submitting
134
-
`````````````````````````
135
-
136
-
.. tab:: Python
137
-
138
-
The target to which quantum kernels are submitted
139
-
can be controlled with the ``cudaq.set_target()`` function.
Once the binary for a specific IQM QPU architecture is compiled, it can be executed against any IQM Server with the same QPU architecture:
160
+
Once the binary for an IQM QPU is compiled, it can be executed against any IQM Server by setting the environment variable ``IQM_SERVER_URL`` as shown here:
176
161
177
-
.. code:: bash
162
+
.. code:: bash
178
163
179
-
nvq++ --target iqm --iqm-machine Crystal_5 src.cpp -o program
0 commit comments