Skip to content

Commit

Permalink
Docs preview for PR #1932.
Browse files Browse the repository at this point in the history
  • Loading branch information
cuda-quantum-bot committed Jul 15, 2024
1 parent 1b053e2 commit 5ede02d
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 6 deletions.
8 changes: 7 additions & 1 deletion pr-1932/_sources/using/backends/platform.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -259,4 +259,10 @@ language constructs within quantum kernels may not yet be fully supported.
* - `std::vector` of trivial type
- `std::vector<int>`, `std::vector<double>`, etc.
- Total vector size in bytes as a 64-bit integer followed by serialized data of all vector elements.

* - `cudaq::pauli_word`
- `cudaq::pauli_word("IXIZ")`
- Same as `std::vector<char>`: total vector size in bytes as a 64-bit integer followed by serialized data of all characters.
* - Single-level nested `std::vector` of supported `std::vector` types
- `std::vector<std::vector<int>>`, `std::vector<cudaq::pauli_word>`, etc.
- Number of top-level elements (as a 64-bit integer) followed sizes in bytes of element vectors (as a contiguous array of 64-bit integers) then serialized data of the inner vectors.

2 changes: 1 addition & 1 deletion pr-1932/api/languages/python_api.html
Original file line number Diff line number Diff line change
Expand Up @@ -2049,7 +2049,7 @@ <h2>Data Types<a class="headerlink" href="#data-types" title="Permalink to this
<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.SpinOperator.random" title="Permalink to this definition"></a></dt>
<dd><dl class="py function">
<dt class="sig sig-object py">
<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.12)"><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.12)"><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.12)"><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">3685079100</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.SpinOperator" title="cudaq.mlir._mlir_libs._quakeDialects.cudaq_runtime.SpinOperator"><span class="pre">cudaq.mlir._mlir_libs._quakeDialects.cudaq_runtime.SpinOperator</span></a></span></span></dt>
<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.12)"><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.12)"><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.12)"><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">477589269</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.SpinOperator" title="cudaq.mlir._mlir_libs._quakeDialects.cudaq_runtime.SpinOperator"><span class="pre">cudaq.mlir._mlir_libs._quakeDialects.cudaq_runtime.SpinOperator</span></a></span></span></dt>
<dd></dd></dl>

<p>Return a random <a class="reference internal" href="#cudaq.SpinOperator" title="cudaq.SpinOperator"><code class="xref py py-class docutils literal notranslate"><span class="pre">SpinOperator</span></code></a> on the given number of qubits (<code class="code docutils literal notranslate"><span class="pre">qubit_count</span></code>) and composed of the given number of terms (<code class="code docutils literal notranslate"><span class="pre">term_count</span></code>). An optional seed value may also be provided.</p>
Expand Down
4 changes: 2 additions & 2 deletions pr-1932/examples/python/tutorials/deutschs_algorithm.html
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ <h2>XOR <span class="math notranslate nohighlight">\(\oplus\)</span><a class="he
</section>
<section id="Quantum-oracles">
<h2>Quantum oracles<a class="headerlink" href="#Quantum-oracles" title="Permalink to this heading"></a></h2>
<p><img alt="38c5d37de0b64f75983adc0fe9d69a38" class="no-scaled-link" src="../../../_images/oracle.png" style="width: 300px; height: 150px;" /></p>
<p><img alt="1f97d462cb4e4b1f8af61c8e2457d9cc" class="no-scaled-link" src="../../../_images/oracle.png" style="width: 300px; height: 150px;" /></p>
<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 logic gates.</p>
<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>
<div class="math notranslate nohighlight">
Expand Down Expand Up @@ -651,7 +651,7 @@ <h2>Quantum parallelism<a class="headerlink" href="#Quantum-parallelism" title="
<h2>Deutschs’ Algorithm:<a class="headerlink" href="#Deutschs'-Algorithm:" title="Permalink to this heading"></a></h2>
<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>
<p>We step through the circuit diagram below and follow the math after the application of each gate.</p>
<p><img alt="eb8f62d66d674681937df691e364332c" class="no-scaled-link" src="../../../_images/deutsch.png" style="width: 500px; height: 210px;" /></p>
<p><img alt="e47efc2a09d7424cab87224cf63d33f8" class="no-scaled-link" src="../../../_images/deutsch.png" style="width: 500px; height: 210px;" /></p>
<div class="math notranslate nohighlight">
\[\ket{\psi_0} = \ket{01}
\tag{1}\]</div>
Expand Down
2 changes: 1 addition & 1 deletion pr-1932/searchindex.js

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion pr-1932/sphinx/using/backends/platform.rst
Original file line number Diff line number Diff line change
Expand Up @@ -259,4 +259,10 @@ language constructs within quantum kernels may not yet be fully supported.
* - `std::vector` of trivial type
- `std::vector<int>`, `std::vector<double>`, etc.
- Total vector size in bytes as a 64-bit integer followed by serialized data of all vector elements.

* - `cudaq::pauli_word`
- `cudaq::pauli_word("IXIZ")`
- Same as `std::vector<char>`: total vector size in bytes as a 64-bit integer followed by serialized data of all characters.
* - Single-level nested `std::vector` of supported `std::vector` types
- `std::vector<std::vector<int>>`, `std::vector<cudaq::pauli_word>`, etc.
- Number of top-level elements (as a 64-bit integer) followed sizes in bytes of element vectors (as a contiguous array of 64-bit integers) then serialized data of the inner vectors.

8 changes: 8 additions & 0 deletions pr-1932/using/backends/platform.html
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,14 @@ <h3>Supported Kernel Arguments<a class="headerlink" href="#supported-kernel-argu
<td><p><code class="code docutils literal notranslate"><span class="pre">std::vector&lt;int&gt;</span></code>, <code class="code docutils literal notranslate"><span class="pre">std::vector&lt;double&gt;</span></code>, etc.</p></td>
<td><p>Total vector size in bytes as a 64-bit integer followed by serialized data of all vector elements.</p></td>
</tr>
<tr class="row-even"><td><p><code class="code docutils literal notranslate"><span class="pre">cudaq::pauli_word</span></code></p></td>
<td><p><code class="code docutils literal notranslate"><span class="pre">cudaq::pauli_word(&quot;IXIZ&quot;)</span></code></p></td>
<td><p>Same as <code class="code docutils literal notranslate"><span class="pre">std::vector&lt;char&gt;</span></code>: total vector size in bytes as a 64-bit integer followed by serialized data of all characters.</p></td>
</tr>
<tr class="row-odd"><td><p>Single-level nested <code class="code docutils literal notranslate"><span class="pre">std::vector</span></code> of supported <code class="code docutils literal notranslate"><span class="pre">std::vector</span></code> types</p></td>
<td><p><code class="code docutils literal notranslate"><span class="pre">std::vector&lt;std::vector&lt;int&gt;&gt;</span></code>, <code class="code docutils literal notranslate"><span class="pre">std::vector&lt;cudaq::pauli_word&gt;</span></code>, etc.</p></td>
<td><p>Number of top-level elements (as a 64-bit integer) followed sizes in bytes of element vectors (as a contiguous array of 64-bit integers) then serialized data of the inner vectors.</p></td>
</tr>
</tbody>
</table>
</section>
Expand Down

0 comments on commit 5ede02d

Please sign in to comment.