Skip to content

Commit b06e4e4

Browse files
Docs preview for PR #3301.
1 parent 859c907 commit b06e4e4

File tree

17 files changed

+30
-27
lines changed

17 files changed

+30
-27
lines changed

pr-3301/_sources/using/backends/hardware/qcontrol.rst.txt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ set up with Quantum Machines. By default, a mock executor is used.
5353
- ``executor``: The name of the executor/backend to use (defaults to "mock")
5454
- ``api_key``: Your API key (optional if set via environment variable)
5555

56-
To see a complete example for using Quantum Machines backends, take a look at our :doc:`Python examples <../../examples/examples>`.
57-
5856

5957
.. tab:: C++
6058

@@ -71,4 +69,4 @@ set up with Quantum Machines. By default, a mock executor is used.
7169
- ``--quantum-machines-executor``: The name of the executor/backend to use (defaults to "mock")
7270
- ``--quantum-machines-api-key``: Your API key (if not set via environment variable)
7371

74-
To see a complete example for using Quantum Machines backends, take a look at our :doc:`C++ examples <../../examples/examples>`.
72+
To see a complete example, take a look at :ref:`Quantum Machines examples <quantum-machines-examples>`.

pr-3301/_sources/using/examples/hardware_providers.rst.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ The following code illustrates how to run kernels on Quantinuum's backends.
146146
.. literalinclude:: ../../targets/cpp/quantinuum.cpp
147147
:language: cpp
148148

149+
150+
151+
.. _quantum-machines-examples:
152+
149153
Quantum Machines
150154
==================================
151155

pr-3301/api/languages/python_api.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2354,7 +2354,7 @@ <h3>Spin Operators<a class="headerlink" href="#spin-operators" title="Permalink
23542354
<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>
23552355
<dd><dl class="py function">
23562356
<dt class="sig sig-object py">
2357-
<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.13)"><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.13)"><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.13)"><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">365005251</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>
2357+
<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.13)"><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.13)"><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.13)"><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">4203513693</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>
23582358
<dd></dd></dl>
23592359

23602360
<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-3301/applications/python/adapt_qaoa.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ <h1>ADAPT-QAOA algorithm<a class="headerlink" href="#ADAPT-QAOA-algorithm" title
976976
parameter</p>
977977
<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>
978978
<p>Below is a schematic representation of the ADAPT-QAOA algorithm explained above.</p>
979-
<div><p><img alt="3ac57580830040b8b9b7f1fee858c3a4" class="no-scaled-link" src="../../_images/adapt-qaoa.png" style="width: 1000px;" /></p>
979+
<div><p><img alt="dce09cdf7c204fe4876f9140a81df934" class="no-scaled-link" src="../../_images/adapt-qaoa.png" style="width: 1000px;" /></p>
980980
</div><div class="nbinput nblast docutils container">
981981
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[15]:
982982
</pre></div>

pr-3301/applications/python/adapt_vqe.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,7 @@ <h1>ADAPT-VQE algorithm<a class="headerlink" href="#ADAPT-VQE-algorithm" title="
973973
<p>7- Perform a VQE experiment to re-optimize all parameters in the ansatz.</p>
974974
<p>8- go to step 4</p>
975975
<p>Below is a Schematic depiction of the ADAPT-VQE algorithm</p>
976-
<div><p><img alt="59bed6aaa75c4b75a0ca21e8bb68aa12" class="no-scaled-link" src="../../_images/adapt-vqe.png" style="width: 800px;" /></p>
976+
<div><p><img alt="fb141cfcf39b420d83583d290e14297c" class="no-scaled-link" src="../../_images/adapt-vqe.png" style="width: 800px;" /></p>
977977
</div><div class="nbinput docutils container">
978978
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[1]:
979979
</pre></div>

pr-3301/applications/python/deutsch_algorithm.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,7 +1033,7 @@ <h2>XOR <span class="math notranslate nohighlight">\(\oplus\)</span><a class="he
10331033
</section>
10341034
<section id="Quantum-oracles">
10351035
<h2>Quantum oracles<a class="headerlink" href="#Quantum-oracles" title="Permalink to this heading"></a></h2>
1036-
<p><img alt="2646d5fa5a5546b68c6f46bcae1ea503" class="no-scaled-link" src="../../_images/oracle.png" style="width: 300px; height: 150px;" /></p>
1036+
<p><img alt="26753e54035148848ac584d6cc314993" class="no-scaled-link" src="../../_images/oracle.png" style="width: 300px; height: 150px;" /></p>
10371037
<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>
10381038
<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>
10391039
<div class="math notranslate nohighlight">
@@ -1081,7 +1081,7 @@ <h2>Quantum parallelism<a class="headerlink" href="#Quantum-parallelism" title="
10811081
<h2>Deutsch’s Algorithm:<a class="headerlink" href="#Deutsch's-Algorithm:" title="Permalink to this heading"></a></h2>
10821082
<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>
10831083
<p>We step through the circuit diagram below and follow the math after the application of each gate.</p>
1084-
<p><img alt="f36d6715849948d49a8c83d156d9966c" class="no-scaled-link" src="../../_images/deutsch.png" style="width: 500px; height: 210px;" /></p>
1084+
<p><img alt="97d8ad8da43c434b9269e042a0e5d8ad" class="no-scaled-link" src="../../_images/deutsch.png" style="width: 500px; height: 210px;" /></p>
10851085
<div class="math notranslate nohighlight">
10861086
\[\ket{\psi_0} = \ket{01}
10871087
\tag{1}\]</div>

pr-3301/applications/python/edge_detection.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ <h2>Image<a class="headerlink" href="#Image" title="Permalink to this heading">
10131013
<section id="Quantum-Probability-Image-Encoding-(QPIE):">
10141014
<h2>Quantum Probability Image Encoding (QPIE):<a class="headerlink" href="#Quantum-Probability-Image-Encoding-(QPIE):" title="Permalink to this heading"></a></h2>
10151015
<p>Lets take as an example a classical 2x2 image (4 pixels). We can label each pixel with its position</p>
1016-
<div><p><img alt="3bf8194eb15842639e14c170cb740621" class="no-scaled-link" src="../../_images/pixels-img.png" style="width: 200px;" /></p>
1016+
<div><p><img alt="adc7f320354d4271ad039c3feacb2c62" class="no-scaled-link" src="../../_images/pixels-img.png" style="width: 200px;" /></p>
10171017
</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>
10181018
<div class="math notranslate nohighlight">
10191019
\[c_i = \frac{I_{yx}}{\sqrt(\sum I^2_{yx})}\]</div>

pr-3301/applications/python/grovers.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,7 @@ <h3>Good and Bad States<a class="headerlink" href="#Good-and-Bad-States" title="
10551055
<p>Let us now examine the geometric picture behind our current discussion. We’ll consider the ambient Hilbert space to be spanned by the standard basis vectors <span class="math notranslate nohighlight">\(|0\rangle, |1\rangle, \dots, |N-1\rangle\)</span>, where the full dimension is <span class="math notranslate nohighlight">\(N = 2^n\)</span>. Since the uniform superposition state <span class="math notranslate nohighlight">\(|\xi\rangle\)</span> can be expressed as a linear combination of the states <span class="math notranslate nohighlight">\(|G\rangle\)</span> and <span class="math notranslate nohighlight">\(|B\rangle\)</span> with real coefficients, all three states <span class="math notranslate nohighlight">\(|\xi\rangle, |G\rangle,\)</span> and <span class="math notranslate nohighlight">\(|B\rangle\)</span>
10561056
reside in a two-dimensional real subspace of the ambient Hilbert space, which we can visualize as a 2D plane as in the image below. Since, <span class="math notranslate nohighlight">\(|G\rangle\)</span> and <span class="math notranslate nohighlight">\(|B\rangle\)</span> are orthogonal, we can imagine them graphed as unit vectors in the positive <span class="math notranslate nohighlight">\(y\)</span> and positive <span class="math notranslate nohighlight">\(x\)</span> directions, respectively. From our previous expression, <span class="math notranslate nohighlight">\(\ket{\xi} = \sin(\theta) |G\rangle + \cos(\theta) |B\rangle,\)</span> we see that the state <span class="math notranslate nohighlight">\(|\xi\rangle\)</span> forms an angle <span class="math notranslate nohighlight">\(\theta\)</span> with
10571057
<span class="math notranslate nohighlight">\(|B\rangle\)</span>.</p>
1058-
<div style="text-align: center;"><p><img alt="28a1575d9f4146c9ae94cace6297d8a1" src="../../_images/grovers-2D-plane.png" /></p>
1058+
<div style="text-align: center;"><p><img alt="65fd78efbf6f45d782bf2d3beaa6329e" src="../../_images/grovers-2D-plane.png" /></p>
10591059
</div><p>Given that the number of marked states <span class="math notranslate nohighlight">\(t\)</span> is typically small compared to <span class="math notranslate nohighlight">\(N\)</span>, it follows that <span class="math notranslate nohighlight">\(\theta = \arcsin\left(\sqrt{\frac{t}{N}}\right)\)</span> is a small angle. This assumption is reasonable, as otherwise, a sufficient number of independent queries to the oracle would likely yield a solution through classical search methods.</p>
10601060
</section>
10611061
<section id="Step-2:-Oracle-application">
@@ -1170,9 +1170,9 @@ <h4>Completing Step 3<a class="headerlink" href="#Completing-Step-3" title="Perm
11701170
<div class="math notranslate nohighlight">
11711171
\[\mathcal{G} = r_\xi \circ r_B = H^{\otimes n} \big( 2|0^{\otimes n} \rangle \langle 0^{\otimes n}| - \text{Id} \big) H^{\otimes n} \mathcal{O}_f.\]</div>
11721172
<p>The circuit diagram below puts together steps 1 through 3:</p>
1173-
<div style="text-align: center;"><p><img alt="283b28ba877b42b6a13314985e44fccb" src="../../_images/grovers-steps1-3.png" /></p>
1173+
<div style="text-align: center;"><p><img alt="a1784fb3036b4f5a92cf0b46b1366f84" src="../../_images/grovers-steps1-3.png" /></p>
11741174
</div><p>Running this circuit initializes <span class="math notranslate nohighlight">\(\ket{\xi}\)</span> and performs a rotation by <span class="math notranslate nohighlight">\(2\theta\)</span> (twice the angle between <span class="math notranslate nohighlight">\(|\xi\rangle\)</span> and <span class="math notranslate nohighlight">\(|B\rangle\)</span>) in the direction from <span class="math notranslate nohighlight">\(|B\rangle\)</span> to <span class="math notranslate nohighlight">\(|G\rangle\)</span>.</p>
1175-
<div style="text-align: center;"><p><img alt="581a72018c7a49de8f626c835b257766" src="../../_images/grovers-full-rotation.png" /></p>
1175+
<div style="text-align: center;"><p><img alt="e5f175052b5549ca9089f896cdf1f32d" src="../../_images/grovers-full-rotation.png" /></p>
11761176
</div><p>Let’s verify that the state resulting from one iteration of Grover’s algorithm brings us closer to the good state, <span class="math notranslate nohighlight">\(\ket{G}\)</span>. In particular, notice that the amplitudes of <code class="docutils literal notranslate"><span class="pre">1001</span></code> and <code class="docutils literal notranslate"><span class="pre">1111</span></code> in the resulting state have been amplified compared to the equal superposition of states.</p>
11771177
<div class="nbinput docutils container">
11781178
<div class="prompt highlight-none notranslate"><div class="highlight"><pre><span></span>[18]:

pr-3301/applications/python/qm_mm_pe.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,7 @@ <h2>Key concepts:<a class="headerlink" href="#Key-concepts:" title="Permalink to
973973
</section>
974974
<section id="PE-VQE-SCF-Algorithm-Steps">
975975
<h2>PE-VQE-SCF Algorithm Steps<a class="headerlink" href="#PE-VQE-SCF-Algorithm-Steps" title="Permalink to this heading"></a></h2>
976-
<div><p><img alt="39a0257046fd45b4bf86875fc9dc97c6" class="no-scaled-link" src="../../_images/qm-mm-pe.png" style="width: 600px;" /></p>
976+
<div><p><img alt="6a4429461c70424c864940c817d46624" class="no-scaled-link" src="../../_images/qm-mm-pe.png" style="width: 600px;" /></p>
977977
</div><section id="Step-1:-Initialize-(Classical-pre-processing)">
978978
<h3>Step 1: Initialize (Classical pre-processing)<a class="headerlink" href="#Step-1:-Initialize-(Classical-pre-processing)" title="Permalink to this heading"></a></h3>
979979
<ul class="simple">

pr-3301/applications/python/quantum_transformer.html

Lines changed: 5 additions & 5 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)