Skip to content

Commit 424f45a

Browse files
Docs preview for PR #3313.
1 parent 3c7d0ae commit 424f45a

File tree

144 files changed

+3107
-240
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+3107
-240
lines changed

pr-3313/_images/qpus.png

-8.22 MB
Loading

pr-3313/_sources/api/languages/python_api.rst.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Kernel Execution
7272
.. autofunction:: cudaq::vqe
7373
.. autofunction:: cudaq::draw
7474
.. autofunction:: cudaq::translate
75+
.. autofunction:: cudaq::estimate_resources
7576

7677
Backend Configuration
7778
=============================
@@ -285,6 +286,9 @@ Data Types
285286
.. autoclass:: cudaq::AsyncEvolveResult
286287
:members:
287288

289+
.. autoclass:: cudaq::Resources
290+
:members:
291+
288292
Optimizers
289293
-----------------
290294

pr-3313/_sources/using/backends/cloud/braket.rst.txt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,12 @@ you can also pass the ``--emulate`` flag to ``nvq++``.
6161
6262
nvq++ --emulate --target braket src.cpp
6363
64-
To see a complete example for using Amazon Braket backends, take a look at our :ref:`C++ examples <examples>`.
6564
6665
Submission from Python
6766
`````````````````````````
6867

6968
The target to which quantum kernels are submitted
70-
can be controlled with the ``cudaq::set_target()`` function.
69+
can be controlled with the ``cudaq.set_target()`` function.
7170

7271
.. code:: python
7372
@@ -98,5 +97,4 @@ argument to ``cudaq.sample``. By default, the ``shots_count`` is set to 1000.
9897
9998
cudaq.sample(kernel, shots_count=100)
10099
101-
To see a complete example for using Amazon Braket backends, take a look at our :ref:`Python examples <examples>`.
102-
100+
To see a complete example, take a look at :ref:`Amazon Braket examples <amazon-braket-examples>`.

pr-3313/_sources/using/backends/hardware.rst.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,4 @@ To submit to a hardware backend, you need an account with the respective provide
1515
Superconducting QPUs <hardware/superconducting.rst>
1616
Neutral Atom QPUs <hardware/neutralatom.rst>
1717
Photonic QPUs <hardware/photonic.rst>
18-
19-
20-
21-
22-
23-
24-
18+
Quantum Control Systems <hardware/qcontrol.rst>

pr-3313/_sources/using/backends/hardware/iontrap.rst.txt

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ Submitting
5858
5959
cudaq.sample(kernel, shots_count=10000)
6060
61-
To see a complete example for using IonQ's backends, take a look at our :doc:`Python examples <../../examples/examples>`.
62-
6361
6462
.. tab:: C++
6563

@@ -68,7 +66,7 @@ Submitting
6866

6967
.. code:: bash
7068
71-
nvq++ --target ionq src.cpp
69+
nvq++ --target ionq src.cpp
7270
7371
This will take the API key and handle all authentication with, and submission to, the IonQ QPU(s). By default, quantum kernel code will be submitted to the IonQsimulator.
7472

@@ -93,8 +91,7 @@ Submitting
9391
9492
nvq++ --emulate --target ionq src.cpp
9593
96-
To see a complete example for using IonQ's backends, take a look at our :doc:`C++ examples <../../examples/examples>`.
97-
94+
To see a complete example, take a look at :ref:`IonQ examples <ionq-examples>`.
9895

9996
Quantinuum
10097
+++++++++++
@@ -139,7 +136,7 @@ Create a project in the Nexus portal. You can find the project ID in the URL of
139136

140137

141138
The backend to which quantum kernels are submitted
142-
can be controlled with the ``cudaq::set_target()`` function.
139+
can be controlled with the ``cudaq.set_target()`` function.
143140

144141
.. code:: python
145142
@@ -182,8 +179,6 @@ Create a project in the Nexus portal. You can find the project ID in the URL of
182179
183180
cudaq.sample(kernel, shots_count=10000)
184181
185-
To see a complete example for using Quantinuum's backends, take a look at our :doc:`Python examples <../../examples/examples>`.
186-
187182
188183
.. tab:: C++
189184

@@ -223,5 +218,4 @@ Create a project in the Nexus portal. You can find the project ID in the URL of
223218
224219
nvq++ --emulate --target quantinuum src.cpp
225220
226-
To see a complete example for using Quantinuum's backends, take a look at our :doc:`C++ examples <../../examples/examples>`.
227-
221+
To see a complete example, take a look at :ref:`Quantinuum examples <quantinuum-examples>`.

pr-3313/_sources/using/backends/hardware/neutralatom.rst.txt

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Submitting
2929
.. tab:: Python
3030

3131
The target to which quantum kernels are submitted
32-
can be controlled with the ``cudaq::set_target()`` function.
32+
can be controlled with the ``cudaq.set_target()`` function.
3333

3434
.. code:: python
3535
@@ -74,10 +74,6 @@ Submitting
7474
7575
cudaq.sample(kernel, shots_count=100)
7676
77-
To see a complete example for using Infleqtion's backends, take a look at our :doc:`Python examples <../../examples/examples>`.
78-
Moreover, for an end-to-end application workflow example executed on the Infleqtion QPU, take a look at the
79-
:doc:`Anderson Impurity Model ground state solver <../../applications>` notebook.
80-
8177
8278
.. tab:: C++
8379

@@ -123,8 +119,10 @@ Submitting
123119
124120
nvq++ --emulate --target infleqtion src.cpp
125121
126-
To see a complete example for using Infleqtion's backends, take a look at our :doc:`C++ examples <../../examples/examples>`.
127122
123+
To see a complete example, take a look at :ref:`Infleqtion examples <infleqtion-examples>`.
124+
Moreover, for an end-to-end application workflow example executed on the Infleqtion QPU, take a look at the
125+
:doc:`Anderson Impurity Model ground state solver <../../../applications/python/logical_aim_sqale>` notebook.
128126

129127

130128
Pasqal
@@ -179,7 +177,7 @@ Submitting
179177
.. tab:: Python
180178

181179
The target to which quantum kernels are submitted
182-
can be controlled with the ``cudaq::set_target()`` function.
180+
can be controlled with the ``cudaq.set_target()`` function.
183181

184182
.. code:: python
185183
@@ -224,7 +222,6 @@ Submitting
224222
225223
cudaq.evolve(RydbergHamiltonian(...), schedule=s, shots_count=1000)
226224
227-
To see a complete example for using Pasqal's backend, take a look at our :doc:`Python examples <../../examples/hardware_providers>`.
228225
229226
.. tab:: C++
230227

@@ -274,7 +271,8 @@ Submitting
274271
275272
auto evolution_result = cudaq::evolve(cudaq::rydberg_hamiltonian(...), schedule, 1000);
276273
277-
To see a complete example for using Pasqal's backend, take a look at our :doc:`C++ examples <../../examples/hardware_providers>`.
274+
275+
To see a complete example, take a look at :ref:`Pasqal examples <pasqal-examples>`.
278276

279277

280278
.. note::
@@ -323,7 +321,7 @@ Submitting
323321
.. tab:: Python
324322

325323
The target to which quantum kernels are submitted
326-
can be controlled with the ``cudaq::set_target()`` function.
324+
can be controlled with the ``cudaq.set_target()`` function.
327325

328326
.. code:: python
329327
@@ -352,7 +350,6 @@ Submitting
352350
353351
cudaq.evolve(RydbergHamiltonian(...), schedule=s, shots_count=1000)
354352
355-
To see a complete example for using QuEra's backend, take a look at our :doc:`Python examples <../../examples/hardware_providers>`.
356353
357354
.. tab:: C++
358355

@@ -384,7 +381,7 @@ Submitting
384381
385382
auto evolution_result = cudaq::evolve(cudaq::rydberg_hamiltonian(...), schedule, 1000);
386383
387-
To see a complete example for using QuEra's backend, take a look at our :doc:`C++ examples <../../examples/hardware_providers>`.
384+
To see a complete example, take a look at :ref:`QuEra Computing examples <quera-examples>`.
388385

389386
.. note::
390387

pr-3313/_sources/using/backends/hardware/photonic.rst.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,6 @@ Submitting
6565
loop_lengths = [1]
6666
counts = cudaq.orca.sample(input_state, loop_lengths, bs_angles)
6767
68-
To see a complete example for using ORCA's backends, take a look at our :doc:`Python examples <../../examples/hardware_providers>`.
69-
70-
7168
7269
.. tab:: C++
7370

@@ -93,4 +90,4 @@ Submitting
9390
./executable
9491
9592
96-
To see a complete example for using ORCA server backends, take a look at our :doc:`C++ examples <../../examples/hardware_providers>`.
93+
To see a complete example, take a look at :ref:`ORCA Computing examples <orca-examples>`.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
Quantum Control Systems
2+
========================
3+
4+
Quantum Machines
5+
+++++++++++++++++++++
6+
7+
.. _quantum-machines-backend:
8+
9+
Quantum Machines provides a unified quantum computing control system that enables
10+
users to execute quantum programs on various QPU types (hardware backends) through
11+
their Quantum Orchestration Platform (QOP) - a platform that controls different
12+
quantum hardware implementations through a unified software API.
13+
14+
For information about available hardware backends and their capabilities,
15+
please consult the `Quantum Machines website <https://www.quantum-machines.co/>`__.
16+
17+
18+
Setting Credentials
19+
`````````````````````````
20+
21+
To use Quantum Machines with CUDA-Q, you need to have an API key and access to
22+
the Quantum Machines server or their `QOperator` service. You can set it using
23+
an environment variable:
24+
25+
.. code-block:: bash
26+
27+
export QUANTUM_MACHINES_API_KEY="<your_api_key>"
28+
29+
Alternatively, you can provide it directly when setting the target in your code.
30+
31+
32+
Submitting
33+
`````````````````````````
34+
35+
To specify which backend to use, set the `executor` parameter when configuring
36+
the target. The available backends depend on your specific access rights and
37+
set up with Quantum Machines. By default, a mock executor is used.
38+
39+
.. tab:: Python
40+
41+
To target Quantum Machines from Python, use the ``cudaq.set_target()`` function:
42+
43+
.. code:: python
44+
45+
cudaq.set_target("quantum_machines",
46+
url="https://api.quantum-machines.com",
47+
api_key="your_api_key",
48+
executor="mock")
49+
50+
Parameters:
51+
52+
- ``url``: The URL of the Quantum Machines server
53+
- ``executor``: The name of the executor/backend to use (defaults to "mock")
54+
- ``api_key``: Your API key (optional if set via environment variable)
55+
56+
57+
.. tab:: C++
58+
59+
To target quantum kernel code for execution on Quantum Machines, pass the
60+
flag ``--target quantum_machines`` to the ``nvq++`` compiler:
61+
62+
.. code-block:: bash
63+
64+
nvq++ --target quantum_machines --quantum-machines-url "https://api.quantum-machines.com" src.cpp
65+
66+
You can specify additional parameters:
67+
68+
- ``--quantum-machines-url``: The URL of the QOperator server
69+
- ``--quantum-machines-executor``: The name of the executor/backend to use (defaults to "mock")
70+
- ``--quantum-machines-api-key``: Your API key (if not set via environment variable)
71+
72+
To see a complete example, take a look at :ref:`Quantum Machines examples <quantum-machines-examples>`.

pr-3313/_sources/using/backends/hardware/superconducting.rst.txt

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@ Submitting
7474
7575
cudaq.sample(kernel, shots_count=10000)
7676
77-
To see a complete example for using Anyon's backends, take a look at our :doc:`Python examples <../../examples/examples>`.
78-
7977
8078
.. tab:: C++
8179

@@ -107,7 +105,7 @@ Submitting
107105
108106
nvq++ --target anyon --emulate src.cpp
109107
110-
To see a complete example for using Anyon's backends, take a look at our :doc:`C++ examples <../../examples/examples>`.
108+
To see a complete example, take a look at :ref:`Anyon examples <anyon-examples>`.
111109

112110

113111
IQM
@@ -137,9 +135,8 @@ Submitting
137135

138136
.. tab:: Python
139137

140-
141138
The target to which quantum kernels are submitted
142-
can be controlled with the ``cudaq::set_target()`` function.
139+
can be controlled with the ``cudaq.set_target()`` function.
143140

144141
.. code:: python
145142
@@ -160,16 +157,9 @@ Submitting
160157
.. code:: python
161158
162159
cudaq.sample(kernel, shots_count=10000)
163-
164-
To see a complete example for using IQM server backends, take a look at our :doc:`Python examples<../../examples/examples>`.
165-
166-
167-
168-
169-
160+
170161
.. tab:: C++
171162

172-
173163
To target quantum kernel code for execution on an IQM Server,
174164
pass the ``--target iqm`` flag to the ``nvq++`` compiler, along with a specified ``--iqm-machine``.
175165

@@ -201,7 +191,7 @@ Submitting
201191
202192
nvq++ --emulate --target iqm --iqm-machine Crystal_5 src.cpp
203193
204-
To see a complete example for using IQM server backends, take a look at our :doc:`C++ examples <../../examples/examples>`.
194+
To see a complete example, take a look at :ref:`IQM examples <iqm-examples>`.
205195

206196

207197
OQC
@@ -210,7 +200,6 @@ OQC
210200
.. _oqc-backend:
211201

212202

213-
214203
`Oxford Quantum Circuits <https://oxfordquantumcircuits.com/>`__ (OQC) is currently providing CUDA-Q integration for multiple Quantum Processing Unit types.
215204
The 8 qubit ring topology Lucy device and the 32 qubit Kagome lattice topology Toshiko device are both supported via machine options described below.
216205

@@ -232,10 +221,8 @@ There are three environment variables that the OQC target will look for during c
232221
Submitting
233222
`````````````````````````
234223

235-
236224
.. tab:: Python
237225

238-
239226
To set which OQC URL, set the :code:`url` parameter.
240227
To set which OQC email, set the :code:`email` parameter.
241228
To set which OQC machine, set the :code:`machine` parameter.
@@ -244,21 +231,17 @@ Submitting
244231
245232
import os
246233
import cudaq
247-
# ...
248234
os.environ['OQC_PASSWORD'] = password
249235
cudaq.set_target("oqc", url=url, machine="lucy")
250236
251237
You can then execute a kernel against the platform using the OQC Lucy device
252238

239+
To emulate the OQC device locally, without submitting through the OQC QCaaS services, you can set the ``emulate`` flag to ``True``.
240+
This will emit any target specific compiler warnings and diagnostics, before running a noise free emulation.
241+
253242
.. code:: python
254243
255-
kernel = cudaq.make_kernel()
256-
qvec = kernel.qalloc(2)
257-
kernel.h(qvec[0])
258-
kernel.x(qvec[1])
259-
kernel.cx(qvec[0], qvec[1])
260-
kernel.mz(qvec)
261-
str(cudaq.sample(kernel=kernel, shots_count=1000))
244+
cudaq.set_target("oqc", emulate=True)
262245
263246
264247
.. tab:: C++
@@ -286,15 +269,14 @@ Submitting
286269
287270
nvq++ --emulate --target oqc src.cpp -o executable
288271
289-
290272
.. note::
291273

292274
The oqc target supports a ``--oqc-machine`` option.
293275
The default is the 8 qubit Lucy device.
294276
You can set this to be either ``toshiko`` or ``lucy`` via this flag.
295277

296-
.. note::
297-
298-
The OQC quantum assembly toolchain (qat) which is used to compile and execute instructions can be found on github as `oqc-community/qat <https://github.com/oqc-community/qat>`__
278+
.. note::
299279

280+
The OQC quantum assembly toolchain (qat) which is used to compile and execute instructions can be found on github as `oqc-community/qat <https://github.com/oqc-community/qat>`__
300281

282+
To see a complete example, take a look at :ref:`OQC examples <oqc-examples>`.

0 commit comments

Comments
 (0)