Skip to content

Commit

Permalink
Docs preview for PR #2502.
Browse files Browse the repository at this point in the history
  • Loading branch information
cuda-quantum-bot committed Jan 28, 2025
1 parent ce4d1e1 commit 1c30fbc
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 23 deletions.
6 changes: 6 additions & 0 deletions pr-2502/api/languages/cpp_api.html
Original file line number Diff line number Diff line change
Expand Up @@ -2546,6 +2546,12 @@ <h2>Noise Modeling<a class="headerlink" href="#noise-modeling" title="Permalink
<dd><p>The number of columns in the matrix NOTE we currently assume nRows == nCols. </p>
</dd></dl>

<dl class="cpp var">
<dt class="sig sig-object cpp" id="_CPPv4N5cudaq8kraus_op9precisionE">
<span class="target" id="structcudaq_1_1kraus__op_1a9139408e0100255c6445c9c18bf645e2"></span><span class="k"><span class="pre">const</span></span><span class="w"> </span><a class="reference internal" href="#_CPPv45cudaq" title="cudaq"><span class="n"><span class="pre">cudaq</span></span></a><span class="p"><span class="pre">::</span></span><a class="reference internal" href="#_CPPv4N5cudaq20simulation_precisionE" title="cudaq::simulation_precision"><span class="n"><span class="pre">simulation_precision</span></span></a><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">precision</span></span></span><span class="w"> </span><span class="p"><span class="pre">=</span></span><span class="w"> </span><span class="n"><span class="pre">std</span></span><span class="p"><span class="pre">::</span></span><span class="n"><span class="pre">is_same_v</span></span><span class="p"><span class="pre">&lt;</span></span><a class="reference internal" href="#_CPPv45cudaq" title="cudaq"><span class="n"><span class="pre">cudaq</span></span></a><span class="p"><span class="pre">::</span></span><a class="reference internal" href="#_CPPv4N5cudaq4realE" title="cudaq::real"><span class="n"><span class="pre">real</span></span></a><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="kt"><span class="pre">float</span></span><span class="p"><span class="pre">&gt;</span></span><span class="w"> </span><span class="o"><span class="pre">?</span></span><span class="w"> </span><a class="reference internal" href="#_CPPv45cudaq" title="cudaq"><span class="n"><span class="pre">cudaq</span></span></a><span class="p"><span class="pre">::</span></span><a class="reference internal" href="#_CPPv4N5cudaq20simulation_precisionE" title="cudaq::simulation_precision"><span class="n"><span class="pre">simulation_precision</span></span></a><span class="p"><span class="pre">::</span></span><a class="reference internal" href="#_CPPv4N5cudaq20simulation_precision4fp32E" title="cudaq::simulation_precision::fp32"><span class="n"><span class="pre">fp32</span></span></a><span class="w"> </span><span class="o"><span class="pre">:</span></span><span class="w"> </span><a class="reference internal" href="#_CPPv45cudaq" title="cudaq"><span class="n"><span class="pre">cudaq</span></span></a><span class="p"><span class="pre">::</span></span><a class="reference internal" href="#_CPPv4N5cudaq20simulation_precisionE" title="cudaq::simulation_precision"><span class="n"><span class="pre">simulation_precision</span></span></a><span class="p"><span class="pre">::</span></span><a class="reference internal" href="#_CPPv4N5cudaq20simulation_precision4fp64E" title="cudaq::simulation_precision::fp64"><span class="n"><span class="pre">fp64</span></span></a><a class="headerlink" href="#_CPPv4N5cudaq8kraus_op9precisionE" title="Permalink to this definition">¶</a><br /></dt>
<dd><p>The precision of the underlying data. </p>
</dd></dl>

</div>
</dd></dl>

Expand Down
4 changes: 2 additions & 2 deletions pr-2502/applications/python/deutschs_algorithm.html
Original file line number Diff line number Diff line change
Expand Up @@ -822,7 +822,7 @@ <h2>XOR <span class="math notranslate nohighlight">\(\oplus\)</span><a class="he
</section>
<section id="Quantum-oracles">
<h2>Quantum oracles<a class="headerlink" href="#Quantum-oracles" title="Permalink to this heading"></a></h2>
<p><img alt="c05df4f0a6284fefa38f389ea34ed2f4" class="no-scaled-link" src="../../_images/oracle.png" style="width: 300px; height: 150px;" /></p>
<p><img alt="f5f2fc7990ce44b3915cf5be44cd3f89" class="no-scaled-link" src="../../_images/oracle.png" style="width: 300px; height: 150px;" /></p>
<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>
<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>
<div class="math notranslate nohighlight">
Expand Down Expand Up @@ -870,7 +870,7 @@ <h2>Quantum parallelism<a class="headerlink" href="#Quantum-parallelism" title="
<h2>Deutsch’s Algorithm:<a class="headerlink" href="#Deutsch's-Algorithm:" title="Permalink to this heading"></a></h2>
<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>
<p>We step through the circuit diagram below and follow the math after the application of each gate.</p>
<p><img alt="13109cf348d941a7bf8cc5ff789e0679" class="no-scaled-link" src="../../_images/deutsch.png" style="width: 500px; height: 210px;" /></p>
<p><img alt="a15e7d630d9b4b51b0347dad2694a368" class="no-scaled-link" src="../../_images/deutsch.png" style="width: 500px; height: 210px;" /></p>
<div class="math notranslate nohighlight">
\[\ket{\psi_0} = \ket{01}
\tag{1}\]</div>
Expand Down
4 changes: 2 additions & 2 deletions pr-2502/examples/python/executing_photonic_kernels.html
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ <h2>Sample<a class="headerlink" href="#Sample" title="Permalink to this heading"
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
{ 02:383 11:260 20:357 }
{ 02:372 11:244 20:384 }

</pre></div></div>
</div>
Expand Down Expand Up @@ -894,7 +894,7 @@ <h2>Parallelization Techniques<a class="headerlink" href="#Parallelization-Techn
</div>
<div class="output_area docutils container">
<div class="highlight"><pre>
CUDA-Q Version (https://github.com/NVIDIA/cuda-quantum 4170129efe7e9e951b81c543331b796ef39fcb9b)
CUDA-Q Version (https://github.com/NVIDIA/cuda-quantum b8fd0c8c3feebd4d364378eb0473629b80c7b47c)
</pre></div></div>
</div>
</section>
Expand Down
28 changes: 14 additions & 14 deletions pr-2502/examples/python/executing_photonic_kernels.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
"execution_count": 1,
"metadata": {
"execution": {
"iopub.execute_input": "2025-01-28T07:09:07.558415Z",
"iopub.status.busy": "2025-01-28T07:09:07.558180Z",
"iopub.status.idle": "2025-01-28T07:09:10.209564Z",
"shell.execute_reply": "2025-01-28T07:09:10.208949Z"
"iopub.execute_input": "2025-01-28T18:07:37.993473Z",
"iopub.status.busy": "2025-01-28T18:07:37.993326Z",
"iopub.status.idle": "2025-01-28T18:07:40.805648Z",
"shell.execute_reply": "2025-01-28T18:07:40.804804Z"
}
},
"outputs": [
Expand All @@ -42,7 +42,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"{ 02:383 11:260 20:357 }\n",
"{ 02:372 11:244 20:384 }\n",
"\n"
]
}
Expand Down Expand Up @@ -95,10 +95,10 @@
"execution_count": 2,
"metadata": {
"execution": {
"iopub.execute_input": "2025-01-28T07:09:10.211494Z",
"iopub.status.busy": "2025-01-28T07:09:10.211228Z",
"iopub.status.idle": "2025-01-28T07:09:10.253997Z",
"shell.execute_reply": "2025-01-28T07:09:10.251462Z"
"iopub.execute_input": "2025-01-28T18:07:40.807924Z",
"iopub.status.busy": "2025-01-28T18:07:40.807478Z",
"iopub.status.idle": "2025-01-28T18:07:40.853103Z",
"shell.execute_reply": "2025-01-28T18:07:40.852346Z"
}
},
"outputs": [
Expand Down Expand Up @@ -183,18 +183,18 @@
"execution_count": 3,
"metadata": {
"execution": {
"iopub.execute_input": "2025-01-28T07:09:10.256153Z",
"iopub.status.busy": "2025-01-28T07:09:10.255928Z",
"iopub.status.idle": "2025-01-28T07:09:10.259123Z",
"shell.execute_reply": "2025-01-28T07:09:10.258601Z"
"iopub.execute_input": "2025-01-28T18:07:40.855090Z",
"iopub.status.busy": "2025-01-28T18:07:40.854767Z",
"iopub.status.idle": "2025-01-28T18:07:40.858091Z",
"shell.execute_reply": "2025-01-28T18:07:40.857638Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CUDA-Q Version (https://github.com/NVIDIA/cuda-quantum 4170129efe7e9e951b81c543331b796ef39fcb9b)\n"
"CUDA-Q Version (https://github.com/NVIDIA/cuda-quantum b8fd0c8c3feebd4d364378eb0473629b80c7b47c)\n"
]
}
],
Expand Down
4 changes: 2 additions & 2 deletions pr-2502/examples/python/performance_optimizations.html
Original file line number Diff line number Diff line change
Expand Up @@ -750,9 +750,9 @@ <h1>Optimizing Performance<a class="headerlink" href="#Optimizing-Performance" t
<section id="Gate-Fusion">
<h2>Gate Fusion<a class="headerlink" href="#Gate-Fusion" title="Permalink to this heading"></a></h2>
<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>
<p><img alt="86588f9decfc4ed99c9f142dd06ffed6" src="../../_images/gate-fuse.png" /></p>
<p><img alt="3f73e8d5d8024f65b2a86c6ab1d98734" src="../../_images/gate-fuse.png" /></p>
<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>
<p><img alt="a71be2275f334ce3813aca6091be2a07" src="../../_images/gatefusion.png" /></p>
<p><img alt="72bd74d339c241cf9e75b55c0b6c6fca" src="../../_images/gatefusion.png" /></p>
</section>
</section>

Expand Down
2 changes: 2 additions & 0 deletions pr-2502/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -1139,6 +1139,8 @@ <h2 id="C">C</h2>
<li><a href="api/languages/cpp_api.html#_CPPv4N5cudaq8kraus_op5nRowsE">cudaq::kraus_op::nRows (C++ member)</a>
</li>
<li><a href="api/languages/cpp_api.html#_CPPv4N5cudaq8kraus_opaSERK8kraus_op">cudaq::kraus_op::operator= (C++ function)</a>
</li>
<li><a href="api/languages/cpp_api.html#_CPPv4N5cudaq8kraus_op9precisionE">cudaq::kraus_op::precision (C++ member)</a>
</li>
<li><a href="api/languages/cpp_api.html#_CPPv4N5cudaq3mpiE">cudaq::mpi (C++ type)</a>
</li>
Expand Down
Binary file modified pr-2502/objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion pr-2502/searchindex.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def kernel():
# Apply the create gate to the qumode.
create(qumode) # |0⟩ -> |1⟩

# Apply the create gate to the qumode.
# Apply the annihilate gate to the qumode.
annihilate(qumode) # |1⟩ -> |0⟩

# Measurement operator.
Expand Down
2 changes: 1 addition & 1 deletion pr-2502/using/examples/photonic_operations.html
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ <h2>Quantum Photonics Gates<a class="headerlink" href="#quantum-photonics-gates"
<span class="c1"># Apply the create gate to the qumode.</span>
<span class="n">create</span><span class="p">(</span><span class="n">qumode</span><span class="p">)</span> <span class="c1"># |0⟩ -&gt; |1⟩</span>

<span class="c1"># Apply the create gate to the qumode.</span>
<span class="c1"># Apply the annihilate gate to the qumode.</span>
<span class="n">annihilate</span><span class="p">(</span><span class="n">qumode</span><span class="p">)</span> <span class="c1"># |1⟩ -&gt; |0⟩</span>

<span class="c1"># Measurement operator.</span>
Expand Down

0 comments on commit 1c30fbc

Please sign in to comment.