Skip to content

Commit

Permalink
Docs preview for PR #2533.
Browse files Browse the repository at this point in the history
  • Loading branch information
cuda-quantum-bot committed Jan 31, 2025
1 parent 5796b32 commit 34c530c
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 23 deletions.
6 changes: 6 additions & 0 deletions pr-2533/api/languages/cpp_api.html
Original file line number Diff line number Diff line change
Expand Up @@ -1550,6 +1550,12 @@ <h2>Common<a class="headerlink" href="#common" title="Permalink to this heading"
<dd><p>The number of trajectories to be used for an expectation calculation on simulation backends that support trajectory simulation. </p>
</dd></dl>

<dl class="cpp var">
<dt class="sig sig-object cpp" id="_CPPv4N5cudaq16ExecutionContext9outputLogE">
<span class="target" id="classcudaq_1_1ExecutionContext_1acb803bc82b3d3a66c638c003a2a4e6ea"></span><span class="n"><span class="pre">std</span></span><span class="p"><span class="pre">::</span></span><span class="n"><span class="pre">string</span></span><span class="w"> </span><span class="sig-name descname"><span class="n"><span class="pre">outputLog</span></span></span><a class="headerlink" href="#_CPPv4N5cudaq16ExecutionContext9outputLogE" title="Permalink to this definition">¶</a><br /></dt>
<dd><p>A string containing the output logging of a kernel launched with cudaq::run. </p>
</dd></dl>

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

Expand Down
4 changes: 2 additions & 2 deletions pr-2533/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="342733c00fbb4cd68df78e4316a2dfa3" class="no-scaled-link" src="../../_images/oracle.png" style="width: 300px; height: 150px;" /></p>
<p><img alt="988afb67f4334360acd2cf5afdb22507" 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="7fc95401925a423aafc269d07b939e89" class="no-scaled-link" src="../../_images/deutsch.png" style="width: 500px; height: 210px;" /></p>
<p><img alt="3ae66d34086a42c4a2c05e05ff0240e6" 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-2533/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:361 11:240 20:399 }
{ 02:379 11:255 20:366 }

</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 c594e2d9c494c0a07cfb154b5efb9397760428dd)
CUDA-Q Version (https://github.com/NVIDIA/cuda-quantum 8505897ac27b90e4f1947966369f35184f7f3632)
</pre></div></div>
</div>
</section>
Expand Down
28 changes: 14 additions & 14 deletions pr-2533/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-30T01:08:29.677587Z",
"iopub.status.busy": "2025-01-30T01:08:29.677304Z",
"iopub.status.idle": "2025-01-30T01:08:32.316367Z",
"shell.execute_reply": "2025-01-30T01:08:32.315698Z"
"iopub.execute_input": "2025-01-31T08:36:28.826553Z",
"iopub.status.busy": "2025-01-31T08:36:28.826393Z",
"iopub.status.idle": "2025-01-31T08:36:31.532710Z",
"shell.execute_reply": "2025-01-31T08:36:31.531647Z"
}
},
"outputs": [
Expand All @@ -42,7 +42,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"{ 02:361 11:240 20:399 }\n",
"{ 02:379 11:255 20:366 }\n",
"\n"
]
}
Expand Down Expand Up @@ -95,10 +95,10 @@
"execution_count": 2,
"metadata": {
"execution": {
"iopub.execute_input": "2025-01-30T01:08:32.318191Z",
"iopub.status.busy": "2025-01-30T01:08:32.317882Z",
"iopub.status.idle": "2025-01-30T01:08:32.360781Z",
"shell.execute_reply": "2025-01-30T01:08:32.360190Z"
"iopub.execute_input": "2025-01-31T08:36:31.535230Z",
"iopub.status.busy": "2025-01-31T08:36:31.534955Z",
"iopub.status.idle": "2025-01-31T08:36:31.577603Z",
"shell.execute_reply": "2025-01-31T08:36:31.574121Z"
}
},
"outputs": [
Expand Down Expand Up @@ -183,18 +183,18 @@
"execution_count": 3,
"metadata": {
"execution": {
"iopub.execute_input": "2025-01-30T01:08:32.362193Z",
"iopub.status.busy": "2025-01-30T01:08:32.362061Z",
"iopub.status.idle": "2025-01-30T01:08:32.364661Z",
"shell.execute_reply": "2025-01-30T01:08:32.364236Z"
"iopub.execute_input": "2025-01-31T08:36:31.580196Z",
"iopub.status.busy": "2025-01-31T08:36:31.580040Z",
"iopub.status.idle": "2025-01-31T08:36:31.583683Z",
"shell.execute_reply": "2025-01-31T08:36:31.582795Z"
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"CUDA-Q Version (https://github.com/NVIDIA/cuda-quantum c594e2d9c494c0a07cfb154b5efb9397760428dd)\n"
"CUDA-Q Version (https://github.com/NVIDIA/cuda-quantum 8505897ac27b90e4f1947966369f35184f7f3632)\n"
]
}
],
Expand Down
4 changes: 2 additions & 2 deletions pr-2533/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="2bf598db89054ce991173c3e12ff0189" src="../../_images/gate-fuse.png" /></p>
<p><img alt="80aea6249e374f82a895703bf3b3df98" 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="46a59b1f8d8d4e559106629e703f5cac" src="../../_images/gatefusion.png" /></p>
<p><img alt="d3274086178249c6a1e3082eb1c8cdf7" src="../../_images/gatefusion.png" /></p>
</section>
</section>

Expand Down
6 changes: 4 additions & 2 deletions pr-2533/genindex.html
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,8 @@ <h2 id="C">C</h2>
<li><a href="api/languages/cpp_api.html#_CPPv4N5cudaq16ExecutionContext18numberTrajectoriesE">cudaq::ExecutionContext::numberTrajectories (C++ member)</a>
</li>
<li><a href="api/languages/cpp_api.html#_CPPv4N5cudaq16ExecutionContext9optResultE">cudaq::ExecutionContext::optResult (C++ member)</a>
</li>
<li><a href="api/languages/cpp_api.html#_CPPv4N5cudaq16ExecutionContext9outputLogE">cudaq::ExecutionContext::outputLog (C++ member)</a>
</li>
<li><a href="api/languages/cpp_api.html#_CPPv4N5cudaq16ExecutionContext20overlapComputeStatesE">cudaq::ExecutionContext::overlapComputeStates (C++ member)</a>
</li>
Expand Down Expand Up @@ -1247,11 +1249,11 @@ <h2 id="C">C</h2>
<li><a href="api/languages/cpp_api.html#_CPPv4N5cudaq3QPU12launchKernelERKNSt6stringE15KernelThunkTypePvNSt8uint64_tENSt8uint64_tERKNSt6vectorIPvEE">cudaq::QPU::launchKernel (C++ function)</a>, <a href="api/languages/cpp_api.html#_CPPv4N5cudaq3QPU12launchKernelERKNSt6stringERKNSt6vectorIPvEE">[1]</a>
</li>
<li><a href="api/languages/cpp_api.html#_CPPv4N5cudaq3QPU29launchSerializedCodeExecutionERKNSt6stringERN5cudaq30SerializedCodeExecutionContextE">cudaq::QPU::launchSerializedCodeExecution (C++ function)</a>
</li>
<li><a href="api/languages/cpp_api.html#_CPPv4N5cudaq3QPU15onRandomSeedSetENSt6size_tE">cudaq::QPU::onRandomSeedSet (C++ function)</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="api/languages/cpp_api.html#_CPPv4N5cudaq3QPU15onRandomSeedSetENSt6size_tE">cudaq::QPU::onRandomSeedSet (C++ function)</a>
</li>
<li><a href="api/languages/cpp_api.html#_CPPv4N5cudaq3QPU3QPUENSt6size_tE">cudaq::QPU::QPU (C++ function)</a>, <a href="api/languages/cpp_api.html#_CPPv4N5cudaq3QPU3QPUERR3QPU">[1]</a>, <a href="api/languages/cpp_api.html#_CPPv4N5cudaq3QPU3QPUEv">[2]</a>
</li>
<li><a href="api/languages/cpp_api.html#_CPPv4N5cudaq3QPU21resetExecutionContextEv">cudaq::QPU::resetExecutionContext (C++ function)</a>
Expand Down
Binary file modified pr-2533/objects.inv
Binary file not shown.
2 changes: 1 addition & 1 deletion pr-2533/searchindex.js

Large diffs are not rendered by default.

0 comments on commit 34c530c

Please sign in to comment.