Skip to content

Commit 9c14bb9

Browse files
Docs preview for PR #2711.
1 parent ae5c1ec commit 9c14bb9

File tree

13 files changed

+579
-154
lines changed

13 files changed

+579
-154
lines changed

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

+148-62
Original file line numberDiff line numberDiff line change
@@ -177,56 +177,108 @@ Alternatively, users can set the following environment variables directly.
177177
export PASQAL_PROJECT_ID=<>
178178
179179
180-
Submission from Python
180+
Submitting
181181
`````````````````````````
182+
.. tab:: Python
182183

183-
The target to which quantum kernels are submitted
184-
can be controlled with the ``cudaq::set_target()`` function.
184+
The target to which quantum kernels are submitted
185+
can be controlled with the ``cudaq::set_target()`` function.
185186

186-
.. code:: python
187+
.. code:: python
187188
188-
cudaq.set_target('pasqal')
189+
cudaq.set_target('pasqal')
189190
190191
191-
This accepts an optional argument, ``machine``, which is used in the cloud platform to
192-
select the corresponding Pasqal QPU or emulator to execute on.
193-
See the `Pasqal cloud portal <https://portal.pasqal.cloud/>`__ for an up to date list.
194-
The default value is ``EMU_MPS`` which is an open-source tensor network emulator based on the
195-
Matrix Product State formalism running in Pasqal's cloud platform. You can see the
196-
documentation for the publicly accessible emulator `here <https://pasqal-io.github.io/emulators/latest/emu_mps/>`__.
192+
This accepts an optional argument, ``machine``, which is used in the cloud platform to
193+
select the corresponding Pasqal QPU or emulator to execute on.
194+
See the `Pasqal cloud portal <https://portal.pasqal.cloud/>`__ for an up to date list.
195+
The default value is ``EMU_MPS`` which is an open-source tensor network emulator based on the
196+
Matrix Product State formalism running in Pasqal's cloud platform. You can see the
197+
documentation for the publicly accessible emulator `here <https://pasqal-io.github.io/emulators/latest/emu_mps/>`__.
197198

198-
To target the QPU use the FRESNEL machine name. Note that there are restrictions
199-
regarding the values of the pulses as well as the register layout. We invite you to
200-
consult our `documentation <https://docs.pasqal.com/cloud/fresnel-job>`__. Note that
201-
the CUDA-Q integration currently only works with `arbitrary layouts <https://docs.pasqal.com/cloud/fresnel-job/#arbitrary-layouts>`__
202-
which are implemented with automatic calibration for less than 30 qubits. For jobs
203-
larger than 30 qubits please use the `atom_sites` to define the layout, and use the
204-
`atom_filling` to select sites as filled or not filled in order to define the register.
199+
To target the QPU use the FRESNEL machine name. Note that there are restrictions
200+
regarding the values of the pulses as well as the register layout. We invite you to
201+
consult our `documentation <https://docs.pasqal.com/cloud/fresnel-job>`__. Note that
202+
the CUDA-Q integration currently only works with `arbitrary layouts <https://docs.pasqal.com/cloud/fresnel-job/#arbitrary-layouts>`__
203+
which are implemented with automatic calibration for less than 30 qubits. For jobs
204+
larger than 30 qubits please use the `atom_sites` to define the layout, and use the
205+
`atom_filling` to select sites as filled or not filled in order to define the register.
205206

206-
Due to the nature of the underlying hardware, this target only supports the
207-
``evolve`` and ``evolve_async`` APIs.
208-
The `hamiltonian` must be an `Operator` of the type `RydbergHamiltonian`. The only
209-
other supported parameters are `schedule` (mandatory) and `shots_count` (optional).
207+
Due to the nature of the underlying hardware, this target only supports the
208+
``evolve`` and ``evolve_async`` APIs.
209+
The `hamiltonian` must be an `Operator` of the type `RydbergHamiltonian`. The only
210+
other supported parameters are `schedule` (mandatory) and `shots_count` (optional).
210211

211-
For example,
212+
For example,
212213

213-
.. code:: python
214+
.. code:: python
215+
216+
evolution_result = evolve(RydbergHamiltonian(atom_sites=register,
217+
amplitude=omega,
218+
phase=phi,
219+
delta_global=delta),
220+
schedule=schedule)
221+
222+
The number of shots for a kernel execution can be set through the ``shots_count``
223+
argument to ``evolve`` or ``evolve_async``. By default, the ``shots_count`` is
224+
set to 100.
225+
226+
.. code:: python
227+
228+
cudaq.evolve(RydbergHamiltonian(...), schedule=s, shots_count=1000)
229+
230+
To see a complete example for using Pasqal's backend, take a look at our :doc:`Python examples <../../examples/hardware_providers>`.
231+
232+
.. tab:: C++
214233

215-
evolution_result = evolve(RydbergHamiltonian(atom_sites=register,
216-
amplitude=omega,
217-
phase=phi,
218-
delta_global=delta),
219-
schedule=schedule)
234+
To target quantum kernel code for execution on Pasqal QPU or simulators,
235+
pass the flag ``--target pasqal`` to the ``nvq++`` compiler.
220236

221-
The number of shots for a kernel execution can be set through the ``shots_count``
222-
argument to ``evolve`` or ``evolve_async``. By default, the ``shots_count`` is
223-
set to 100.
237+
.. code:: bash
238+
239+
nvq++ --target pasqal src.cpp
240+
241+
You can also pass the flag ``--pasqal-machine`` to select the corresponding Pasqal QPU or emulator to execute on.
242+
See the `Pasqal cloud portal <https://portal.pasqal.cloud/>`__ for an up to date list.
243+
The default value is ``EMU_MPS`` which is an open-source tensor network emulator based on the
244+
Matrix Product State formalism running in Pasqal's cloud platform. You can see the
245+
documentation for the publicly accessible emulator `here <https://pasqal-io.github.io/emulators/latest/emu_mps/>`__.
246+
247+
.. code:: bash
248+
249+
nvq++ --target pasqal --pasqal-machine EMU_FREE src.cpp
250+
251+
To target the QPU use the FRESNEL machine name. Note that there are restrictions
252+
regarding the values of the pulses as well as the register layout. We invite you to
253+
consult our `documentation <https://docs.pasqal.com/cloud/fresnel-job>`__. Note that
254+
the CUDA-Q integration currently only works with `arbitrary layouts <https://docs.pasqal.com/cloud/fresnel-job/#arbitrary-layouts>`__
255+
which are implemented with automatic calibration for less than 30 qubits. For jobs
256+
larger than 30 qubits please use the `atom_sites` to define the layout, and use the
257+
`atom_filling` to select sites as filled or not filled in order to define the register.
258+
259+
Due to the nature of the underlying hardware, this target only supports the
260+
``evolve`` and ``evolve_async`` APIs.
261+
The `hamiltonian` must be of the type `rydberg_hamiltonian`. Only
262+
other parameters supported are `schedule` (mandatory) and `shots_count` (optional).
263+
264+
For example,
224265

225-
.. code:: python
266+
.. code:: cpp
226267
227-
cudaq.evolve(RydbergHamiltonian(...), schedule=s, shots_count=1000)
268+
auto evolution_result = cudaq::evolve(
269+
cudaq::rydberg_hamiltonian(register_sites, omega, phi, delta),
270+
schedule);
271+
272+
The number of shots for a kernel execution can be set through the ``shots_count``
273+
argument to ``evolve`` or ``evolve_async``. By default, the ``shots_count`` is
274+
set to 100.
275+
276+
.. code:: cpp
277+
278+
auto evolution_result = cudaq::evolve(cudaq::rydberg_hamiltonian(...), schedule, 1000);
279+
280+
To see a complete example for using Pasqal's backend, take a look at our :doc:`C++ examples <../../examples/hardware_providers>`.
228281

229-
To see a complete example for using Pasqal's backend, take a look at our :doc:`Python examples <../../examples/hardware_providers>`.
230282

231283
.. note::
232284

@@ -261,47 +313,81 @@ Alternatively, users can set the following environment variables.
261313
export AWS_SECRET_ACCESS_KEY="<access_key>"
262314
export AWS_SESSION_TOKEN="<token>"
263315
264-
Submission from Python
316+
About Aquila
265317
`````````````````````````
266318

267-
The target to which quantum kernels are submitted
268-
can be controlled with the ``cudaq::set_target()`` function.
269-
270-
.. code:: python
271-
272-
cudaq.set_target('quera')
273-
274-
By default, analog Hamiltonian will be submitted to the Aquila system.
275-
276319
Aquila is a "field programmable qubit array" operated as an analog
277320
Hamiltonian simulator on a user-configurable architecture, executing
278321
programmable coherent quantum dynamics on up to 256 neutral-atom qubits.
279322
Refer to QuEra's `whitepaper <https://cdn.prod.website-files.com/643b94c382e84463a9e52264/648f5bf4d19795aaf36204f7_Whitepaper%20June%2023.pdf>`__ for details.
280323

281-
Due to the nature of the underlying hardware, this target only supports the
282-
``evolve`` and ``evolve_async`` APIs.
283-
The `hamiltonian` must be an `Operator` of the type `RydbergHamiltonian`. Only
284-
other parameters supported are `schedule` (mandatory) and `shots_count` (optional).
324+
Submitting
325+
`````````````````````````
326+
.. tab:: Python
327+
328+
The target to which quantum kernels are submitted
329+
can be controlled with the ``cudaq::set_target()`` function.
330+
331+
.. code:: python
285332
286-
For example,
333+
cudaq.set_target('quera')
287334
288-
.. code:: python
335+
Due to the nature of the underlying hardware, this target only supports the
336+
``evolve`` and ``evolve_async`` APIs.
337+
The `hamiltonian` must be an `Operator` of the type `RydbergHamiltonian`. Only
338+
other parameters supported are `schedule` (mandatory) and `shots_count` (optional).
339+
340+
For example,
341+
342+
.. code:: python
343+
344+
evolution_result = evolve(RydbergHamiltonian(atom_sites=register,
345+
amplitude=omega,
346+
phase=phi,
347+
delta_global=delta),
348+
schedule=schedule)
349+
350+
The number of shots for a kernel execution can be set through the ``shots_count``
351+
argument to ``evolve`` or ``evolve_async``. By default, the ``shots_count`` is
352+
set to 100.
353+
354+
.. code:: python
355+
356+
cudaq.evolve(RydbergHamiltonian(...), schedule=s, shots_count=1000)
357+
358+
To see a complete example for using QuEra's backend, take a look at our :doc:`Python examples <../../examples/hardware_providers>`.
359+
360+
.. tab:: C++
361+
362+
To target quantum kernel code for execution on QuEra's Aquila,
363+
pass the flag ``--target quera`` to the ``nvq++`` compiler.
364+
365+
.. code:: bash
366+
367+
nvq++ --target quera src.cpp
368+
369+
Due to the nature of the underlying hardware, this target only supports the
370+
``evolve`` and ``evolve_async`` APIs.
371+
The `hamiltonian` must be of the type `rydberg_hamiltonian`. Only
372+
other parameters supported are `schedule` (mandatory) and `shots_count` (optional).
373+
374+
For example,
375+
376+
.. code:: cpp
289377
290-
evolution_result = evolve(RydbergHamiltonian(atom_sites=register,
291-
amplitude=omega,
292-
phase=phi,
293-
delta_global=delta),
294-
schedule=schedule)
378+
auto evolution_result = cudaq::evolve(
379+
cudaq::rydberg_hamiltonian(register_sites, omega, phi, delta),
380+
schedule);
295381
296-
The number of shots for a kernel execution can be set through the ``shots_count``
297-
argument to ``evolve`` or ``evolve_async``. By default, the ``shots_count`` is
298-
set to 100.
382+
The number of shots for a kernel execution can be set through the ``shots_count``
383+
argument to ``evolve`` or ``evolve_async``. By default, the ``shots_count`` is
384+
set to 100.
299385

300-
.. code:: python
386+
.. code:: cpp
301387
302-
cudaq.evolve(RydbergHamiltonian(...), schedule=s, shots_count=1000)
388+
auto evolution_result = cudaq::evolve(cudaq::rydberg_hamiltonian(...), schedule, 1000);
303389
304-
To see a complete example for using QuEra's backend, take a look at our :doc:`Python examples <../../examples/hardware_providers>`.
390+
To see a complete example for using QuEra's backend, take a look at our :doc:`C++ examples <../../examples/hardware_providers>`.
305391

306392
.. note::
307393

pr-2711/_sources/using/examples/hardware_providers.rst.txt

+10
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,11 @@ The following code illustrates how to run kernels on Pasqal's backends.
125125
.. literalinclude:: ../../targets/python/pasqal.py
126126
:language: python
127127

128+
.. tab:: C++
129+
130+
.. literalinclude:: ../../targets/cpp/pasqal.cpp
131+
:language: cpp
132+
128133

129134
Quantinuum
130135
==================================
@@ -151,3 +156,8 @@ The following code illustrates how to run kernels on QuEra's backends.
151156
.. literalinclude:: ../../targets/python/quera_basic.py
152157
:language: python
153158

159+
.. tab:: C++
160+
161+
.. literalinclude:: ../../targets/cpp/quera_basic.cpp
162+
:language: cpp
163+

pr-2711/applications/python/adapt_qaoa.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@ <h1>ADAPT-QAOA algorithm<a class="headerlink" href="#ADAPT-QAOA-algorithm" title
790790
parameter</p>
791791
<p>3- Optimize all parameters currently in the Ansatz <span class="math notranslate nohighlight">\(\beta_m, \gamma_m = 1, 2, ...k\)</span> such that <span class="math notranslate nohighlight">\(\braket{\psi (k)|H_C|\psi(k)}\)</span> is minimized, and return to the second step.</p>
792792
<p>Below is a schematic representation of the ADAPT-QAOA algorithm explained above.</p>
793-
<div><p><img alt="32aa93e6d321459abfc140fb6b19a2b9" class="no-scaled-link" src="../../_images/adapt-qaoa.png" style="width: 600px;" /></p>
793+
<div><p><img alt="daf11e79225f4a5c888b33a7581823e0" class="no-scaled-link" src="../../_images/adapt-qaoa.png" style="width: 600px;" /></p>
794794
</div><div class="nbinput nblast docutils container">
795795
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[ ]:
796796
</pre></div>

pr-2711/applications/python/deutschs_algorithm.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -847,7 +847,7 @@ <h2>XOR <span class="math notranslate nohighlight">\(\oplus\)</span><a class="he
847847
</section>
848848
<section id="Quantum-oracles">
849849
<h2>Quantum oracles<a class="headerlink" href="#Quantum-oracles" title="Permalink to this heading"></a></h2>
850-
<p><img alt="38c9ad2e9740475c9db5dddb22f57702" class="no-scaled-link" src="../../_images/oracle.png" style="width: 300px; height: 150px;" /></p>
850+
<p><img alt="1ab4a26063104ce6ae4a69ec470464f1" class="no-scaled-link" src="../../_images/oracle.png" style="width: 300px; height: 150px;" /></p>
851851
<p>Suppose we have <span class="math notranslate nohighlight">\(f(x): \{0,1\} \longrightarrow \{0,1\}\)</span>. We can compute this function on a quantum computer using oracles which we treat as black box functions that yield the output with an appropriate sequence of logical gates.</p>
852852
<p>Above you see an oracle represented as <span class="math notranslate nohighlight">\(U_f\)</span> which allows us to transform the state <span class="math notranslate nohighlight">\(\ket{x}\ket{y}\)</span> into:</p>
853853
<div class="math notranslate nohighlight">
@@ -895,7 +895,7 @@ <h2>Quantum parallelism<a class="headerlink" href="#Quantum-parallelism" title="
895895
<h2>Deutsch’s Algorithm:<a class="headerlink" href="#Deutsch's-Algorithm:" title="Permalink to this heading"></a></h2>
896896
<p>Our aim is to find out if <span class="math notranslate nohighlight">\(f: \{0,1\} \longrightarrow \{0,1\}\)</span> is a constant or a balanced function? If constant, <span class="math notranslate nohighlight">\(f(0) = f(1)\)</span>, and if balanced, <span class="math notranslate nohighlight">\(f(0) \neq f(1)\)</span>.</p>
897897
<p>We step through the circuit diagram below and follow the math after the application of each gate.</p>
898-
<p><img alt="d443918c3cbb4c7d8c30bece21fd7068" class="no-scaled-link" src="../../_images/deutsch.png" style="width: 500px; height: 210px;" /></p>
898+
<p><img alt="4f515c9a00e84296bfb9876d77822c2d" class="no-scaled-link" src="../../_images/deutsch.png" style="width: 500px; height: 210px;" /></p>
899899
<div class="math notranslate nohighlight">
900900
\[\ket{\psi_0} = \ket{01}
901901
\tag{1}\]</div>

pr-2711/applications/python/edge-detection.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ <h2>Image<a class="headerlink" href="#Image" title="Permalink to this heading">
827827
<section id="Quantum-Probability-Image-Encoding-(QPIE):">
828828
<h2>Quantum Probability Image Encoding (QPIE):<a class="headerlink" href="#Quantum-Probability-Image-Encoding-(QPIE):" title="Permalink to this heading"></a></h2>
829829
<p>Lets take as an example a classical 2x2 image (4 pixels). We can label each pixel with its position</p>
830-
<div><p><img alt="20b03a8a9ec34d9ab07567824d30bbde" class="no-scaled-link" src="../../_images/pixels-img.png" style="width: 200px;" /></p>
830+
<div><p><img alt="e10d2297a4cf4ed7a7066469082a0b54" class="no-scaled-link" src="../../_images/pixels-img.png" style="width: 200px;" /></p>
831831
</div><p>Each pixel will have its own color intensity represented along with its position label as an 8-bit black and white color. To convert the pixel intensity to probability amplitudes of a quantum state</p>
832832
<div class="math notranslate nohighlight">
833833
\[c_i = \frac{I_{yx}}{\sqrt(\sum I^2_{yx})}\]</div>

pr-2711/applications/python/quantum_transformer.html

+5-5
Large diffs are not rendered by default.

pr-2711/examples/python/performance_optimizations.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -775,9 +775,9 @@ <h1>Optimizing Performance<a class="headerlink" href="#Optimizing-Performance" t
775775
<section id="Gate-Fusion">
776776
<h2>Gate Fusion<a class="headerlink" href="#Gate-Fusion" title="Permalink to this heading"></a></h2>
777777
<p>Gate fusion is an optimization technique where consecutive gates are combined into a single gate operation to improve the efficiency of the simulation (See figure below). By targeting the <code class="docutils literal notranslate"><span class="pre">nvidia-mgpu</span></code> backend and setting the <code class="docutils literal notranslate"><span class="pre">CUDAQ_MGPU_FUSE</span></code> environment variable, you can select the degree of fusion that takes place. A full command line example would look like <code class="docutils literal notranslate"><span class="pre">CUDAQ_MGPU_FUSE=4</span> <span class="pre">python</span> <span class="pre">c2h2VQE.py</span> <span class="pre">--target</span> <span class="pre">nvidia</span> <span class="pre">--target-option</span> <span class="pre">fp64,mgpu</span></code></p>
778-
<p><img alt="b678221c2d5245d5a5c77800ba53701d" src="../../_images/gate-fuse.png" /></p>
778+
<p><img alt="26d92652f47d4940afe76934efed439c" src="../../_images/gate-fuse.png" /></p>
779779
<p>The importance of gate fusion is system dependent, but can have a large influence on the performance of the simulation. See the example below for a 24 qubit VQE experiment where changing the fusion level resulted in significant performance boosts.</p>
780-
<p><img alt="93a654c50b824d49acec568c73b79c8b" src="../../_images/gatefusion.png" /></p>
780+
<p><img alt="1d9205cf22224e7893f15d1880a7c5bb" src="../../_images/gatefusion.png" /></p>
781781
</section>
782782
</section>
783783

pr-2711/objects.inv

22 Bytes
Binary file not shown.

pr-2711/searchindex.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)