You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<p>Suppose we have <spanclass="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>
821
821
<p>Above you see an oracle represented as <spanclass="math notranslate nohighlight">\(U_f\)</span> which allows us to transform the state <spanclass="math notranslate nohighlight">\(\ket{x}\ket{y}\)</span> into:</p>
<h2>Deutsch’s Algorithm:<aclass="headerlink" href="#Deutsch's-Algorithm:" title="Permalink to this heading">¶</a></h2>
865
865
<p>Our aim is to find out if <spanclass="math notranslate nohighlight">\(f: \{0,1\} \longrightarrow \{0,1\}\)</span> is a constant or a balanced function? If constant, <spanclass="math notranslate nohighlight">\(f(0) = f(1)\)</span>, and if balanced, <spanclass="math notranslate nohighlight">\(f(0) \neq f(1)\)</span>.</p>
866
866
<p>We step through the circuit diagram below and follow the math after the application of each gate.</p>
Copy file name to clipboardexpand all lines: pr-2660/examples/python/performance_optimizations.html
+2-2
Original file line number
Diff line number
Diff line change
@@ -744,9 +744,9 @@ <h1>Optimizing Performance<a class="headerlink" href="#Optimizing-Performance" t
744
744
<sectionid="Gate-Fusion">
745
745
<h2>Gate Fusion<aclass="headerlink" href="#Gate-Fusion" title="Permalink to this heading">¶</a></h2>
746
746
<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 <codeclass="docutils literal notranslate"><spanclass="pre">nvidia-mgpu</span></code> backend and setting the <codeclass="docutils literal notranslate"><spanclass="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 <codeclass="docutils literal notranslate"><spanclass="pre">CUDAQ_MGPU_FUSE=4</span><spanclass="pre">python</span><spanclass="pre">c2h2VQE.py</span><spanclass="pre">--target</span><spanclass="pre">nvidia</span><spanclass="pre">--target-option</span><spanclass="pre">fp64,mgpu</span></code></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>
<li><ahref="api/languages/python_api.html#cudaq.operator.expressions.ElementaryOperator.define">define() (cudaq.operator.expressions.ElementaryOperator class method)</a>
1693
+
</li>
1694
+
<li><ahref="api/languages/python_api.html#cudaq.Depolarization1">Depolarization1 (class in cudaq)</a>
1695
+
</li>
1696
+
<li><ahref="api/languages/python_api.html#cudaq.Depolarization2">Depolarization2 (class in cudaq)</a>
1666
1697
</li>
1667
1698
<li><ahref="api/languages/python_api.html#cudaq.DepolarizationChannel">DepolarizationChannel (class in cudaq)</a>
0 commit comments