Skip to content

Commit

Permalink
build based on a571d02
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Sep 25, 2023
1 parent 67365c2 commit bda7835
Show file tree
Hide file tree
Showing 43 changed files with 1,387 additions and 1,419 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.9.3","generation_timestamp":"2023-09-25T19:14:44","documenter_version":"1.0.1"}}
{"documenter":{"julia_version":"1.9.3","generation_timestamp":"2023-09-25T20:20:03","documenter_version":"1.0.1"}}
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions dev/generated/Coloring/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

locations = [[rot15(0.0, 2.0, i) for i=0:4]..., [rot15(0.0, 1.0, i) for i=0:4]...]

show_graph(graph; locs=locations, format=:svg)</code></pre><img src="48da499f.svg" alt="Example block output"/><h2 id="Generic-tensor-network-representation"><a class="docs-heading-anchor" href="#Generic-tensor-network-representation">Generic tensor network representation</a><a id="Generic-tensor-network-representation-1"></a><a class="docs-heading-anchor-permalink" href="#Generic-tensor-network-representation" title="Permalink"></a></h2><p>We construct the tensor network for the 3-coloring problem as</p><pre><code class="language-julia hljs">problem = Coloring{3}(graph);</code></pre><h3 id="Theory-(can-skip)"><a class="docs-heading-anchor" href="#Theory-(can-skip)">Theory (can skip)</a><a id="Theory-(can-skip)-1"></a><a class="docs-heading-anchor-permalink" href="#Theory-(can-skip)" title="Permalink"></a></h3><p>Type <a href="../../ref/#GenericTensorNetworks.Coloring"><code>Coloring</code></a> can be used for constructing the tensor network with optimized contraction order for a coloring problem. Let us use 3-coloring problem defined on vertices as an example. For a vertex <span>$v$</span>, we define the degrees of freedom <span>$c_v\in\{1,2,3\}$</span> and a vertex tensor labelled by it as</p><p class="math-container">\[W(v) = \left(\begin{matrix}
show_graph(graph; locs=locations, format=:svg)</code></pre><img src="562ae81f.svg" alt="Example block output"/><h2 id="Generic-tensor-network-representation"><a class="docs-heading-anchor" href="#Generic-tensor-network-representation">Generic tensor network representation</a><a id="Generic-tensor-network-representation-1"></a><a class="docs-heading-anchor-permalink" href="#Generic-tensor-network-representation" title="Permalink"></a></h2><p>We construct the tensor network for the 3-coloring problem as</p><pre><code class="language-julia hljs">problem = Coloring{3}(graph);</code></pre><h3 id="Theory-(can-skip)"><a class="docs-heading-anchor" href="#Theory-(can-skip)">Theory (can skip)</a><a id="Theory-(can-skip)-1"></a><a class="docs-heading-anchor-permalink" href="#Theory-(can-skip)" title="Permalink"></a></h3><p>Type <a href="../../ref/#GenericTensorNetworks.Coloring"><code>Coloring</code></a> can be used for constructing the tensor network with optimized contraction order for a coloring problem. Let us use 3-coloring problem defined on vertices as an example. For a vertex <span>$v$</span>, we define the degrees of freedom <span>$c_v\in\{1,2,3\}$</span> and a vertex tensor labelled by it as</p><p class="math-container">\[W(v) = \left(\begin{matrix}
1\\
1\\
1
Expand All @@ -20,9 +20,9 @@
vertex_color_map = Dict(0=&gt;&quot;red&quot;, 1=&gt;&quot;green&quot;, 2=&gt;&quot;blue&quot;)

show_graph(graph; locs=locations, format=:svg, vertex_colors=[vertex_color_map[Int(c)]
for c in single_solution.c.data])</code></pre><img src="6948b7a5.svg" alt="Example block output"/><p>Let us try to solve the same issue on its line graph, a graph that generated by mapping an edge to a vertex and two edges sharing a common vertex will be connected.</p><pre><code class="language-julia hljs">linegraph = line_graph(graph)
for c in single_solution.c.data])</code></pre><img src="c2dd93f2.svg" alt="Example block output"/><p>Let us try to solve the same issue on its line graph, a graph that generated by mapping an edge to a vertex and two edges sharing a common vertex will be connected.</p><pre><code class="language-julia hljs">linegraph = line_graph(graph)

show_graph(linegraph; locs=[0.5 .* (locations[e.src] .+ locations[e.dst])
for e in edges(graph)], format=:svg)</code></pre><img src="e6ffa2e3.svg" alt="Example block output"/><p>Let us construct the tensor network and see if there are solutions.</p><pre><code class="language-julia hljs">lineproblem = Coloring{3}(linegraph);
for e in edges(graph)], format=:svg)</code></pre><img src="beec6420.svg" alt="Example block output"/><p>Let us construct the tensor network and see if there are solutions.</p><pre><code class="language-julia hljs">lineproblem = Coloring{3}(linegraph);

num_of_coloring = solve(lineproblem, CountingMax())[]</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">(28.0, 1800.0)ₜ</code></pre><p>You will see the maximum size 28 is smaller than the number of edges in the <code>linegraph</code>, meaning no solution for the 3-coloring on edges of a Petersen graph.</p><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="../PaintShop/">« Binary paint shop problem</a><a class="docs-footer-nextpage" href="../DominatingSet/">Dominating set problem »</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="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.0.1 on <span class="colophon-date" title="Monday 25 September 2023 19:14">Monday 25 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
num_of_coloring = solve(lineproblem, CountingMax())[]</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">(28.0, 1800.0)ₜ</code></pre><p>You will see the maximum size 28 is smaller than the number of edges in the <code>linegraph</code>, meaning no solution for the 3-coloring on edges of a Petersen graph.</p><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="../PaintShop/">« Binary paint shop problem</a><a class="docs-footer-nextpage" href="../DominatingSet/">Dominating set problem »</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="documenter-light">documenter-light</option><option value="documenter-dark">documenter-dark</option><option value="auto">Automatic (OS)</option></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.0.1 on <span class="colophon-date" title="Monday 25 September 2023 20:20">Monday 25 September 2023</span>. Using Julia version 1.9.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit bda7835

Please sign in to comment.