Skip to content

Commit

Permalink
build based on 72a51f8
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Jul 6, 2024
1 parent 2448f60 commit 1aa9985
Show file tree
Hide file tree
Showing 20 changed files with 478 additions and 473 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.10.4","generation_timestamp":"2024-07-06T08:27:45","documenter_version":"1.5.0"}}
{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-07-06T08:33:46","documenter_version":"1.5.0"}}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions dev/generated/clifford/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
pm.perm, pm.vals</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">([1, 4, 3, 2], Int8[1, 1, -1, 1])</code></pre><p>With the permutation matrix, we can apply a Clifford gate to a Pauli string by <a href="../../man/#TensorQEC.perm_of_paulistring-Tuple{PauliString, Pair{Vector{Int64}, &lt;:LuxurySparse.PermMatrix}}"><code>perm_of_paulistring</code></a>. Here we apply the Hadamard gate to the second qubit of Pauli string <span>$I_1X_2$</span> and get <span>$I_1Z_2$</span> with a phase <span>$1$</span>.</p><pre><code class="language-julia hljs">ps1 = PauliString(I2, X)
ps2, phase = perm_of_paulistring(ps1, [2]=&gt;pm)
ps1, ps2, phase</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">(IX, IZ, 1)</code></pre><p>Put those all together, we can apply a Clifford circuit to a Pauli string by <a href="../../man/#TensorQEC.clifford_simulate-Tuple{PauliString, YaoBlocks.ChainBlock}"><code>clifford_simulate</code></a>.</p><pre><code class="language-julia hljs">qc = chain(put(5, 1 =&gt; H), control(5, 1, 2 =&gt; Z), control(5, 3, 4 =&gt; X), control(5, 5, 3 =&gt; X), put(5, 1 =&gt; X))
vizcircuit(qc)</code></pre><img src="6475e29e.svg" alt="Example block output"/><p>Apply the circuit to Pauli string <span>$Z_1Y_2I_3Y_4X_5$</span>, we get <span>$Y_1X_2Y_3Y_4Y_5$</span> with a phase <span>$1$</span>.</p><pre><code class="language-julia hljs">ps = PauliString(Z, Y, I2, Y, X)
vizcircuit(qc)</code></pre><img src="95909b23.svg" alt="Example block output"/><p>Apply the circuit to Pauli string <span>$Z_1Y_2I_3Y_4X_5$</span>, we get <span>$Y_1X_2Y_3Y_4Y_5$</span> with a phase <span>$1$</span>.</p><pre><code class="language-julia hljs">ps = PauliString(Z, Y, I2, Y, X)
ps2, phase = clifford_simulate(ps, qc)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">(YXYYY, -1)</code></pre><p>where <code>ps2</code> is the Pauli string after the Clifford circuit and <code>phase</code> is the phase factor. It corresponds to the following quantum circuit.</p><pre><code class="language-julia hljs">clifford_simulation_circuit = chain(qc&#39;, ps, qc)
CircuitStyles.barrier_for_chain[] = true # setup barrier for better visualization
vizcircuit(clifford_simulation_circuit)</code></pre><img src="b53d2ed2.svg" alt="Example block output"/><p>We can check the result by</p><pre><code class="language-julia hljs">CircuitStyles.barrier_for_chain[] = false # disable barrier
phase * mat(clifford_simulation_circuit) ≈ mat(ps2)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">true</code></pre><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p><section class="footnotes is-size-7"><ul><li class="footnote" id="footnote-Bravyi2022"><a class="tag is-link" href="#citeref-Bravyi2022">Bravyi2022</a>Bravyi, S., Latone, J.A., Maslov, D., 2022. 6-qubit optimal Clifford circuits. npj Quantum Inf 8, 1–12. https://doi.org/10.1038/s41534-022-00583-7</li></ul></section></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../codes/">« QEC Codes</a><a class="docs-footer-nextpage" href="../inference/">Inference with Tensor Network »</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.5.0 on <span class="colophon-date" title="Saturday 6 July 2024 08:27">Saturday 6 July 2024</span>. Using Julia version 1.10.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
vizcircuit(clifford_simulation_circuit)</code></pre><img src="569d0720.svg" alt="Example block output"/><p>We can check the result by</p><pre><code class="language-julia hljs">CircuitStyles.barrier_for_chain[] = false # disable barrier
phase * mat(clifford_simulation_circuit) ≈ mat(ps2)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">true</code></pre><hr/><p><em>This page was generated using <a href="https://github.com/fredrikekre/Literate.jl">Literate.jl</a>.</em></p><section class="footnotes is-size-7"><ul><li class="footnote" id="footnote-Bravyi2022"><a class="tag is-link" href="#citeref-Bravyi2022">Bravyi2022</a>Bravyi, S., Latone, J.A., Maslov, D., 2022. 6-qubit optimal Clifford circuits. npj Quantum Inf 8, 1–12. https://doi.org/10.1038/s41534-022-00583-7</li></ul></section></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../codes/">« QEC Codes</a><a class="docs-footer-nextpage" href="../inference/">Inference with Tensor Network »</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.5.0 on <span class="colophon-date" title="Saturday 6 July 2024 08:33">Saturday 6 July 2024</span>. Using Julia version 1.10.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 1aa9985

Please sign in to comment.