Skip to content

Commit d00246d

Browse files
Docs preview for PR #2596.
1 parent 452cb70 commit d00246d

File tree

101 files changed

+494
-304
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+494
-304
lines changed

pr-2596/_sources/applications/python/deutsch_jozsa.ipynb.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"id": "7aa9cc8f-4e42-401f-a1fd-665e5cda19c7",
66
"metadata": {},
77
"source": [
8-
"## _*The Deutsch-Jozsa Algorithm*_\n",
8+
"# The Deutsch-Jozsa Algorithm\n",
99
"\n",
1010
"Here is the link to the original paper: [Deutsch-Jozsa algorithm](http://rspa.royalsocietypublishing.org/content/439/1907/553). This algorithm is an earlier demonstration of the computational advantage of quantum algorithm over classical one. It addresses the problem of identifying the nature of a hidden Boolean function, which is provided as an oracle. The function is guaranteed to be either:\n",
1111
"\n",

pr-2596/api/api.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,11 @@
227227
<li class="toctree-l3"><a class="reference internal" href="../applications/python/deutschs_algorithm.html#Deutsch's-Algorithm:">Deutsch’s Algorithm:</a></li>
228228
</ul>
229229
</li>
230-
<li class="toctree-l2"><a class="reference internal" href="../applications/python/deutsch_jozsa.html"><em>The Deutsch-Jozsa Algorithm</em></a></li>
231-
<li class="toctree-l2"><a class="reference internal" href="../applications/python/deutsch_jozsa.html#The-Theory">The Theory</a></li>
232-
<li class="toctree-l2"><a class="reference internal" href="../applications/python/deutsch_jozsa.html#The-Algorithm-Implementation">The Algorithm Implementation</a></li>
230+
<li class="toctree-l2"><a class="reference internal" href="../applications/python/deutsch_jozsa.html">The Deutsch-Jozsa Algorithm</a><ul>
231+
<li class="toctree-l3"><a class="reference internal" href="../applications/python/deutsch_jozsa.html#The-Theory">The Theory</a></li>
232+
<li class="toctree-l3"><a class="reference internal" href="../applications/python/deutsch_jozsa.html#The-Algorithm-Implementation">The Algorithm Implementation</a></li>
233+
</ul>
234+
</li>
233235
<li class="toctree-l2"><a class="reference internal" href="../applications/python/hamiltonian_simulation.html">Spin-Hamiltonian Simulation Using CUDA-Q</a><ul>
234236
<li class="toctree-l3"><a class="reference internal" href="../applications/python/hamiltonian_simulation.html#Introduction">Introduction</a><ul>
235237
<li class="toctree-l4"><a class="reference internal" href="../applications/python/hamiltonian_simulation.html#Heisenberg-Hamiltonian">Heisenberg Hamiltonian</a></li>

pr-2596/api/default_ops.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,9 +229,11 @@
229229
<li class="toctree-l3"><a class="reference internal" href="../applications/python/deutschs_algorithm.html#Deutsch's-Algorithm:">Deutsch’s Algorithm:</a></li>
230230
</ul>
231231
</li>
232-
<li class="toctree-l2"><a class="reference internal" href="../applications/python/deutsch_jozsa.html"><em>The Deutsch-Jozsa Algorithm</em></a></li>
233-
<li class="toctree-l2"><a class="reference internal" href="../applications/python/deutsch_jozsa.html#The-Theory">The Theory</a></li>
234-
<li class="toctree-l2"><a class="reference internal" href="../applications/python/deutsch_jozsa.html#The-Algorithm-Implementation">The Algorithm Implementation</a></li>
232+
<li class="toctree-l2"><a class="reference internal" href="../applications/python/deutsch_jozsa.html">The Deutsch-Jozsa Algorithm</a><ul>
233+
<li class="toctree-l3"><a class="reference internal" href="../applications/python/deutsch_jozsa.html#The-Theory">The Theory</a></li>
234+
<li class="toctree-l3"><a class="reference internal" href="../applications/python/deutsch_jozsa.html#The-Algorithm-Implementation">The Algorithm Implementation</a></li>
235+
</ul>
236+
</li>
235237
<li class="toctree-l2"><a class="reference internal" href="../applications/python/hamiltonian_simulation.html">Spin-Hamiltonian Simulation Using CUDA-Q</a><ul>
236238
<li class="toctree-l3"><a class="reference internal" href="../applications/python/hamiltonian_simulation.html#Introduction">Introduction</a><ul>
237239
<li class="toctree-l4"><a class="reference internal" href="../applications/python/hamiltonian_simulation.html#Heisenberg-Hamiltonian">Heisenberg Hamiltonian</a></li>

pr-2596/api/languages/cpp_api.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,11 @@
227227
<li class="toctree-l3"><a class="reference internal" href="../../applications/python/deutschs_algorithm.html#Deutsch's-Algorithm:">Deutsch’s Algorithm:</a></li>
228228
</ul>
229229
</li>
230-
<li class="toctree-l2"><a class="reference internal" href="../../applications/python/deutsch_jozsa.html"><em>The Deutsch-Jozsa Algorithm</em></a></li>
231-
<li class="toctree-l2"><a class="reference internal" href="../../applications/python/deutsch_jozsa.html#The-Theory">The Theory</a></li>
232-
<li class="toctree-l2"><a class="reference internal" href="../../applications/python/deutsch_jozsa.html#The-Algorithm-Implementation">The Algorithm Implementation</a></li>
230+
<li class="toctree-l2"><a class="reference internal" href="../../applications/python/deutsch_jozsa.html">The Deutsch-Jozsa Algorithm</a><ul>
231+
<li class="toctree-l3"><a class="reference internal" href="../../applications/python/deutsch_jozsa.html#The-Theory">The Theory</a></li>
232+
<li class="toctree-l3"><a class="reference internal" href="../../applications/python/deutsch_jozsa.html#The-Algorithm-Implementation">The Algorithm Implementation</a></li>
233+
</ul>
234+
</li>
233235
<li class="toctree-l2"><a class="reference internal" href="../../applications/python/hamiltonian_simulation.html">Spin-Hamiltonian Simulation Using CUDA-Q</a><ul>
234236
<li class="toctree-l3"><a class="reference internal" href="../../applications/python/hamiltonian_simulation.html#Introduction">Introduction</a><ul>
235237
<li class="toctree-l4"><a class="reference internal" href="../../applications/python/hamiltonian_simulation.html#Heisenberg-Hamiltonian">Heisenberg Hamiltonian</a></li>

pr-2596/api/languages/python_api.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,9 +227,11 @@
227227
<li class="toctree-l3"><a class="reference internal" href="../../applications/python/deutschs_algorithm.html#Deutsch's-Algorithm:">Deutsch’s Algorithm:</a></li>
228228
</ul>
229229
</li>
230-
<li class="toctree-l2"><a class="reference internal" href="../../applications/python/deutsch_jozsa.html"><em>The Deutsch-Jozsa Algorithm</em></a></li>
231-
<li class="toctree-l2"><a class="reference internal" href="../../applications/python/deutsch_jozsa.html#The-Theory">The Theory</a></li>
232-
<li class="toctree-l2"><a class="reference internal" href="../../applications/python/deutsch_jozsa.html#The-Algorithm-Implementation">The Algorithm Implementation</a></li>
230+
<li class="toctree-l2"><a class="reference internal" href="../../applications/python/deutsch_jozsa.html">The Deutsch-Jozsa Algorithm</a><ul>
231+
<li class="toctree-l3"><a class="reference internal" href="../../applications/python/deutsch_jozsa.html#The-Theory">The Theory</a></li>
232+
<li class="toctree-l3"><a class="reference internal" href="../../applications/python/deutsch_jozsa.html#The-Algorithm-Implementation">The Algorithm Implementation</a></li>
233+
</ul>
234+
</li>
233235
<li class="toctree-l2"><a class="reference internal" href="../../applications/python/hamiltonian_simulation.html">Spin-Hamiltonian Simulation Using CUDA-Q</a><ul>
234236
<li class="toctree-l3"><a class="reference internal" href="../../applications/python/hamiltonian_simulation.html#Introduction">Introduction</a><ul>
235237
<li class="toctree-l4"><a class="reference internal" href="../../applications/python/hamiltonian_simulation.html#Heisenberg-Hamiltonian">Heisenberg Hamiltonian</a></li>

pr-2596/applications/python/afqmc.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,11 @@
230230
<li class="toctree-l3"><a class="reference internal" href="deutschs_algorithm.html#Deutsch's-Algorithm:">Deutsch’s Algorithm:</a></li>
231231
</ul>
232232
</li>
233-
<li class="toctree-l2"><a class="reference internal" href="deutsch_jozsa.html"><em>The Deutsch-Jozsa Algorithm</em></a></li>
234-
<li class="toctree-l2"><a class="reference internal" href="deutsch_jozsa.html#The-Theory">The Theory</a></li>
235-
<li class="toctree-l2"><a class="reference internal" href="deutsch_jozsa.html#The-Algorithm-Implementation">The Algorithm Implementation</a></li>
233+
<li class="toctree-l2"><a class="reference internal" href="deutsch_jozsa.html">The Deutsch-Jozsa Algorithm</a><ul>
234+
<li class="toctree-l3"><a class="reference internal" href="deutsch_jozsa.html#The-Theory">The Theory</a></li>
235+
<li class="toctree-l3"><a class="reference internal" href="deutsch_jozsa.html#The-Algorithm-Implementation">The Algorithm Implementation</a></li>
236+
</ul>
237+
</li>
236238
<li class="toctree-l2"><a class="reference internal" href="hamiltonian_simulation.html">Spin-Hamiltonian Simulation Using CUDA-Q</a><ul>
237239
<li class="toctree-l3"><a class="reference internal" href="hamiltonian_simulation.html#Introduction">Introduction</a><ul>
238240
<li class="toctree-l4"><a class="reference internal" href="hamiltonian_simulation.html#Heisenberg-Hamiltonian">Heisenberg Hamiltonian</a></li>

pr-2596/applications/python/bernstein_vazirani.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,11 @@
230230
<li class="toctree-l3"><a class="reference internal" href="deutschs_algorithm.html#Deutsch's-Algorithm:">Deutsch’s Algorithm:</a></li>
231231
</ul>
232232
</li>
233-
<li class="toctree-l2"><a class="reference internal" href="deutsch_jozsa.html"><em>The Deutsch-Jozsa Algorithm</em></a></li>
234-
<li class="toctree-l2"><a class="reference internal" href="deutsch_jozsa.html#The-Theory">The Theory</a></li>
235-
<li class="toctree-l2"><a class="reference internal" href="deutsch_jozsa.html#The-Algorithm-Implementation">The Algorithm Implementation</a></li>
233+
<li class="toctree-l2"><a class="reference internal" href="deutsch_jozsa.html">The Deutsch-Jozsa Algorithm</a><ul>
234+
<li class="toctree-l3"><a class="reference internal" href="deutsch_jozsa.html#The-Theory">The Theory</a></li>
235+
<li class="toctree-l3"><a class="reference internal" href="deutsch_jozsa.html#The-Algorithm-Implementation">The Algorithm Implementation</a></li>
236+
</ul>
237+
</li>
236238
<li class="toctree-l2"><a class="reference internal" href="hamiltonian_simulation.html">Spin-Hamiltonian Simulation Using CUDA-Q</a><ul>
237239
<li class="toctree-l3"><a class="reference internal" href="hamiltonian_simulation.html#Introduction">Introduction</a><ul>
238240
<li class="toctree-l4"><a class="reference internal" href="hamiltonian_simulation.html#Heisenberg-Hamiltonian">Heisenberg Hamiltonian</a></li>

pr-2596/applications/python/cost_minimization.html

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,11 @@
230230
<li class="toctree-l3"><a class="reference internal" href="deutschs_algorithm.html#Deutsch's-Algorithm:">Deutsch’s Algorithm:</a></li>
231231
</ul>
232232
</li>
233-
<li class="toctree-l2"><a class="reference internal" href="deutsch_jozsa.html"><em>The Deutsch-Jozsa Algorithm</em></a></li>
234-
<li class="toctree-l2"><a class="reference internal" href="deutsch_jozsa.html#The-Theory">The Theory</a></li>
235-
<li class="toctree-l2"><a class="reference internal" href="deutsch_jozsa.html#The-Algorithm-Implementation">The Algorithm Implementation</a></li>
233+
<li class="toctree-l2"><a class="reference internal" href="deutsch_jozsa.html">The Deutsch-Jozsa Algorithm</a><ul>
234+
<li class="toctree-l3"><a class="reference internal" href="deutsch_jozsa.html#The-Theory">The Theory</a></li>
235+
<li class="toctree-l3"><a class="reference internal" href="deutsch_jozsa.html#The-Algorithm-Implementation">The Algorithm Implementation</a></li>
236+
</ul>
237+
</li>
236238
<li class="toctree-l2"><a class="reference internal" href="hamiltonian_simulation.html">Spin-Hamiltonian Simulation Using CUDA-Q</a><ul>
237239
<li class="toctree-l3"><a class="reference internal" href="hamiltonian_simulation.html#Introduction">Introduction</a><ul>
238240
<li class="toctree-l4"><a class="reference internal" href="hamiltonian_simulation.html#Heisenberg-Hamiltonian">Heisenberg Hamiltonian</a></li>

pr-2596/applications/python/deutsch_jozsa.html

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,11 @@
230230
<li class="toctree-l3"><a class="reference internal" href="deutschs_algorithm.html#Deutsch's-Algorithm:">Deutsch’s Algorithm:</a></li>
231231
</ul>
232232
</li>
233-
<li class="toctree-l2 current"><a class="current reference internal" href="#"><em>The Deutsch-Jozsa Algorithm</em></a></li>
234-
<li class="toctree-l2"><a class="reference internal" href="#The-Theory">The Theory</a></li>
235-
<li class="toctree-l2"><a class="reference internal" href="#The-Algorithm-Implementation">The Algorithm Implementation</a></li>
233+
<li class="toctree-l2 current"><a class="current reference internal" href="#">The Deutsch-Jozsa Algorithm</a><ul>
234+
<li class="toctree-l3"><a class="reference internal" href="#The-Theory">The Theory</a></li>
235+
<li class="toctree-l3"><a class="reference internal" href="#The-Algorithm-Implementation">The Algorithm Implementation</a></li>
236+
</ul>
237+
</li>
236238
<li class="toctree-l2"><a class="reference internal" href="hamiltonian_simulation.html">Spin-Hamiltonian Simulation Using CUDA-Q</a><ul>
237239
<li class="toctree-l3"><a class="reference internal" href="hamiltonian_simulation.html#Introduction">Introduction</a><ul>
238240
<li class="toctree-l4"><a class="reference internal" href="hamiltonian_simulation.html#Heisenberg-Hamiltonian">Heisenberg Hamiltonian</a></li>
@@ -723,7 +725,7 @@
723725
<ul class="wy-breadcrumbs">
724726
<li><a href="../../index.html" class="icon icon-home" aria-label="Home"></a></li>
725727
<li class="breadcrumb-item"><a href="../../using/applications.html">CUDA-Q Applications</a></li>
726-
<li class="breadcrumb-item active"><em>The Deutsch-Jozsa Algorithm</em></li>
728+
<li class="breadcrumb-item active">The Deutsch-Jozsa Algorithm</li>
727729
<li class="wy-breadcrumbs-aside">
728730
<a href="../../_sources/applications/python/deutsch_jozsa.ipynb.txt" rel="nofollow"> View page source</a>
729731
</li>
@@ -737,17 +739,16 @@
737739
<div itemprop="articleBody">
738740

739741
<section id="The-Deutsch-Jozsa-Algorithm">
740-
<h1><em>The Deutsch-Jozsa Algorithm</em><a class="headerlink" href="#The-Deutsch-Jozsa-Algorithm" title="Permalink to this heading"></a></h1>
742+
<h1>The Deutsch-Jozsa Algorithm<a class="headerlink" href="#The-Deutsch-Jozsa-Algorithm" title="Permalink to this heading"></a></h1>
741743
<p>Here is the link to the original paper: <a class="reference external" href="http://rspa.royalsocietypublishing.org/content/439/1907/553">Deutsch-Jozsa algorithm</a>. This algorithm is an earlier demonstration of the computational advantage of quantum algorithm over classical one. It addresses the problem of identifying the nature of a hidden Boolean function, which is provided as an oracle. The function is guaranteed to be either:</p>
742744
<ul class="simple">
743745
<li><p><strong>Balanced</strong>, meaning it outputs 0 for exactly half of its possible inputs and 1 for the other half.</p></li>
744746
<li><p><strong>Constant</strong>, meaning it outputs the same value (either 0 or 1) for all inputs.</p></li>
745747
</ul>
746748
<p>Classically, determining whether the function is balanced or constant requires evaluating the oracle multiple times. In the worst-case scenario, one would need to query at least half of the inputs to distinguish a constant function. However, the Deutsch-Jozsa algorithm demonstrates quantum superiority by solving this problem with a single query to the oracle, regardless of the input size.</p>
747749
<p>This notebook implements the Deutsch-Jozsa algorithm as described in <a class="reference external" href="https://arxiv.org/pdf/quant-ph/9708016.pdf">Cleve et al. 1997</a>. The input for the oracle function <span class="math notranslate nohighlight">\(f\)</span> is a <span class="math notranslate nohighlight">\(n\)</span>-bit string. It means that for <span class="math notranslate nohighlight">\(x\ in \{0,1\}^n\)</span>, the value of <span class="math notranslate nohighlight">\(f(x)\)</span> is either constant, i.e., the same for all <span class="math notranslate nohighlight">\(x\)</span>, or balanced, i.e., exactly half of the <span class="math notranslate nohighlight">\(n\)</span>-bit string whose <span class="math notranslate nohighlight">\(f(x) = 0\)</span>.</p>
748-
</section>
749750
<section id="The-Theory">
750-
<h1>The Theory<a class="headerlink" href="#The-Theory" title="Permalink to this heading"></a></h1>
751+
<h2>The Theory<a class="headerlink" href="#The-Theory" title="Permalink to this heading"></a></h2>
751752
<p>Here are the steps to implement the algorithm: 1. Start with initializing all input qubits and single auxiliary qubits to zero. The first <span class="math notranslate nohighlight">\(n-1\)</span> input qubits are used for querying the oracle, and the last auxiliary qubit is used for storing the answer of the oracle</p>
752753
<div class="math notranslate nohighlight">
753754
\[|0\ldots 0\rangle |0\rangle\]</div>
@@ -771,7 +772,7 @@ <h1>The Theory<a class="headerlink" href="#The-Theory" title="Permalink to this
771772
</ol>
772773
</section>
773774
<section id="The-Algorithm-Implementation">
774-
<h1>The Algorithm Implementation<a class="headerlink" href="#The-Algorithm-Implementation" title="Permalink to this heading"></a></h1>
775+
<h2>The Algorithm Implementation<a class="headerlink" href="#The-Algorithm-Implementation" title="Permalink to this heading"></a></h2>
775776
<p>Here is the CUDA-Q code following the steps outlined in the above theory section.</p>
776777
<div class="nbinput nblast docutils container">
777778
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[31]:
@@ -917,6 +918,7 @@ <h1>The Algorithm Implementation<a class="headerlink" href="#The-Algorithm-Imple
917918
</pre></div>
918919
</div>
919920
</div>
921+
</section>
920922
</section>
921923

922924

pr-2596/applications/python/deutsch_jozsa.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"id": "7aa9cc8f-4e42-401f-a1fd-665e5cda19c7",
66
"metadata": {},
77
"source": [
8-
"## _*The Deutsch-Jozsa Algorithm*_\n",
8+
"# The Deutsch-Jozsa Algorithm\n",
99
"\n",
1010
"Here is the link to the original paper: [Deutsch-Jozsa algorithm](http://rspa.royalsocietypublishing.org/content/439/1907/553). This algorithm is an earlier demonstration of the computational advantage of quantum algorithm over classical one. It addresses the problem of identifying the nature of a hidden Boolean function, which is provided as an oracle. The function is guaranteed to be either:\n",
1111
"\n",

0 commit comments

Comments
 (0)