Skip to content

Commit

Permalink
build based on bfdecd4
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Jun 7, 2024
1 parent 241884b commit 417a043
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions dev/dimension/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

julia> dimensionality(PeriodicGraph("1 1 1 2"))
Dict{Int64, Vector{Tuple{Vector{Int64}, Int64}}} with 1 entry:
1 =&gt; [([1], 2)]</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/Liozou/PeriodicGraphs.jl/blob/708afbe85957a755ebc86a1509b273afbf98da85/src/algorithms/dimensionality.jl#L235-L257">source</a></section></article><p>To transpose a graph from one dimension <code>N</code> to another <code>D</code>, call the type constructor <a href="#PeriodicGraphs.PeriodicGraph-Union{Tuple{PeriodicGraph{N}}, Tuple{N}, Tuple{D}, Tuple{PeriodicGraph{N}, Any}} where {D, N}"><code>PeriodicGraph{D}</code></a> directly on <code>g::PeriodicGraph{N}</code>. This can be useful to manipulate a graph of dimensionality <code>D</code> as a graph of actual dimension <code>D</code>, which often reduces computational costs.</p><article class="docstring"><header><a class="docstring-binding" id="PeriodicGraphs.PeriodicGraph-Union{Tuple{PeriodicGraph{N}}, Tuple{N}, Tuple{D}, Tuple{PeriodicGraph{N}, Any}} where {D, N}" href="#PeriodicGraphs.PeriodicGraph-Union{Tuple{PeriodicGraph{N}}, Tuple{N}, Tuple{D}, Tuple{PeriodicGraph{N}, Any}} where {D, N}"><code>PeriodicGraphs.PeriodicGraph</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">PeriodicGraph{D}(graph::PeriodicGraph{N}) where {D,N}</code></pre><p>Return a graph that has the same structural information as the input <code>graph</code> but embedded in <code>D</code> dimensions instead of <code>N</code>. It will fail if the dimensionality of the graph is greater than <code>D</code>.</p><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>The behaviour is undefined if <code>D &lt; N</code> and there are multiple non-identical connected components. In particular, the function is expected to fail if these components do not share the same orientation.</p></div></div></div><a class="docs-sourcelink" target="_blank" href="https://github.com/Liozou/PeriodicGraphs.jl/blob/708afbe85957a755ebc86a1509b273afbf98da85/src/algorithms/dimensionality.jl#L275-L286">source</a></section></article><p>For example, the following function extracts the list of 1-dimensional components from a given <code>PeriodicGraph</code>:</p><pre><code class="language-julia-repl hljs">julia&gt; function extract_1D_components(g::PeriodicGraph{D}) where D
1 =&gt; [([1], 2)]</code></pre></div><a class="docs-sourcelink" target="_blank" href="https://github.com/Liozou/PeriodicGraphs.jl/blob/bfdecd4dee3074e81b710e5f4a67ed3807fef5ec/src/algorithms/dimensionality.jl#L235-L257">source</a></section></article><p>To transpose a graph from one dimension <code>N</code> to another <code>D</code>, call the type constructor <a href="#PeriodicGraphs.PeriodicGraph-Union{Tuple{PeriodicGraph{N}}, Tuple{N}, Tuple{D}, Tuple{PeriodicGraph{N}, Any}} where {D, N}"><code>PeriodicGraph{D}</code></a> directly on <code>g::PeriodicGraph{N}</code>. This can be useful to manipulate a graph of dimensionality <code>D</code> as a graph of actual dimension <code>D</code>, which often reduces computational costs.</p><article class="docstring"><header><a class="docstring-binding" id="PeriodicGraphs.PeriodicGraph-Union{Tuple{PeriodicGraph{N}}, Tuple{N}, Tuple{D}, Tuple{PeriodicGraph{N}, Any}} where {D, N}" href="#PeriodicGraphs.PeriodicGraph-Union{Tuple{PeriodicGraph{N}}, Tuple{N}, Tuple{D}, Tuple{PeriodicGraph{N}, Any}} where {D, N}"><code>PeriodicGraphs.PeriodicGraph</code></a><span class="docstring-category">Method</span></header><section><div><pre><code class="language-julia hljs">PeriodicGraph{D}(graph::PeriodicGraph{N}) where {D,N}</code></pre><p>Return a graph that has the same structural information as the input <code>graph</code> but embedded in <code>D</code> dimensions instead of <code>N</code>. It will fail if the dimensionality of the graph is greater than <code>D</code>.</p><div class="admonition is-info"><header class="admonition-header">Note</header><div class="admonition-body"><p>The behaviour is undefined if <code>D &lt; N</code> and there are multiple non-identical connected components. In particular, the function is expected to fail if these components do not share the same orientation.</p></div></div></div><a class="docs-sourcelink" target="_blank" href="https://github.com/Liozou/PeriodicGraphs.jl/blob/bfdecd4dee3074e81b710e5f4a67ed3807fef5ec/src/algorithms/dimensionality.jl#L275-L286">source</a></section></article><p>For example, the following function extracts the list of 1-dimensional components from a given <code>PeriodicGraph</code>:</p><pre><code class="language-julia-repl hljs">julia&gt; function extract_1D_components(g::PeriodicGraph{D}) where D
d = dimensionality(g)
components1D = get(d, 1, Vector{Int}[])
return [PeriodicGraph1D(g[l]) for l in components1D]
Expand All @@ -21,4 +21,4 @@
julia&gt; extract_1D_components(g)
2-element Vector{PeriodicGraph1D}:
PeriodicGraph1D(1, PeriodicEdge1D[(1, 1, (1,))])
PeriodicGraph1D(2, PeriodicEdge1D[(1, 2, (-1,)), (1, 2, (1,))])</code></pre><p>The first subgraph corresponds to <code>g[[3]]</code> and the second to <code>g[[6,7]]</code>, both converted to <code>PeriodicGraph1D</code>.</p><p>The dimension of a graph can also be reduced with loss of information through the <a href="../utilities/#PeriodicGraphs.slice_graph"><code>slice_graph</code></a> function.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../symmetries/">« Symmetries</a><a class="docs-footer-nextpage" href="../rings/">Rings »</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Wednesday 5 July 2023 13:56">Wednesday 5 July 2023</span>. Using Julia version 1.6.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
PeriodicGraph1D(2, PeriodicEdge1D[(1, 2, (-1,)), (1, 2, (1,))])</code></pre><p>The first subgraph corresponds to <code>g[[3]]</code> and the second to <code>g[[6,7]]</code>, both converted to <code>PeriodicGraph1D</code>.</p><p>The dimension of a graph can also be reduced with loss of information through the <a href="../utilities/#PeriodicGraphs.slice_graph"><code>slice_graph</code></a> function.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../symmetries/">« Symmetries</a><a class="docs-footer-nextpage" href="../rings/">Rings »</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 0.27.25 on <span class="colophon-date" title="Friday 7 June 2024 09:11">Friday 7 June 2024</span>. Using Julia version 1.6.7.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 417a043

Please sign in to comment.