Skip to content

Commit a96f328

Browse files
Docs preview for PR #4285.
1 parent 5dbfffb commit a96f328

22 files changed

Lines changed: 53 additions & 53 deletions

pr-4285/api/languages/python_api.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2562,7 +2562,7 @@ <h3>Spin Operators<a class="headerlink" href="#spin-operators" title="Permalink
25622562
<em class="property"><span class="pre">static</span><span class="w"> </span></em><span class="sig-name descname"><span class="pre">random</span></span><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#cudaq.operators.spin.SpinOperator.random" title="Permalink to this definition">¶</a></dt>
25632563
<dd><dl class="py function">
25642564
<dt class="sig sig-object py">
2565-
<span class="sig-name descname"><span class="pre">random</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">qubit_count</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.14)"><span class="pre">int</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">term_count</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.14)"><span class="pre">int</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">seed</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.14)"><span class="pre">int</span></a></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">3940790911</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="#cudaq.operators.spin.SpinOperator" title="cudaq.operators.spin.SpinOperator"><span class="pre">SpinOperator</span></a></span></span></dt>
2565+
<span class="sig-name descname"><span class="pre">random</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">qubit_count</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.14)"><span class="pre">int</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">term_count</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.14)"><span class="pre">int</span></a></span></em>, <em class="sig-param"><span class="n"><span class="pre">seed</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><a class="reference external" href="https://docs.python.org/3/library/functions.html#int" title="(in Python v3.14)"><span class="pre">int</span></a></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">2783492738</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">&#x2192;</span> <span class="sig-return-typehint"><a class="reference internal" href="#cudaq.operators.spin.SpinOperator" title="cudaq.operators.spin.SpinOperator"><span class="pre">SpinOperator</span></a></span></span></dt>
25662566
<dd></dd></dl>
25672567

25682568
<p>Return a random spin operator with the given number of terms (<code class="code docutils literal notranslate"><span class="pre">term_count</span></code>) where each term acts on all targets in the open range [0, qubit_count). An optional seed value may also be provided.</p>

pr-4285/api/languages/python_api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3889,7 +3889,7 @@ aria-hidden="true"}](../default_ops.html "Quantum Operations"){.btn
38893889

38903890
:
38913891

3892-
[[random]{.pre}]{.sig-name .descname}[(]{.sig-paren}*[[qubit_count]{.pre}]{.n}[[:]{.pre}]{.p}[ ]{.w}[[[int]{.pre}](https://docs.python.org/3/library/functions.html#int "(in Python v3.14)"){.reference .external}]{.n}*, *[[term_count]{.pre}]{.n}[[:]{.pre}]{.p}[ ]{.w}[[[int]{.pre}](https://docs.python.org/3/library/functions.html#int "(in Python v3.14)"){.reference .external}]{.n}*, *[[seed]{.pre}]{.n}[[:]{.pre}]{.p}[ ]{.w}[[[int]{.pre}](https://docs.python.org/3/library/functions.html#int "(in Python v3.14)"){.reference .external}]{.n}[ ]{.w}[[=]{.pre}]{.o}[ ]{.w}[[3940790911]{.pre}]{.default_value}*[)]{.sig-paren} [[→]{.sig-return-icon} [[[SpinOperator]{.pre}](#cudaq.operators.spin.SpinOperator "cudaq.operators.spin.SpinOperator"){.reference .internal}]{.sig-return-typehint}]{.sig-return}
3892+
[[random]{.pre}]{.sig-name .descname}[(]{.sig-paren}*[[qubit_count]{.pre}]{.n}[[:]{.pre}]{.p}[ ]{.w}[[[int]{.pre}](https://docs.python.org/3/library/functions.html#int "(in Python v3.14)"){.reference .external}]{.n}*, *[[term_count]{.pre}]{.n}[[:]{.pre}]{.p}[ ]{.w}[[[int]{.pre}](https://docs.python.org/3/library/functions.html#int "(in Python v3.14)"){.reference .external}]{.n}*, *[[seed]{.pre}]{.n}[[:]{.pre}]{.p}[ ]{.w}[[[int]{.pre}](https://docs.python.org/3/library/functions.html#int "(in Python v3.14)"){.reference .external}]{.n}[ ]{.w}[[=]{.pre}]{.o}[ ]{.w}[[2783492738]{.pre}]{.default_value}*[)]{.sig-paren} [[→]{.sig-return-icon} [[[SpinOperator]{.pre}](#cudaq.operators.spin.SpinOperator "cudaq.operators.spin.SpinOperator"){.reference .internal}]{.sig-return-typehint}]{.sig-return}
38933893

38943894
:
38953895

pr-4285/applications/python/adapt_qaoa.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,7 @@ <h1>ADAPT-QAOA algorithm<a class="headerlink" href="#ADAPT-QAOA-algorithm" title
11751175
parameter</p>
11761176
<p>3- Optimize all parameters currently in the Ansatz <span class="math notranslate nohighlight">\(\beta_m, \gamma_m = 1, 2, ...k\)</span> such that <span class="math notranslate nohighlight">\(\braket{\psi (k)|H_C|\psi(k)}\)</span> is minimized, and return to the second step.</p>
11771177
<p>Below is a schematic representation of the ADAPT-QAOA algorithm explained above.</p>
1178-
<div><p><img alt="0b40c62de27c4134b7159c4e27d523b0" class="no-scaled-link" src="../../_images/adapt-qaoa.png" style="width: 1000px;" /></p>
1178+
<div><p><img alt="c4423e930c434dfa8a7327281fad8b5a" class="no-scaled-link" src="../../_images/adapt-qaoa.png" style="width: 1000px;" /></p>
11791179
</div><div class="nbinput nblast docutils container">
11801180
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[15]:
11811181
</pre></div>

pr-4285/applications/python/adapt_qaoa.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2107,7 +2107,7 @@ explained above.
21072107

21082108
<div>
21092109

2110-
![0b40c62de27c4134b7159c4e27d523b0](../../_images/adapt-qaoa.png){.no-scaled-link
2110+
![c4423e930c434dfa8a7327281fad8b5a](../../_images/adapt-qaoa.png){.no-scaled-link
21112111
style="width: 1000px;"}
21122112

21132113
</div>

pr-4285/applications/python/adapt_vqe.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,7 @@ <h1>ADAPT-VQE algorithm<a class="headerlink" href="#ADAPT-VQE-algorithm" title="
11721172
<p>7- Perform a VQE experiment to re-optimize all parameters in the ansatz.</p>
11731173
<p>8- go to step 4</p>
11741174
<p>Below is a Schematic depiction of the ADAPT-VQE algorithm</p>
1175-
<div><p><img alt="33771f1505154f99abd23bbd186019f2" class="no-scaled-link" src="../../_images/adapt-vqe.png" style="width: 800px;" /></p>
1175+
<div><p><img alt="6e89fd7b24ef4710845e0ddacfa221b9" class="no-scaled-link" src="../../_images/adapt-vqe.png" style="width: 800px;" /></p>
11761176
</div><div class="nbinput docutils container">
11771177
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[1]:
11781178
</pre></div>

pr-4285/applications/python/adapt_vqe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2075,7 +2075,7 @@ Below is a Schematic depiction of the ADAPT-VQE algorithm
20752075

20762076
<div>
20772077

2078-
![33771f1505154f99abd23bbd186019f2](../../_images/adapt-vqe.png){.no-scaled-link
2078+
![6e89fd7b24ef4710845e0ddacfa221b9](../../_images/adapt-vqe.png){.no-scaled-link
20792079
style="width: 800px;"}
20802080

20812081
</div>

pr-4285/applications/python/deutsch_algorithm.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,7 +1232,7 @@ <h2>XOR <span class="math notranslate nohighlight">\(\oplus\)</span><a class="he
12321232
</section>
12331233
<section id="Quantum-oracles">
12341234
<h2>Quantum oracles<a class="headerlink" href="#Quantum-oracles" title="Permalink to this heading"></a></h2>
1235-
<p><img alt="c5fc32dce54644fd8f0b8705af09564b" class="no-scaled-link" src="../../_images/oracle.png" style="width: 300px; height: 150px;" /></p>
1235+
<p><img alt="2f7ad67ce5ab4dfbb29532d30f0e1f62" class="no-scaled-link" src="../../_images/oracle.png" style="width: 300px; height: 150px;" /></p>
12361236
<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>
12371237
<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>
12381238
<div class="math notranslate nohighlight">
@@ -1280,7 +1280,7 @@ <h2>Quantum parallelism<a class="headerlink" href="#Quantum-parallelism" title="
12801280
<h2>Deutsch’s Algorithm:<a class="headerlink" href="#Deutsch's-Algorithm:" title="Permalink to this heading"></a></h2>
12811281
<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>
12821282
<p>We step through the circuit diagram below and follow the math after the application of each gate.</p>
1283-
<p><img alt="3fdb36c700c04b3e98137ba834ec46e6" class="no-scaled-link" src="../../_images/deutsch.png" style="width: 500px; height: 210px;" /></p>
1283+
<p><img alt="14ace0e910614da096dea7feb180c605" class="no-scaled-link" src="../../_images/deutsch.png" style="width: 500px; height: 210px;" /></p>
12841284
<div class="math notranslate nohighlight">
12851285
\[\ket{\psi_0} = \ket{01}
12861286
\tag{1}\]</div>

pr-4285/applications/python/deutsch_algorithm.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2156,7 +2156,7 @@ number, the result is 0 otherwise 1.
21562156
::: {#Quantum-oracles .section}
21572157
## Quantum oracles[](#Quantum-oracles "Permalink to this heading"){.headerlink}
21582158

2159-
![c5fc32dce54644fd8f0b8705af09564b](../../_images/oracle.png){.no-scaled-link
2159+
![2f7ad67ce5ab4dfbb29532d30f0e1f62](../../_images/oracle.png){.no-scaled-link
21602160
style="width: 300px; height: 150px;"}
21612161

21622162
Suppose we have [\\(f(x): \\{0,1\\} \\longrightarrow \\{0,1\\}\\)]{.math
@@ -2262,7 +2262,7 @@ balanced function? If constant, [\\(f(0) = f(1)\\)]{.math .notranslate
22622262
We step through the circuit diagram below and follow the math after the
22632263
application of each gate.
22642264

2265-
![3fdb36c700c04b3e98137ba834ec46e6](../../_images/deutsch.png){.no-scaled-link
2265+
![14ace0e910614da096dea7feb180c605](../../_images/deutsch.png){.no-scaled-link
22662266
style="width: 500px; height: 210px;"}
22672267

22682268
::: {.math .notranslate .nohighlight}

pr-4285/applications/python/edge_detection.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1212,7 +1212,7 @@ <h2>Image<a class="headerlink" href="#Image" title="Permalink to this heading">
12121212
<section id="Quantum-Probability-Image-Encoding-(QPIE):">
12131213
<h2>Quantum Probability Image Encoding (QPIE):<a class="headerlink" href="#Quantum-Probability-Image-Encoding-(QPIE):" title="Permalink to this heading"></a></h2>
12141214
<p>Lets take as an example a classical 2x2 image (4 pixels). We can label each pixel with its position</p>
1215-
<div><p><img alt="bcb57b1738954daf8142557e9482f8e2" class="no-scaled-link" src="../../_images/pixels-img.png" style="width: 200px;" /></p>
1215+
<div><p><img alt="5b7ec88b1ff34d2699ec7196c5fa5089" class="no-scaled-link" src="../../_images/pixels-img.png" style="width: 200px;" /></p>
12161216
</div><p>Each pixel will have its own color intensity represented along with its position label as an 8-bit black and white color. To convert the pixel intensity to probability amplitudes of a quantum state</p>
12171217
<div class="math notranslate nohighlight">
12181218
\[c_i = \frac{I_{yx}}{\sqrt(\sum I^2_{yx})}\]</div>

pr-4285/applications/python/edge_detection.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2108,7 +2108,7 @@ each pixel with its position
21082108

21092109
<div>
21102110

2111-
![bcb57b1738954daf8142557e9482f8e2](../../_images/pixels-img.png){.no-scaled-link
2111+
![5b7ec88b1ff34d2699ec7196c5fa5089](../../_images/pixels-img.png){.no-scaled-link
21122112
style="width: 200px;"}
21132113

21142114
</div>

0 commit comments

Comments
 (0)