Skip to content

Commit b2b94a0

Browse files
Docs preview for PR #3363.
1 parent d6fd8a1 commit b2b94a0

File tree

13 files changed

+33
-18
lines changed

13 files changed

+33
-18
lines changed

pr-3363/_sources/using/install/local_installation.rst.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -896,6 +896,11 @@ The following table summarizes the required components.
896896

897897
Detailed information about supported drivers for different CUDA versions and be found `here <https://docs.nvidia.com/deploy/cuda-compatibility/>`__.
898898

899+
.. note::
900+
901+
Tegra devices (Jetson) are not supported in CUDA-Q at this time.
902+
903+
For more information, please refer to `Binary Compatibility documentation <https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#binary-compatibility>`_.
899904

900905
.. _post-installation:
901906

pr-3363/api/languages/python_api.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2390,7 +2390,7 @@ <h3>Spin Operators<a class="headerlink" href="#spin-operators" title="Permalink
23902390
<em class="property"><span class="pre">static</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">random</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cudaq.operators.spin.SpinOperator.random" title="Permalink to this definition">¶</a></dt>
23912391
<dd><dl class="py function">
23922392
<dt class="sig sig-object py">
2393-
<span class="sig-name descname"><span class="pre">random</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">qubit_count</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.13)"><span class="pre">int</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">term_count</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.13)"><span class="pre">int</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">seed</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.13)"><span class="pre">int</span></a></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">2146644417</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="#cudaq.operators.spin.SpinOperator" title="cudaq.operators.spin.SpinOperator"><span class="pre">SpinOperator</span></a></span></span></dt>
2393+
<span class="sig-name descname"><span class="pre">random</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">qubit_count</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.13)"><span class="pre">int</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">term_count</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.13)"><span class="pre">int</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">seed</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.13)"><span class="pre">int</span></a></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">2269077361</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="#cudaq.operators.spin.SpinOperator" title="cudaq.operators.spin.SpinOperator"><span class="pre">SpinOperator</span></a></span></span></dt>
23942394
<dd></dd></dl>
23952395

23962396
<p>Return a random spin operator with the given number of terms (<code class="code docutils literal notranslate"><span class="pre">term_count</span></code>) where each term acts on all targets in the open range [0, qubit_count). An optional seed value may also be provided.</p>

pr-3363/applications/python/adapt_qaoa.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -979,7 +979,7 @@ <h1>ADAPT-QAOA algorithm<a class="headerlink" href="#ADAPT-QAOA-algorithm" title
979979
parameter</p>
980980
<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>
981981
<p>Below is a schematic representation of the ADAPT-QAOA algorithm explained above.</p>
982-
<div><p><img alt="7312358ae1184574a1467a68bddf2671" class="no-scaled-link" src="../../_images/adapt-qaoa.png" style="width: 1000px;" /></p>
982+
<div><p><img alt="4dcb0101d11b4faea1b234ea21c0bfd7" class="no-scaled-link" src="../../_images/adapt-qaoa.png" style="width: 1000px;" /></p>
983983
</div><div class="nbinput nblast docutils container">
984984
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[15]:
985985
</pre></div>

pr-3363/applications/python/adapt_vqe.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ <h1>ADAPT-VQE algorithm<a class="headerlink" href="#ADAPT-VQE-algorithm" title="
976976
<p>7- Perform a VQE experiment to re-optimize all parameters in the ansatz.</p>
977977
<p>8- go to step 4</p>
978978
<p>Below is a Schematic depiction of the ADAPT-VQE algorithm</p>
979-
<div><p><img alt="c8536a5dd8184b419d3b902f954401ba" class="no-scaled-link" src="../../_images/adapt-vqe.png" style="width: 800px;" /></p>
979+
<div><p><img alt="7559e468b0054ae0ae3c2129ea4d357e" class="no-scaled-link" src="../../_images/adapt-vqe.png" style="width: 800px;" /></p>
980980
</div><div class="nbinput docutils container">
981981
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[1]:
982982
</pre></div>

pr-3363/applications/python/deutsch_algorithm.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,7 +1036,7 @@ <h2>XOR <span class="math notranslate nohighlight">\(\oplus\)</span><a class="he
10361036
</section>
10371037
<section id="Quantum-oracles">
10381038
<h2>Quantum oracles<a class="headerlink" href="#Quantum-oracles" title="Permalink to this heading"></a></h2>
1039-
<p><img alt="96e23e48b0f446d791dde37c5e9012be" class="no-scaled-link" src="../../_images/oracle.png" style="width: 300px; height: 150px;" /></p>
1039+
<p><img alt="21a143c973594b5785b913a8da98ec8e" class="no-scaled-link" src="../../_images/oracle.png" style="width: 300px; height: 150px;" /></p>
10401040
<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>
10411041
<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>
10421042
<div class="math notranslate nohighlight">
@@ -1084,7 +1084,7 @@ <h2>Quantum parallelism<a class="headerlink" href="#Quantum-parallelism" title="
10841084
<h2>Deutsch’s Algorithm:<a class="headerlink" href="#Deutsch's-Algorithm:" title="Permalink to this heading"></a></h2>
10851085
<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>
10861086
<p>We step through the circuit diagram below and follow the math after the application of each gate.</p>
1087-
<p><img alt="15ed5214dba444ba885358f3686bf133" class="no-scaled-link" src="../../_images/deutsch.png" style="width: 500px; height: 210px;" /></p>
1087+
<p><img alt="1f031e375d784fb3b6dd481de7170fd5" class="no-scaled-link" src="../../_images/deutsch.png" style="width: 500px; height: 210px;" /></p>
10881088
<div class="math notranslate nohighlight">
10891089
\[\ket{\psi_0} = \ket{01}
10901090
\tag{1}\]</div>

pr-3363/applications/python/edge_detection.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ <h2>Image<a class="headerlink" href="#Image" title="Permalink to this heading">
10161016
<section id="Quantum-Probability-Image-Encoding-(QPIE):">
10171017
<h2>Quantum Probability Image Encoding (QPIE):<a class="headerlink" href="#Quantum-Probability-Image-Encoding-(QPIE):" title="Permalink to this heading"></a></h2>
10181018
<p>Lets take as an example a classical 2x2 image (4 pixels). We can label each pixel with its position</p>
1019-
<div><p><img alt="e8fbab2e7456483a84a784c1bc6a9ea3" class="no-scaled-link" src="../../_images/pixels-img.png" style="width: 200px;" /></p>
1019+
<div><p><img alt="99214e1cb83c40bf8fa9b697363b6343" class="no-scaled-link" src="../../_images/pixels-img.png" style="width: 200px;" /></p>
10201020
</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>
10211021
<div class="math notranslate nohighlight">
10221022
\[c_i = \frac{I_{yx}}{\sqrt(\sum I^2_{yx})}\]</div>

pr-3363/applications/python/grovers.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1058,7 +1058,7 @@ <h3>Good and Bad States<a class="headerlink" href="#Good-and-Bad-States" title="
10581058
<p>Let us now examine the geometric picture behind our current discussion. We’ll consider the ambient Hilbert space to be spanned by the standard basis vectors <span class="math notranslate nohighlight">\(|0\rangle, |1\rangle, \dots, |N-1\rangle\)</span>, where the full dimension is <span class="math notranslate nohighlight">\(N = 2^n\)</span>. Since the uniform superposition state <span class="math notranslate nohighlight">\(|\xi\rangle\)</span> can be expressed as a linear combination of the states <span class="math notranslate nohighlight">\(|G\rangle\)</span> and <span class="math notranslate nohighlight">\(|B\rangle\)</span> with real coefficients, all three states <span class="math notranslate nohighlight">\(|\xi\rangle, |G\rangle,\)</span> and <span class="math notranslate nohighlight">\(|B\rangle\)</span>
10591059
reside in a two-dimensional real subspace of the ambient Hilbert space, which we can visualize as a 2D plane as in the image below. Since, <span class="math notranslate nohighlight">\(|G\rangle\)</span> and <span class="math notranslate nohighlight">\(|B\rangle\)</span> are orthogonal, we can imagine them graphed as unit vectors in the positive <span class="math notranslate nohighlight">\(y\)</span> and positive <span class="math notranslate nohighlight">\(x\)</span> directions, respectively. From our previous expression, <span class="math notranslate nohighlight">\(\ket{\xi} = \sin(\theta) |G\rangle + \cos(\theta) |B\rangle,\)</span> we see that the state <span class="math notranslate nohighlight">\(|\xi\rangle\)</span> forms an angle <span class="math notranslate nohighlight">\(\theta\)</span> with
10601060
<span class="math notranslate nohighlight">\(|B\rangle\)</span>.</p>
1061-
<div style="text-align: center;"><p><img alt="957eff0f1e2d425790f44a951ef6bca3" src="../../_images/grovers-2D-plane.png" /></p>
1061+
<div style="text-align: center;"><p><img alt="46c689f65d2a4556be0510507080d2db" src="../../_images/grovers-2D-plane.png" /></p>
10621062
</div><p>Given that the number of marked states <span class="math notranslate nohighlight">\(t\)</span> is typically small compared to <span class="math notranslate nohighlight">\(N\)</span>, it follows that <span class="math notranslate nohighlight">\(\theta = \arcsin\left(\sqrt{\frac{t}{N}}\right)\)</span> is a small angle. This assumption is reasonable, as otherwise, a sufficient number of independent queries to the oracle would likely yield a solution through classical search methods.</p>
10631063
</section>
10641064
<section id="Step-2:-Oracle-application">
@@ -1173,9 +1173,9 @@ <h4>Completing Step 3<a class="headerlink" href="#Completing-Step-3" title="Perm
11731173
<div class="math notranslate nohighlight">
11741174
\[\mathcal{G} = r_\xi \circ r_B = H^{\otimes n} \big( 2|0^{\otimes n} \rangle \langle 0^{\otimes n}| - \text{Id} \big) H^{\otimes n} \mathcal{O}_f.\]</div>
11751175
<p>The circuit diagram below puts together steps 1 through 3:</p>
1176-
<div style="text-align: center;"><p><img alt="d066b6e4bd4d4b869d8c30fa102f8857" src="../../_images/grovers-steps1-3.png" /></p>
1176+
<div style="text-align: center;"><p><img alt="b85d1e0d9c744b51908fc75f216cc828" src="../../_images/grovers-steps1-3.png" /></p>
11771177
</div><p>Running this circuit initializes <span class="math notranslate nohighlight">\(\ket{\xi}\)</span> and performs a rotation by <span class="math notranslate nohighlight">\(2\theta\)</span> (twice the angle between <span class="math notranslate nohighlight">\(|\xi\rangle\)</span> and <span class="math notranslate nohighlight">\(|B\rangle\)</span>) in the direction from <span class="math notranslate nohighlight">\(|B\rangle\)</span> to <span class="math notranslate nohighlight">\(|G\rangle\)</span>.</p>
1178-
<div style="text-align: center;"><p><img alt="e33f5d883e76487a92348fc55fa335b5" src="../../_images/grovers-full-rotation.png" /></p>
1178+
<div style="text-align: center;"><p><img alt="dc25b897a2bc4ba7becae45666500f32" src="../../_images/grovers-full-rotation.png" /></p>
11791179
</div><p>Let’s verify that the state resulting from one iteration of Grover’s algorithm brings us closer to the good state, <span class="math notranslate nohighlight">\(\ket{G}\)</span>. In particular, notice that the amplitudes of <code class="docutils literal notranslate"><span class="pre">1001</span></code> and <code class="docutils literal notranslate"><span class="pre">1111</span></code> in the resulting state have been amplified compared to the equal superposition of states.</p>
11801180
<div class="nbinput docutils container">
11811181
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[18]:

pr-3363/applications/python/qm_mm_pe.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ <h2>Key concepts:<a class="headerlink" href="#Key-concepts:" title="Permalink to
976976
</section>
977977
<section id="PE-VQE-SCF-Algorithm-Steps">
978978
<h2>PE-VQE-SCF Algorithm Steps<a class="headerlink" href="#PE-VQE-SCF-Algorithm-Steps" title="Permalink to this heading"></a></h2>
979-
<div><p><img alt="14d09ea914b2466dbc67bb7de71d29dc" class="no-scaled-link" src="../../_images/qm-mm-pe.png" style="width: 600px;" /></p>
979+
<div><p><img alt="bda7f9ecfbf3498795839d7b51933806" class="no-scaled-link" src="../../_images/qm-mm-pe.png" style="width: 600px;" /></p>
980980
</div><section id="Step-1:-Initialize-(Classical-pre-processing)">
981981
<h3>Step 1: Initialize (Classical pre-processing)<a class="headerlink" href="#Step-1:-Initialize-(Classical-pre-processing)" title="Permalink to this heading"></a></h3>
982982
<ul class="simple">

pr-3363/applications/python/quantum_transformer.html

Lines changed: 5 additions & 5 deletions
Large diffs are not rendered by default.

pr-3363/examples/python/performance_optimizations.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -964,9 +964,9 @@ <h1>Optimizing Performance<a class="headerlink" href="#Optimizing-Performance" t
964964
<section id="Gate-Fusion">
965965
<h2>Gate Fusion<a class="headerlink" href="#Gate-Fusion" title="Permalink to this heading"></a></h2>
966966
<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>
967-
<p><img alt="8ddab7db27714ad98d6d8344e3f6619b" src="../../_images/gate-fuse.png" /></p>
967+
<p><img alt="f959e985f2d94108b95d9ccee29a6922" src="../../_images/gate-fuse.png" /></p>
968968
<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>
969-
<p><img alt="1f9b87d45f854bf29b585dd1b30775c0" src="../../_images/gatefusion.png" /></p>
969+
<p><img alt="c1dcf67322374cc39ee720db4f88c54c" src="../../_images/gatefusion.png" /></p>
970970
</section>
971971
</section>
972972

0 commit comments

Comments
 (0)