Skip to content

Commit

Permalink
Deploying to gh-pages from @ f91d415 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
liwt31 committed Jan 15, 2024
1 parent 1e2598a commit 525f374
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
11 changes: 8 additions & 3 deletions _modules/tencirchem/static/hea.html
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ <h1>Source code for tencirchem.static.hea</h1><div class="highlight"><pre>
<span class="kn">from</span> <span class="nn">tensorcircuit.noisemodel</span> <span class="kn">import</span> <span class="n">NoiseConf</span><span class="p">,</span> <span class="n">circuit_with_noise</span>

<span class="kn">from</span> <span class="nn">tencirchem.static.engine_hea</span> <span class="kn">import</span> <span class="p">(</span>
<span class="n">QpuConf</span><span class="p">,</span>
<span class="n">get_statevector</span><span class="p">,</span>
<span class="n">get_densitymatrix</span><span class="p">,</span>
<span class="n">get_energy_tensornetwork</span><span class="p">,</span>
Expand Down Expand Up @@ -652,7 +653,7 @@ <h1>Source code for tencirchem.static.hea</h1><div class="highlight"><pre>
<span class="n">circuit</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="n">Callable</span><span class="p">,</span> <span class="n">QuantumCircuit</span><span class="p">],</span>
<span class="n">init_guess</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="n">List</span><span class="p">[</span><span class="nb">float</span><span class="p">],</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">],</span>
<span class="n">engine</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">engine_conf</span><span class="p">:</span> <span class="n">NoiseConf</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">engine_conf</span><span class="p">:</span> <span class="p">[</span><span class="n">NoiseConf</span><span class="p">,</span> <span class="n">QpuConf</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="p">):</span>
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Construct the HEA class from Hamiltonian in :class:`QubitOperator` form and the ansatz.</span>
Expand All @@ -679,8 +680,11 @@ <h1>Source code for tencirchem.static.hea</h1><div class="highlight"><pre>
<span class="n">engine</span> <span class="o">=</span> <span class="s2">&quot;tensornetwork&quot;</span>
<span class="k">if</span> <span class="n">engine</span> <span class="o">==</span> <span class="s2">&quot;tensornetwork&quot;</span> <span class="ow">and</span> <span class="n">engine_conf</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="s2">&quot;Tensornetwork engine does not have engine configuration&quot;</span><span class="p">)</span>
<span class="k">if</span> <span class="n">engine</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">&quot;tensornetwork-noise&quot;</span><span class="p">)</span> <span class="ow">and</span> <span class="n">engine_conf</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">engine_conf</span> <span class="o">=</span> <span class="n">get_noise_conf</span><span class="p">()</span>
<span class="k">if</span> <span class="n">engine_conf</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="k">if</span> <span class="n">engine</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">&quot;tensornetwork-noise&quot;</span><span class="p">):</span>
<span class="n">engine_conf</span> <span class="o">=</span> <span class="n">get_noise_conf</span><span class="p">()</span>
<span class="k">if</span> <span class="n">engine</span><span class="o">.</span><span class="n">startswith</span><span class="p">(</span><span class="s2">&quot;qpu&quot;</span><span class="p">):</span>
<span class="n">engine_conf</span> <span class="o">=</span> <span class="n">QpuConf</span><span class="p">()</span>

<span class="n">init_guess</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">array</span><span class="p">(</span><span class="n">init_guess</span><span class="p">)</span>

Expand Down Expand Up @@ -954,6 +958,7 @@ <h1>Source code for tencirchem.static.hea</h1><div class="highlight"><pre>
<span class="nb">tuple</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">h_qubit_op</span><span class="o">.</span><span class="n">terms</span><span class="o">.</span><span class="n">keys</span><span class="p">()),</span>
<span class="nb">list</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">h_qubit_op</span><span class="o">.</span><span class="n">terms</span><span class="o">.</span><span class="n">values</span><span class="p">()),</span>
<span class="bp">self</span><span class="o">.</span><span class="n">get_circuit</span><span class="p">,</span>
<span class="bp">self</span><span class="o">.</span><span class="n">engine_conf</span><span class="p">,</span>
<span class="bp">self</span><span class="o">.</span><span class="n">shots</span><span class="p">,</span>
<span class="p">)</span>
<span class="k">return</span> <span class="n">e</span></div>
Expand Down
4 changes: 2 additions & 2 deletions api/hea.html
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,13 @@
<h1>Headware-Efficient Ansatz and Noisy Circuit Simulation<a class="headerlink" href="#headware-efficient-ansatz-and-noisy-circuit-simulation" title="Permalink to this heading">#</a></h1>
<dl class="py class">
<dt class="sig sig-object py" id="tencirchem.HEA">
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">tencirchem.</span></span><span class="sig-name descname"><span class="pre">HEA</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">h_qubit_op</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">QubitOperator</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">circuit</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Callable</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">QuantumCircuit</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">init_guess</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">List</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">]</span></span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">engine</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">engine_conf</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">NoiseConf</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/tencirchem/static/hea.html#HEA"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#tencirchem.HEA" title="Permalink to this definition">#</a></dt>
<em class="property"><span class="pre">class</span><span class="w"> </span></em><span class="sig-prename descclassname"><span class="pre">tencirchem.</span></span><span class="sig-name descname"><span class="pre">HEA</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">h_qubit_op:</span> <span class="pre">~openfermion.ops.operators.qubit_operator.QubitOperator</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">circuit:</span> <span class="pre">~typing.Callable</span> <span class="pre">|</span> <span class="pre">~qiskit.circuit.quantumcircuit.QuantumCircuit</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">init_guess:</span> <span class="pre">~typing.List[float]</span> <span class="pre">|</span> <span class="pre">~numpy.ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">engine:</span> <span class="pre">str</span> <span class="pre">=</span> <span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">engine_conf:</span> <span class="pre">[&lt;class</span> <span class="pre">'tensorcircuit.noisemodel.NoiseConf'&gt;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">&lt;class</span> <span class="pre">'tencirchem.static.engine_hea.QpuConf'&gt;]</span> <span class="pre">=</span> <span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/tencirchem/static/hea.html#HEA"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#tencirchem.HEA" title="Permalink to this definition">#</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<p>Run hardware-efficient ansatz calculation.
For a comprehensive tutorial see <a class="reference internal" href="../tutorial_jupyter/noisy_simulation.html"><span class="doc">Noisy Circuit Simulation</span></a>.</p>
<dl class="py method">
<dt class="sig sig-object py" id="tencirchem.HEA.__init__">
<span class="sig-name descname"><span class="pre">__init__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">h_qubit_op</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">QubitOperator</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">circuit</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">Callable</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">QuantumCircuit</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">init_guess</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">List</span><span class="p"><span class="pre">[</span></span><span class="pre">float</span><span class="p"><span class="pre">]</span></span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">engine</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">str</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">engine_conf</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">NoiseConf</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/tencirchem/static/hea.html#HEA.__init__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#tencirchem.HEA.__init__" title="Permalink to this definition">#</a></dt>
<span class="sig-name descname"><span class="pre">__init__</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">h_qubit_op:</span> <span class="pre">~openfermion.ops.operators.qubit_operator.QubitOperator</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">circuit:</span> <span class="pre">~typing.Callable</span> <span class="pre">|</span> <span class="pre">~qiskit.circuit.quantumcircuit.QuantumCircuit</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">init_guess:</span> <span class="pre">~typing.List[float]</span> <span class="pre">|</span> <span class="pre">~numpy.ndarray</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">engine:</span> <span class="pre">str</span> <span class="pre">=</span> <span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">engine_conf:</span> <span class="pre">[&lt;class</span> <span class="pre">'tensorcircuit.noisemodel.NoiseConf'&gt;</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">&lt;class</span> <span class="pre">'tencirchem.static.engine_hea.QpuConf'&gt;]</span> <span class="pre">=</span> <span class="pre">None</span></span></em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/tencirchem/static/hea.html#HEA.__init__"><span class="viewcode-link"><span class="pre">[source]</span></span></a><a class="headerlink" href="#tencirchem.HEA.__init__" title="Permalink to this definition">#</a></dt>
<dd><p>Construct the HEA class from Hamiltonian in <code class="xref py py-class docutils literal notranslate"><span class="pre">QubitOperator</span></code> form and the ansatz.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

0 comments on commit 525f374

Please sign in to comment.