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
Copy file name to clipboardExpand all lines: pr-2596/_sources/applications/python/deutsch_jozsa.ipynb.txt
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
"id": "7aa9cc8f-4e42-401f-a1fd-665e5cda19c7",
6
6
"metadata": {},
7
7
"source": [
8
-
"## _*The Deutsch-Jozsa Algorithm*_\n",
8
+
"#The Deutsch-Jozsa Algorithm\n",
9
9
"\n",
10
10
"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",
<h1><em>The Deutsch-Jozsa Algorithm</em><aclass="headerlink" href="#The-Deutsch-Jozsa-Algorithm" title="Permalink to this heading">¶</a></h1>
742
+
<h1>The Deutsch-Jozsa Algorithm<aclass="headerlink" href="#The-Deutsch-Jozsa-Algorithm" title="Permalink to this heading">¶</a></h1>
741
743
<p>Here is the link to the original paper: <aclass="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>
742
744
<ulclass="simple">
743
745
<li><p><strong>Balanced</strong>, meaning it outputs 0 for exactly half of its possible inputs and 1 for the other half.</p></li>
744
746
<li><p><strong>Constant</strong>, meaning it outputs the same value (either 0 or 1) for all inputs.</p></li>
745
747
</ul>
746
748
<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>
747
749
<p>This notebook implements the Deutsch-Jozsa algorithm as described in <aclass="reference external" href="https://arxiv.org/pdf/quant-ph/9708016.pdf">Cleve et al. 1997</a>. The input for the oracle function <spanclass="math notranslate nohighlight">\(f\)</span> is a <spanclass="math notranslate nohighlight">\(n\)</span>-bit string. It means that for <spanclass="math notranslate nohighlight">\(x\ in \{0,1\}^n\)</span>, the value of <spanclass="math notranslate nohighlight">\(f(x)\)</span> is either constant, i.e., the same for all <spanclass="math notranslate nohighlight">\(x\)</span>, or balanced, i.e., exactly half of the <spanclass="math notranslate nohighlight">\(n\)</span>-bit string whose <spanclass="math notranslate nohighlight">\(f(x) = 0\)</span>.</p>
748
-
</section>
749
750
<sectionid="The-Theory">
750
-
<h1>The Theory<aclass="headerlink" href="#The-Theory" title="Permalink to this heading">¶</a></h1>
751
+
<h2>The Theory<aclass="headerlink" href="#The-Theory" title="Permalink to this heading">¶</a></h2>
751
752
<p>Here are the steps to implement the algorithm: 1. Start with initializing all input qubits and single auxiliary qubits to zero. The first <spanclass="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>
752
753
<divclass="math notranslate nohighlight">
753
754
\[|0\ldots 0\rangle |0\rangle\]</div>
@@ -771,7 +772,7 @@ <h1>The Theory<a class="headerlink" href="#The-Theory" title="Permalink to this
771
772
</ol>
772
773
</section>
773
774
<sectionid="The-Algorithm-Implementation">
774
-
<h1>The Algorithm Implementation<aclass="headerlink" href="#The-Algorithm-Implementation" title="Permalink to this heading">¶</a></h1>
775
+
<h2>The Algorithm Implementation<aclass="headerlink" href="#The-Algorithm-Implementation" title="Permalink to this heading">¶</a></h2>
775
776
<p>Here is the CUDA-Q code following the steps outlined in the above theory section.</p>
Copy file name to clipboardExpand all lines: pr-2596/applications/python/deutsch_jozsa.ipynb
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@
5
5
"id": "7aa9cc8f-4e42-401f-a1fd-665e5cda19c7",
6
6
"metadata": {},
7
7
"source": [
8
-
"## _*The Deutsch-Jozsa Algorithm*_\n",
8
+
"#The Deutsch-Jozsa Algorithm\n",
9
9
"\n",
10
10
"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",
0 commit comments