mirror of
https://github.com/qwjyh/QuantumLegos.jl.git
synced 2024-11-22 23:11:05 +09:00
156 lines
35 KiB
HTML
156 lines
35 KiB
HTML
|
<!DOCTYPE html>
|
|||
|
<html lang="en"><head><meta charset="UTF-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><title>Home · QuantumLegos.jl</title><meta name="title" content="Home · QuantumLegos.jl"/><meta property="og:title" content="Home · QuantumLegos.jl"/><meta property="twitter:title" content="Home · QuantumLegos.jl"/><meta name="description" content="Documentation for QuantumLegos.jl."/><meta property="og:description" content="Documentation for QuantumLegos.jl."/><meta property="twitter:description" content="Documentation for QuantumLegos.jl."/><script data-outdated-warner src="assets/warner.js"></script><link href="https://cdnjs.cloudflare.com/ajax/libs/lato-font/3.0.0/css/lato-font.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/juliamono/0.050/juliamono.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/fontawesome.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/solid.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/brands.min.css" rel="stylesheet" type="text/css"/><link href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.16.8/katex.min.css" rel="stylesheet" type="text/css"/><script>documenterBaseURL="."</script><script src="https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js" data-main="assets/documenter.js"></script><script src="search_index.js"></script><script src="siteinfo.js"></script><script src="../versions.js"></script><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-dark.css" data-theme-name="documenter-dark" data-theme-primary-dark/><link class="docs-theme-link" rel="stylesheet" type="text/css" href="assets/themes/documenter-light.css" data-theme-name="documenter-light" data-theme-primary/><script src="assets/themeswap.js"></script></head><body><div id="documenter"><nav class="docs-sidebar"><div class="docs-package-name"><span class="docs-autofit"><a href>QuantumLegos.jl</a></span></div><button class="docs-search-query input is-rounded is-small is-clickable my-2 mx-auto py-1 px-2" id="documenter-search-query">Search docs (Ctrl + /)</button><ul class="docs-menu"><li class="is-active"><a class="tocitem" href>Home</a><ul class="internal"><li class="toplevel"><a class="tocitem" href="#Example"><span>Example</span></a></li><li><a class="tocitem" href="#CheckMatrix-and-defining-Lego"><span>CheckMatrix and defining Lego</span></a></li><li><a class="tocitem" href="#Defining-and-Updating-State"><span>Defining and Updating State</span></a></li><li><a class="tocitem" href="#2-Lego-1-edge-state"><span>2 Lego 1 edge state</span></a></li><li class="toplevel"><a class="tocitem" href="#Internal(how-it-works)"><span>Internal(how it works)</span></a></li><li><a class="tocitem" href="#Notes-on-Overall-flow"><span>Notes on Overall flow</span></a></li><li class="toplevel"><a class="tocitem" href="#API"><span>API</span></a></li></ul></li><li><a class="tocitem" href="pauliops/">PauliOps</a></li><li><a class="tocitem" href="checkmatrix/">Details on check matrix operations</a></li><li><a class="tocitem" href="distance/">How to calculate code distance from the state.</a></li></ul><div class="docs-version-selector field has-addons"><div class="control"><span class="docs-label button is-static is-size-7">Version</span></div><div class="docs-selector control is-expanded"><div class="select is-fullwidth is-size-7"><select id="documenter-version-selector"></select></div></div></div></nav><div class="docs-main"><header class="docs-navbar"><a class="docs-sidebar-button docs-navbar-link fa-solid fa-bars is-hidden-desktop" id="documenter-sidebar-button" href="#"></a><nav class="breadcrumb"><ul class="is-hidden-mobile"><li class="is-active"><a href>Home</a></li></ul><ul class="is-hidden-tablet"><li class="is-active"><a href>Home</a></li></ul></nav><div class="docs-right"><a class="docs-navbar-link" href="https://githu
|
|||
|
|
|||
|
julia> stabilizers = pauliop.(["IIXXXX", "IIZZZZ", "ZIZZII", "IZZIZI", "IXXXII", "XIXIXI"])
|
|||
|
6-element Vector{StaticArraysCore.SVector{6, QuantumLegos.PauliOps.SinglePauliOp}}:
|
|||
|
pauliop("IIXXXX")
|
|||
|
pauliop("IIZZZZ")
|
|||
|
pauliop("ZIZZII")
|
|||
|
pauliop("IZZIZI")
|
|||
|
pauliop("IXXXII")
|
|||
|
pauliop("XIXIXI")
|
|||
|
|
|||
|
julia> cmat = checkmatrix(stabilizers)
|
|||
|
CheckMatrix with 6 generators, 6 legs:
|
|||
|
0 0 1 1 1 1 | 0 0 0 0 0 0
|
|||
|
0 0 0 0 0 0 | 0 0 1 1 1 1
|
|||
|
0 0 0 0 0 0 | 1 0 1 1 0 0
|
|||
|
0 0 0 0 0 0 | 0 1 1 0 1 0
|
|||
|
0 1 1 1 0 0 | 0 0 0 0 0 0
|
|||
|
1 0 1 0 1 0 | 0 0 0 0 0 0
|
|||
|
|
|||
|
|
|||
|
julia> cmat.nlegs
|
|||
|
6
|
|||
|
|
|||
|
julia> cmat.ngens
|
|||
|
6
|
|||
|
|
|||
|
julia> cmat.cmat
|
|||
|
6×12 Matrix{Bool}:
|
|||
|
0 0 1 1 1 1 0 0 0 0 0 0
|
|||
|
0 0 0 0 0 0 0 0 1 1 1 1
|
|||
|
0 0 0 0 0 0 1 0 1 1 0 0
|
|||
|
0 0 0 0 0 0 0 1 1 0 1 0
|
|||
|
0 1 1 1 0 0 0 0 0 0 0 0
|
|||
|
1 0 1 0 1 0 0 0 0 0 0 0
|
|||
|
|
|||
|
julia> # define lego
|
|||
|
|
|||
|
julia> lego = Lego(stabilizers)
|
|||
|
Lego{6}(6, StaticArraysCore.SVector{6, QuantumLegos.PauliOps.SinglePauliOp}[pauliop("IIXXXX"), pauliop("IIZZZZ"), pauliop("ZIZZII"), pauliop("IZZIZI"), pauliop("IXXXII"), pauliop("XIXIXI")])
|
|||
|
|
|||
|
julia> lego.stabgens |> checkmatrix
|
|||
|
CheckMatrix with 6 generators, 6 legs:
|
|||
|
0 0 1 1 1 1 | 0 0 0 0 0 0
|
|||
|
0 0 0 0 0 0 | 0 0 1 1 1 1
|
|||
|
0 0 0 0 0 0 | 1 0 1 1 0 0
|
|||
|
0 0 0 0 0 0 | 0 1 1 0 1 0
|
|||
|
0 1 1 1 0 0 | 0 0 0 0 0 0
|
|||
|
1 0 1 0 1 0 | 0 0 0 0 0 0
|
|||
|
</code></pre><ul><li><a href="pauliops/#QuantumLegos.PauliOps.pauliop-Tuple{AbstractString}"><code>pauliop</code></a></li><li><a href="checkmatrix/#QuantumLegos.checkmatrix"><code>checkmatrix</code></a> and <a href="checkmatrix/#QuantumLegos.CheckMatrix"><code>CheckMatrix</code></a></li><li><a href="#QuantumLegos.Lego"><code>Lego</code></a></li></ul><h2 id="Defining-and-Updating-State"><a class="docs-heading-anchor" href="#Defining-and-Updating-State">Defining and Updating State</a><a id="Defining-and-Updating-State-1"></a><a class="docs-heading-anchor-permalink" href="#Defining-and-Updating-State" title="Permalink"></a></h2><pre><code class="language-julia-repl hljs">julia> using QuantumLegos
|
|||
|
|
|||
|
julia> stabilizers = pauliop.(["IIXXXX", "IIZZZZ", "ZIZZII", "IZZIZI", "IXXXII", "XIXIXI"])
|
|||
|
6-element Vector{StaticArraysCore.SVector{6, QuantumLegos.PauliOps.SinglePauliOp}}:
|
|||
|
pauliop("IIXXXX")
|
|||
|
pauliop("IIZZZZ")
|
|||
|
pauliop("ZIZZII")
|
|||
|
pauliop("IZZIZI")
|
|||
|
pauliop("IXXXII")
|
|||
|
pauliop("XIXIXI")
|
|||
|
|
|||
|
julia> lego = Lego(stabilizers)
|
|||
|
Lego{6}(6, StaticArraysCore.SVector{6, QuantumLegos.PauliOps.SinglePauliOp}[pauliop("IIXXXX"), pauliop("IIZZZZ"), pauliop("ZIZZII"), pauliop("IZZIZI"), pauliop("IXXXII"), pauliop("XIXIXI")])
|
|||
|
|
|||
|
julia> # state with 1 lego, 0 leg
|
|||
|
|
|||
|
julia> st = State([lego, ], Tuple{LegoLeg, LegoLeg}[])
|
|||
|
State(Lego[Lego{6}(6, StaticArraysCore.SVector{6, QuantumLegos.PauliOps.SinglePauliOp}[pauliop("IIXXXX"), pauliop("IIZZZZ"), pauliop("ZIZZII"), pauliop("IZZIZI"), pauliop("IXXXII"), pauliop("XIXIXI")])], Tuple{LegoLeg, LegoLeg}[], CheckMatrix(Bool[0 0 … 0 0; 0 0 … 1 1; … ; 0 1 … 0 0; 1 0 … 0 0], 6, 6))
|
|||
|
|
|||
|
julia> st.cmat.cmat
|
|||
|
6×12 Matrix{Bool}:
|
|||
|
0 0 1 1 1 1 0 0 0 0 0 0
|
|||
|
0 0 0 0 0 0 0 0 1 1 1 1
|
|||
|
0 0 0 0 0 0 1 0 1 1 0 0
|
|||
|
0 0 0 0 0 0 0 1 1 0 1 0
|
|||
|
0 1 1 1 0 0 0 0 0 0 0 0
|
|||
|
1 0 1 0 1 0 0 0 0 0 0 0
|
|||
|
|
|||
|
julia> add_lego!(st, lego)
|
|||
|
State(Lego[Lego{6}(6, StaticArraysCore.SVector{6, QuantumLegos.PauliOps.SinglePauliOp}[pauliop("IIXXXX"), pauliop("IIZZZZ"), pauliop("ZIZZII"), pauliop("IZZIZI"), pauliop("IXXXII"), pauliop("XIXIXI")]), Lego{6}(6, StaticArraysCore.SVector{6, QuantumLegos.PauliOps.SinglePauliOp}[pauliop("IIXXXX"), pauliop("IIZZZZ"), pauliop("ZIZZII"), pauliop("IZZIZI"), pauliop("IXXXII"), pauliop("XIXIXI")])], Tuple{LegoLeg, LegoLeg}[], CheckMatrix(Bool[0 0 … 0 0; 0 0 … 0 0; … ; 0 0 … 0 0; 0 0 … 0 0], 12, 12))
|
|||
|
|
|||
|
julia> st.cmat.cmat
|
|||
|
12×24 Matrix{Bool}:
|
|||
|
0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|||
|
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0
|
|||
|
0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0
|
|||
|
0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0 0 0 0 0 0 0
|
|||
|
0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|||
|
1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|||
|
0 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0
|
|||
|
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1
|
|||
|
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 1 0 0
|
|||
|
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 0
|
|||
|
0 0 0 0 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|||
|
0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
|
|||
|
|
|||
|
julia> # state with 2 legos, 0 leg
|
|||
|
|
|||
|
julia> st2 = State([lego, lego], Tuple{LegoLeg, LegoLeg}[])
|
|||
|
State(Lego[Lego{6}(6, StaticArraysCore.SVector{6, QuantumLegos.PauliOps.SinglePauliOp}[pauliop("IIXXXX"), pauliop("IIZZZZ"), pauliop("ZIZZII"), pauliop("IZZIZI"), pauliop("IXXXII"), pauliop("XIXIXI")]), Lego{6}(6, StaticArraysCore.SVector{6, QuantumLegos.PauliOps.SinglePauliOp}[pauliop("IIXXXX"), pauliop("IIZZZZ"), pauliop("ZIZZII"), pauliop("IZZIZI"), pauliop("IXXXII"), pauliop("XIXIXI")])], Tuple{LegoLeg, LegoLeg}[], CheckMatrix(Bool[0 0 … 0 0; 0 0 … 0 0; … ; 0 0 … 0 0; 0 0 … 0 0], 12, 12))
|
|||
|
|
|||
|
julia> st == st2
|
|||
|
true</code></pre><h2 id="2-Lego-1-edge-state"><a class="docs-heading-anchor" href="#2-Lego-1-edge-state">2 Lego 1 edge state</a><a id="2-Lego-1-edge-state-1"></a><a class="docs-heading-anchor-permalink" href="#2-Lego-1-edge-state" title="Permalink"></a></h2><pre><code class="language-julia-repl hljs">julia> using QuantumLegos
|
|||
|
|
|||
|
julia> stabilizers = pauliop.(["IIXXXX", "IIZZZZ", "ZIZZII", "IZZIZI", "IXXXII", "XIXIXI"])
|
|||
|
6-element Vector{StaticArraysCore.SVector{6, QuantumLegos.PauliOps.SinglePauliOp}}:
|
|||
|
pauliop("IIXXXX")
|
|||
|
pauliop("IIZZZZ")
|
|||
|
pauliop("ZIZZII")
|
|||
|
pauliop("IZZIZI")
|
|||
|
pauliop("IXXXII")
|
|||
|
pauliop("XIXIXI")
|
|||
|
|
|||
|
julia> lego = Lego(stabilizers)
|
|||
|
Lego{6}(6, StaticArraysCore.SVector{6, QuantumLegos.PauliOps.SinglePauliOp}[pauliop("IIXXXX"), pauliop("IIZZZZ"), pauliop("ZIZZII"), pauliop("IZZIZI"), pauliop("IXXXII"), pauliop("XIXIXI")])
|
|||
|
|
|||
|
julia> state = State([lego, lego], edge.([((1, 3), (2, 3))]))
|
|||
|
State(Lego[Lego{6}(6, StaticArraysCore.SVector{6, QuantumLegos.PauliOps.SinglePauliOp}[pauliop("IIXXXX"), pauliop("IIZZZZ"), pauliop("ZIZZII"), pauliop("IZZIZI"), pauliop("IXXXII"), pauliop("XIXIXI")]), Lego{6}(6, StaticArraysCore.SVector{6, QuantumLegos.PauliOps.SinglePauliOp}[pauliop("IIXXXX"), pauliop("IIZZZZ"), pauliop("ZIZZII"), pauliop("IZZIZI"), pauliop("IXXXII"), pauliop("XIXIXI")])], Tuple{LegoLeg, LegoLeg}[(LegoLeg(1, 3), LegoLeg(2, 3))], CheckMatrix(Bool[1 0 … 0 0; 0 1 … 0 0; … ; 0 0 … 1 1; 0 0 … 0 1], 10, 10))
|
|||
|
|
|||
|
julia> state.cmat
|
|||
|
CheckMatrix with 10 generators, 10 legs:
|
|||
|
1 0 1 0 1 0 0 0 0 0 | 0 0 0 0 0 0 0 0 0 0
|
|||
|
0 1 0 1 1 0 0 0 0 0 | 0 0 0 0 0 0 0 0 0 0
|
|||
|
0 0 1 1 1 0 0 1 1 1 | 0 0 0 0 0 0 0 0 0 0
|
|||
|
0 0 0 0 0 1 0 1 0 1 | 0 0 0 0 0 0 0 0 0 0
|
|||
|
0 0 0 0 0 0 1 0 1 1 | 0 0 0 0 0 0 0 0 0 0
|
|||
|
0 0 0 0 0 0 0 0 0 0 | 1 0 0 1 1 0 0 0 0 0
|
|||
|
0 0 0 0 0 0 0 0 0 0 | 0 1 1 0 1 0 0 0 0 0
|
|||
|
0 0 0 0 0 0 0 0 0 0 | 0 0 1 1 1 0 0 1 1 1
|
|||
|
0 0 0 0 0 0 0 0 0 0 | 0 0 0 0 0 1 0 0 1 1
|
|||
|
0 0 0 0 0 0 0 0 0 0 | 0 0 0 0 0 0 1 1 0 1
|
|||
|
|
|||
|
|
|||
|
julia> pg = state.cmat |> generators |> GeneratedPauliGroup
|
|||
|
GeneratedPauliGroup{10}(StaticArraysCore.SVector{10, QuantumLegos.PauliOps.SinglePauliOp}[pauliop("XIXIXIIIII"), pauliop("IXIXXIIIII"), pauliop("IIXXXIIXXX"), pauliop("IIIIIXIXIX"), pauliop("IIIIIIXIXX"), pauliop("ZIIZZIIIII"), pauliop("IZZIZIIIII"), pauliop("IIZZZIIZZZ"), pauliop("IIIIIZIIZZ"), pauliop("IIIIIIZZIZ")], IterTools.Subsets{Vector{StaticArraysCore.SVector{N, QuantumLegos.PauliOps.SinglePauliOp} where N}}(StaticArraysCore.SVector{N, QuantumLegos.PauliOps.SinglePauliOp} where N[pauliop("XIXIXIIIII"), pauliop("IXIXXIIIII"), pauliop("IIXXXIIXXX"), pauliop("IIIIIXIXIX"), pauliop("IIIIIIXIXX"), pauliop("ZIIZZIIIII"), pauliop("IZZIZIIIII"), pauliop("IIZZZIIZZZ"), pauliop("IIIIIZIIZZ"), pauliop("IIIIIIZZIZ")]))
|
|||
|
|
|||
|
julia> pauliop("XIIXIXIIXI") in pg
|
|||
|
true
|
|||
|
</code></pre><h1 id="Internal(how-it-works)"><a class="docs-heading-anchor" href="#Internal(how-it-works)">Internal(how it works)</a><a id="Internal(how-it-works)-1"></a><a class="docs-heading-anchor-permalink" href="#Internal(how-it-works)" title="Permalink"></a></h1><h2 id="Notes-on-Overall-flow"><a class="docs-heading-anchor" href="#Notes-on-Overall-flow">Notes on Overall flow</a><a id="Notes-on-Overall-flow-1"></a><a class="docs-heading-anchor-permalink" href="#Notes-on-Overall-flow" title="Permalink"></a></h2><p>Details on <sup class="footnote-reference"><a id="citeref-1" href="#footnote-1">[1]</a></sup></p><ul><li>state is translated to a single check matrix<ul><li>the size is ≤ <span>$N \times 2N$</span> where <span>$N$</span> is maximum number of lego logs.</li></ul></li><li>any contraction can be performed on this single check matrix</li><li>if the check matrix can be represented as direct sum of matrices with <span>$k N$</span> columns where <span>$k ∈ ℕ$</span>, then they are not contracted</li></ul><h3 id="Construction-of-State"><a class="docs-heading-anchor" href="#Construction-of-State">Construction of State</a><a id="Construction-of-State-1"></a><a class="docs-heading-anchor-permalink" href="#Construction-of-State" title="Permalink"></a></h3><p>Construction of <code>State</code> is completed by calling <code>State</code> constructor recursively.</p><ol><li>Construct <code>State</code> without edge. Just adding legos. Checkmatrix is just a direct sum of each lego's checkmatrix</li><li>Concatenate each edges. During this operation, self tracing of checkmatrix is evaluated.</li></ol><p>Each constructor calls action function (which is a map from <code>State</code> to <code>State</code>). Therefore, action functions can be used both for direct construction of <code>State</code> and action application to <code>State</code> during the game.</p><h1 id="API"><a class="docs-heading-anchor" href="#API">API</a><a id="API-1"></a><a class="docs-heading-anchor-permalink" href="#API" title="Permalink"></a></h1><ul><li><a href="pauliops/#QuantumLegos.PauliOps"><code>QuantumLegos.PauliOps</code></a></li><li><a href="checkmatrix/#QuantumLegos.CheckMatrix"><code>QuantumLegos.CheckMatrix</code></a></li><li><a href="#QuantumLegos.Lego"><code>QuantumLegos.Lego</code></a></li><li><a href="#QuantumLegos.LegoLeg"><code>QuantumLegos.LegoLeg</code></a></li><li><a href="pauliops/#QuantumLegos.PauliOps.GeneratedPauliGroup"><code>QuantumLegos.PauliOps.GeneratedPauliGroup</code></a></li><li><a href="pauliops/#QuantumLegos.PauliOps.PauliOp"><code>QuantumLegos.PauliOps.PauliOp</code></a></li><li><a href="pauliops/#QuantumLegos.PauliOps.SinglePauliOp"><code>QuantumLegos.PauliOps.SinglePauliOp</code></a></li><li><a href="#QuantumLegos.State"><code>QuantumLegos.State</code></a></li><li><a href="pauliops/#QuantumLegos.PauliOps.pauliop-Tuple{AbstractString}"><code>QuantumLegos.PauliOps.pauliop</code></a></li><li><a href="pauliops/#QuantumLegos.PauliOps.single_pauliop-Tuple{Char}"><code>QuantumLegos.PauliOps.single_pauliop</code></a></li><li><a href="pauliops/#QuantumLegos.PauliOps.weight"><code>QuantumLegos.PauliOps.weight</code></a></li><li><a href="pauliops/#QuantumLegos.PauliOps.xweight"><code>QuantumLegos.PauliOps.xweight</code></a></li><li><a href="pauliops/#QuantumLegos.PauliOps.zweight"><code>QuantumLegos.PauliOps.zweight</code></a></li><li><a href="#QuantumLegos._naive_distance-Tuple{State}"><code>QuantumLegos._naive_distance</code></a></li><li><a href="#QuantumLegos.add_edge!-Tuple{State, LegoLeg, LegoLeg}"><code>QuantumLegos.add_edge!</code></a></li><li><a href="#QuantumLegos.add_lego!-Tuple{State, Lego}"><code>QuantumLegos.add_lego!</code></a></li><li><a href="checkmatrix/#QuantumLegos.align_row!"><code>QuantumLegos.align_row!</code></a></li><li><a href="checkmatrix/#QuantumLegos.checkmatrix"><code>QuantumLegos.checkmatrix</code></a></li><li><a href="#QuantumLegos.cmat_index-Tuple{State, LegoLeg}"><code>QuantumLegos.cmat_index</code></a></li><li><a href="checkmatrix/#QuantumLegos.direct_sum"><code>QuantumLegos.direct_sum</
|
|||
|
2-element Vector{StaticArraysCore.SVector{2, QuantumLegos.PauliOps.SinglePauliOp}}:
|
|||
|
pauliop("II")
|
|||
|
pauliop("XX")
|
|||
|
|
|||
|
julia> Lego(stabgens)
|
|||
|
Lego{2}(2, StaticArraysCore.SVector{2, QuantumLegos.PauliOps.SinglePauliOp}[pauliop("II"), pauliop("XX")])</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/qwjyh/QuantumLegos.jl/blob/fda016f02dad2c2600c16e88335a3733b9e1c284/src/game.jl#L8-L31">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="QuantumLegos.LegoLeg" href="#QuantumLegos.LegoLeg"><code>QuantumLegos.LegoLeg</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">mutable struct State</code></pre><p>To be used in <a href="#QuantumLegos.State"><code>State</code></a>.</p><p><strong>Fields</strong></p><ul><li><code>lego_id::Int64</code>: index in <code>legos</code> in <code>State</code></li><li><code>edge_id::Int64</code>: index in <code>Lego</code> in <code>legos</code> in <code>State</code>. No validation check included in <code>LegoLeg</code>.</li></ul><p><strong>Example</strong></p><pre><code class="language-julia-repl hljs">julia> x = LegoLeg.([(2, 1), (1, 1), (1, 0)])
|
|||
|
3-element Vector{LegoLeg}:
|
|||
|
LegoLeg(2, 1)
|
|||
|
LegoLeg(1, 1)
|
|||
|
LegoLeg(1, 0)
|
|||
|
|
|||
|
julia> sort(x)
|
|||
|
3-element Vector{LegoLeg}:
|
|||
|
LegoLeg(1, 0)
|
|||
|
LegoLeg(1, 1)
|
|||
|
LegoLeg(2, 1)</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/qwjyh/QuantumLegos.jl/blob/fda016f02dad2c2600c16e88335a3733b9e1c284/src/game.jl#L50-L73">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="QuantumLegos.State" href="#QuantumLegos.State"><code>QuantumLegos.State</code></a> — <span class="docstring-category">Type</span></header><section><div><pre><code class="language-julia hljs">mutable struct State</code></pre><p>State (in p.4)</p><p><strong>Fields</strong></p><ul><li><code>legos</code>: <code>Vector{Lego}</code></li><li><code>edges</code>: Vector of ((<code>lego_i, leg_n</code>), (<code>lego_j, leg_m</code>)). Each element is sorted (i.e. <code>lego_i < lego_j</code> or <code>lego_i == lego_j && leg_n < leg_m</code>). This feature is used in <a href="#QuantumLegos.is_connected_to_firstlego-Tuple{State}"><code>is_connected_to_firstlego</code></a>.</li><li><code>cmat::CheckMatrix</code>: CheckMatrix</li></ul><p><strong>Constructor</strong></p><pre><code class="nohighlight hljs">State(legos::Vector{Lego{N}}, edges::Vector{Tuple{LegoLeg, LegoLeg}})</code></pre><p><strong>Methods with</strong></p><ul><li><a href="#QuantumLegos.add_lego!-Tuple{State, Lego}"><code>add_lego!</code></a></li><li><a href="#QuantumLegos.add_edge!-Tuple{State, LegoLeg, LegoLeg}"><code>add_edge!</code></a></li></ul><p><strong>Example</strong></p><p>TODO</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/qwjyh/QuantumLegos.jl/blob/fda016f02dad2c2600c16e88335a3733b9e1c284/src/game.jl#L115-L136">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="QuantumLegos._naive_distance-Tuple{State}" href="#QuantumLegos._naive_distance-Tuple{State}"><code>QuantumLegos._naive_distance</code></a> — <span class="docstring-category">Method</span></header><section><div><p>Calculate distance. Use minimum distance of all generated normalizers.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/qwjyh/QuantumLegos.jl/blob/fda016f02dad2c2600c16e88335a3733b9e1c284/src/game.jl#L261-L264">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="QuantumLegos.add_edge!-Tuple{State, LegoLeg, LegoLeg}" href="#QuantumLegos.add_edge!-Tuple{State, LegoLeg, LegoLeg}"><code>QuantumLegos.add_edge!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">add_edge!(state::State, leg_1::LegoLeg, leg_2::LegoLeg)::State</code></pre><p>Add a new edge between <code>leg_1</code> and <code>leg_2</code>, updating <code>state</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/qwjyh/QuantumLegos.jl/blob/fda016f02dad2c2600c16e88335a3733b9e1c284/src/game.jl#L209-L213">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button fa-solid fa-chevron-down" href="javascript:;" title="Collapse docstring"></a><a class="docstring-binding" id="QuantumLegos.add_lego!-Tuple{State, Lego}" href="#QuantumLegos.add_lego!-Tuple{State, Lego}"><code>QuantumLegos.add_lego!</code></a> — <span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">add_lego!(state::State, lego::Lego) -> State</code></pre><p>Add a new lego, updating <code>state</code>.</p></div><a class="docs-sourcelink" target="_blank" href="https://github.com/qwjyh/QuantumLegos.jl/blob/fda016f02dad2c2600c16e88335a3733b9e1c284/src/game.jl#L171-L175">source</a></section></article><article class="docstring"><header><a class="docstring-article-toggle-button f
|