Skip to content

Commit

Permalink
build based on ee452ab
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Nov 27, 2024
1 parent f0f0bb5 commit 5a45d1b
Show file tree
Hide file tree
Showing 25 changed files with 481 additions and 485 deletions.
2 changes: 1 addition & 1 deletion dev/.documenter-siteinfo.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-11-24T04:55:52","documenter_version":"1.8.0"}}
{"documenter":{"julia_version":"1.11.1","generation_timestamp":"2024-11-27T01:53:21","documenter_version":"1.8.0"}}
2 changes: 1 addition & 1 deletion dev/benchmarks.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dev/dev/index.html

Large diffs are not rendered by default.

152 changes: 76 additions & 76 deletions dev/generated/examples/1.prepare-ghz-state/index.html

Large diffs are not rendered by default.

130 changes: 65 additions & 65 deletions dev/generated/examples/2.qft-phase-estimation/index.html

Large diffs are not rendered by default.

46 changes: 21 additions & 25 deletions dev/generated/examples/3.grover-search/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,7 @@
number of iter = 5
number of iter = 6
number of iter = 7
number of iter = 8
number of iter = 9
number of iter = 10
success, overlap = 1.0 + 0.0im
success, overlap = -1.0 + 0.0im
</code></pre><p>The final state has an overlap of <code>1</code> with the target state.</p><h2 id="Amplitude-Amplification"><a class="docs-heading-anchor" href="#Amplitude-Amplification">Amplitude Amplification</a><a id="Amplitude-Amplification-1"></a><a class="docs-heading-anchor-permalink" href="#Amplitude-Amplification" title="Permalink"></a></h2><p>Given a circuit to generate a state, now we want to project out the subspace with [1,3,5,8,9,11,12] fixed to 1 and [4,6] fixed to 0. We can construct an oracle</p><pre><code class="language-julia hljs">evidense = [1, 3, -4, 5, -6, 8, 9, 11, 12]
function inference_oracle(nbit::Int, locs::Vector{Int})
control(nbit, locs[1:end-1], abs(locs[end]) =&gt; (locs[end]&gt;0 ? Z : -Z))
Expand All @@ -134,24 +131,23 @@
for i = 1:num_grover_step(oracle, gen)
grover_step!(reg, oracle, gen)
println(&quot;step $(i-1), overlap = $(abs(reg&#39;*solution))&quot;)
end</code></pre><pre><code class="nohighlight hljs">step 0, overlap = 0.11457856932749395
step 1, overlap = 0.19021840433085546
step 2, overlap = 0.2647440104263067
step 3, overlap = 0.3377188442363379
step 4, overlap = 0.408715446232692
step 5, overlap = 0.47731794463584265
step 6, overlap = 0.543124491437735
step 7, overlap = 0.6057496162784728
step 8, overlap = 0.6648264843888095
step 9, overlap = 0.7200090453722614
step 10, overlap = 0.7709740602400635
step 11, overlap = 0.817422994825359
step 12, overlap = 0.859083768485696
step 13, overlap = 0.8957123478505835
step 14, overlap = 0.9270941762785245
step 15, overlap = 0.9530454306502978
step 16, overlap = 0.9734140981366541
step 17, overlap = 0.9880808666331276
step 18, overlap = 0.9969598236461193
step 19, overlap = 0.9999989595364428
</code></pre><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../2.qft-phase-estimation/index.html">« Quantum Fourier Transformation and Phase Estimation</a><a class="docs-footer-nextpage" href="../4.shor-algorithm/index.html">Shor&#39;s Algorithm »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.8.0 on <span class="colophon-date" title="Sunday 24 November 2024 04:55">Sunday 24 November 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
end</code></pre><pre><code class="nohighlight hljs">step 0, overlap = 0.11480007965675817
step 1, overlap = 0.19058324193670428
step 2, overlap = 0.2652457005602443
step 3, overlap = 0.33834841120466996
step 4, overlap = 0.40946150147259774
step 5, overlap = 0.4781667987090151
step 6, overlap = 0.5440602890192854
step 7, overlap = 0.6067544930281308
step 8, overlap = 0.6658807444092039
step 9, overlap = 0.7210913577866083
step 10, overlap = 0.7720616732602615
step 11, overlap = 0.8184919655324984
step 12, overlap = 0.8601092064095035
step 13, overlap = 0.89666867031338
step 14, overlap = 0.9279553733638201
step 15, overlap = 0.9537853375670116
step 16, overlap = 0.974006672677868
step 17, overlap = 0.9885004693737958
step 18, overlap = 0.997181498487807
</code></pre><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../2.qft-phase-estimation/index.html">« Quantum Fourier Transformation and Phase Estimation</a><a class="docs-footer-nextpage" href="../4.shor-algorithm/index.html">Shor&#39;s Algorithm »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.8.0 on <span class="colophon-date" title="Wednesday 27 November 2024 01:53">Wednesday 27 November 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion dev/generated/examples/4.shor-algorithm/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -216,4 +216,4 @@
N = nbit+ncbit
chain(N, repeat(N, H, 1:ncbit), KMod(N, ncbit, x, L),
subroutine(N, qft_circuit(ncbit)&#39;, 1:ncbit))
end</code></pre><pre><code class="nohighlight hljs">Main.var&quot;##235&quot;.order_finding_circuit</code></pre><p>The circuit for order finding is consisted of three parts</p><ol><li>Hadamard gates,</li><li><code>KMod</code> that computes a classical function <code>mod(a^k*x, L)</code>.</li></ol><p><code>k</code> is the integer stored in first <code>K</code> (or <code>ncbit</code>) qubits and the rest <code>N-K</code> qubits stores <code>a</code>. Notice it is not a basic gate, it should have been compiled to multiple gates, which is not implemented in <code>Yao</code> for the moment. To learn more about implementing arithmatics on a quantum circuit, please read <a href="https://arxiv.org/abs/1805.12445">this paper</a>.</p><ol><li>Inverse quantum fourier transformation.</li></ol><h2 id="Run"><a class="docs-heading-anchor" href="#Run">Run</a><a id="Run-1"></a><a class="docs-heading-anchor-permalink" href="#Run" title="Permalink"></a></h2><p>Factorizing <code>15</code>, you should see <code>3</code> or <code>5</code>, please report a bug if it is not...</p><pre><code class="language-julia hljs">shor(15, Val(:quantum))</code></pre><pre><code class="nohighlight hljs">3</code></pre><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../3.grover-search/index.html">« Grover Search</a><a class="docs-footer-nextpage" href="../5.shor-9-code/index.html">Shor&#39;s 9 qubit code »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.8.0 on <span class="colophon-date" title="Sunday 24 November 2024 04:55">Sunday 24 November 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
end</code></pre><pre><code class="nohighlight hljs">Main.var&quot;##235&quot;.order_finding_circuit</code></pre><p>The circuit for order finding is consisted of three parts</p><ol><li>Hadamard gates,</li><li><code>KMod</code> that computes a classical function <code>mod(a^k*x, L)</code>.</li></ol><p><code>k</code> is the integer stored in first <code>K</code> (or <code>ncbit</code>) qubits and the rest <code>N-K</code> qubits stores <code>a</code>. Notice it is not a basic gate, it should have been compiled to multiple gates, which is not implemented in <code>Yao</code> for the moment. To learn more about implementing arithmatics on a quantum circuit, please read <a href="https://arxiv.org/abs/1805.12445">this paper</a>.</p><ol><li>Inverse quantum fourier transformation.</li></ol><h2 id="Run"><a class="docs-heading-anchor" href="#Run">Run</a><a id="Run-1"></a><a class="docs-heading-anchor-permalink" href="#Run" title="Permalink"></a></h2><p>Factorizing <code>15</code>, you should see <code>3</code> or <code>5</code>, please report a bug if it is not...</p><pre><code class="language-julia hljs">shor(15, Val(:quantum))</code></pre><pre><code class="nohighlight hljs">3</code></pre><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../3.grover-search/index.html">« Grover Search</a><a class="docs-footer-nextpage" href="../5.shor-9-code/index.html">Shor&#39;s 9 qubit code »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.8.0 on <span class="colophon-date" title="Wednesday 27 November 2024 01:53">Wednesday 27 November 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
2 changes: 1 addition & 1 deletion dev/generated/examples/5.shor-9-code/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
)</code></pre><pre><code class="nohighlight hljs">shor (generic function with 1 method)</code></pre><p>Now we can check whether it can correct a given error by doing symbolic computation on an arbitrary 1-qubit pure quantum state <span>$α|0⟩ + β|1⟩$</span> and a specific weight-9 error.</p><pre><code class="language-julia hljs">@vars α β
s = α * ket&quot;0&quot; + β * ket&quot;1&quot; |&gt; append_qudits!(8)
E = kron(1=&gt;X, 2=&gt;Z, 3=&gt;Z, 4=&gt;X, 5=&gt;Z, 6=&gt;Z, 7=&gt;X, 8=&gt;Z, 9=&gt;Z);
s |&gt; shor(E) |&gt; expand</code></pre><pre><code class="nohighlight hljs">α|110110110⟩ + β|110110111⟩</code></pre><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../4.shor-algorithm/index.html">« Shor&#39;s Algorithm</a><a class="docs-footer-nextpage" href="../6.quantum-circuit-born-machine/index.html">Quantum Circuit Born Machine »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.8.0 on <span class="colophon-date" title="Sunday 24 November 2024 04:55">Sunday 24 November 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
s |&gt; shor(E) |&gt; expand</code></pre><pre><code class="nohighlight hljs">α|110110110⟩ + β|110110111⟩</code></pre><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../4.shor-algorithm/index.html">« Shor&#39;s Algorithm</a><a class="docs-footer-nextpage" href="../6.quantum-circuit-born-machine/index.html">Quantum Circuit Born Machine »</a><div class="flexbox-break"></div><p class="footer-message">Powered by <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> and the <a href="https://julialang.org/">Julia Programming Language</a>.</p></nav></div><div class="modal" id="documenter-settings"><div class="modal-background"></div><div class="modal-card"><header class="modal-card-head"><p class="modal-card-title">Settings</p><button class="delete"></button></header><section class="modal-card-body"><p><label class="label">Theme</label><div class="select"><select id="documenter-themepicker"><option value="auto">Automatic (OS)</option><option value="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="catppuccin-latte">catppuccin-latte</option><option value="catppuccin-frappe">catppuccin-frappe</option><option value="catppuccin-macchiato">catppuccin-macchiato</option><option value="catppuccin-mocha">catppuccin-mocha</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.8.0 on <span class="colophon-date" title="Wednesday 27 November 2024 01:53">Wednesday 27 November 2024</span>. Using Julia version 1.11.1.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 5a45d1b

Please sign in to comment.