Skip to content

Commit

Permalink
build based on bc91deb
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed May 24, 2024
1 parent 6910ac9 commit 1e81ac8
Show file tree
Hide file tree
Showing 16 changed files with 849 additions and 849 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.3","generation_timestamp":"2024-05-24T09:00:30","documenter_version":"1.4.1"}}
{"documenter":{"julia_version":"1.10.3","generation_timestamp":"2024-05-24T09:21:01","documenter_version":"1.4.1"}}
14 changes: 7 additions & 7 deletions dev/api/index.html

Large diffs are not rendered by default.

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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
72 changes: 36 additions & 36 deletions dev/examples/basis_analysis/index.html

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 14 additions & 14 deletions dev/examples/multi_ad/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@
qrcomp = QRCompress(; tol=1e-9)
rbres = assemble(H, grid_train, greedy, lobpcg, qrcomp);</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">n max. err ‖BᵀB-I‖ time μ
------------------------------------------------------------
1 NaN 5.68e-15 217ms [-1.0, 0.0]
2 2.33 5.7e-15 233ms [2.231, 0.538]
3 0.946 5.8e-15 85.1ms [0.795, 0.897]
4 0.508 5.91e-15 72.7ms [1.154, 1.795]
5 0.472 6.21e-15 81.1ms [2.5, 1.077]
6 0.385 6.51e-15 81.2ms [0.346, 0.179]
7 0.0727 1.23e-14 78.8ms [-0.551, 0.0]
8 0.0554 1.93e-14 86.5ms [-0.462, 0.269]
9 0.0163 9.5e-14 99.3ms [1.423, 0.538]
10 0.00522 1.61e-13 110ms [-0.372, 0.449]
11 0.004 3.05e-13 123ms [1.692, 1.346]
12 0.00151 4.61e-13 138ms [-0.821, 0.0]
13 0.00039 1.08e-12 155ms [-0.821, 0.09]
1 NaN 5.68e-15 197ms [-1.0, 0.0]
2 2.33 5.7e-15 224ms [2.231, 0.538]
3 0.946 5.8e-15 75.3ms [0.795, 0.897]
4 0.508 5.91e-15 87.4ms [1.154, 1.795]
5 0.472 6.21e-15 64.6ms [2.5, 1.077]
6 0.385 6.51e-15 92.1ms [0.346, 0.179]
7 0.0727 1.23e-14 79.5ms [-0.551, 0.0]
8 0.0554 1.93e-14 83.7ms [-0.462, 0.269]
9 0.0163 9.5e-14 95.4ms [1.423, 0.538]
10 0.00522 1.61e-13 102ms [-0.372, 0.449]
11 0.004 3.05e-13 120ms [1.692, 1.346]
12 0.00151 4.61e-13 133ms [-0.821, 0.0]
13 0.00039 1.08e-12 147ms [-0.821, 0.09]
reached residual target</code></pre><p>Now the task is to implement the double-sum in <span>$\mathcal{S}$</span>, as well as the <span>$k$</span>-dependency in the coefficients. The double-sum can be encoded by putting all <span>$S^z_r S^z_{r&#39;}$</span> combinations into an <span>$L \times L$</span> matrix:</p><pre><code class="language-julia hljs">terms = map(idx -&gt; to_global(σz, L, idx[1]) * to_global(σz, L, idx[2]),
Iterators.product(1:L, 1:L));</code></pre><p>Correspondingly, the coefficient function now has to map one <span>$k$</span> value to a matrix of coefficients of the same size as the <code>terms</code> matrix:</p><pre><code class="language-julia hljs">coefficients = k -&gt; map(idx -&gt; cis(-(idx[1] - idx[2]) * k) / L,
Iterators.product(1:L, 1:L));</code></pre><p>One feature of the structure factor that also shows up in many other affine decompositions with double-sums is that the term indices commute, i.e. <span>$O_{r,r&#39;} = O_{r&#39;,r}$</span>. In that case, only the upper triangular matrix has to be computed since <span>$B^\dagger O_{r,r&#39;} B = B^\dagger O_{r&#39;,r} B$</span> are the same in the compressed affine decomposition. So let&#39;s create the <a href="../../api/#ReducedBasis.AffineDecomposition"><code>AffineDecomposition</code></a> and compress, exploiting this symmetry using the <code>symmetric_terms</code> keyword argument:</p><pre><code class="language-julia hljs">SFspin = AffineDecomposition(terms, coefficients)
Expand All @@ -75,4 +75,4 @@
push!(hms, heatmap(grid_online.ranges[1], grid_online.ranges[2], sf[i]&#39;;
title=&quot;\$k = $(round(q/π; digits=3))\\pi\$&quot;, kwargs...))
end
plot(hms...)</code></pre><img src="eef9cae0.svg" alt="Example block output"/><p>It can be nicely seen that the spin structure factor indicates the ferromagnetic phase at <span>$k=0$</span> and then moves through the magnetization plateaus until it reaches the antiferromagnetic plateau at <span>$k=\pi$</span>.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../xxz_pod/">« Basis assembly using Proper Orthogonal Decomposition</a><a class="docs-footer-nextpage" href="../basis_analysis/">Analyzing and modifying a reduced basis after assembly »</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.4.1 on <span class="colophon-date" title="Friday 24 May 2024 09:00">Friday 24 May 2024</span>. Using Julia version 1.10.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
plot(hms...)</code></pre><img src="ab5ec462.svg" alt="Example block output"/><p>It can be nicely seen that the spin structure factor indicates the ferromagnetic phase at <span>$k=0$</span> and then moves through the magnetization plateaus until it reaches the antiferromagnetic plateau at <span>$k=\pi$</span>.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../xxz_pod/">« Basis assembly using Proper Orthogonal Decomposition</a><a class="docs-footer-nextpage" href="../basis_analysis/">Analyzing and modifying a reduced basis after assembly »</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.4.1 on <span class="colophon-date" title="Friday 24 May 2024 09:21">Friday 24 May 2024</span>. Using Julia version 1.10.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
246 changes: 123 additions & 123 deletions dev/examples/xxz_dmrg/3dc08666.svg → dev/examples/xxz_dmrg/71af1085.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 25 additions & 25 deletions dev/examples/xxz_dmrg/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,30 +27,30 @@

rbres = assemble(H, grid_train, greedy, dm, edcomp);</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">n max. err ‖BᵀB-I‖ time μ
------------------------------------------------------------
1 NaN 8.88e-16 465ms [-1.0, 0.0]
2 6.3 2.29e-16 642ms [2.5, 3.5]
3 3.36 3.91e-16 370ms [2.5, 0.538]
4 1.52 1.74e-14 598ms [-0.282, 0.09]
5 1.87 1.91e-13 240ms [2.5, 2.513]
6 0.934 7.49e-15 222ms [0.795, 0.0]
7 0.726 6.06e-15 224ms [0.077, 0.718]
8 0.868 5.91e-15 203ms [2.5, 3.141]
9 0.723 6.31e-15 228ms [0.795, 0.538]
10 0.814 1.43e-14 250ms [2.5, 0.897]
11 0.708 1.12e-14 208ms [2.051, 2.423]
12 0.538 5.14e-14 235ms [0.705, 0.897]
13 0.443 3.19e-14 337ms [-0.103, 0.0]
14 0.274 3.78e-14 324ms [-0.372, 0.269]
15 0.233 1.16e-13 815ms [-0.91, 0.0]
16 0.229 8.77e-14 303ms [-0.462, 0.449]
17 0.113 1.1e-13 354ms [-0.641, 0.09]
18 0.103 1.44e-13 1.02s [-0.821, 0.09]
19 0.079 9.01e-13 439ms [1.782, 0.359]
20 0.0748 8.76e-13 427ms [-0.731, 0.09]
21 0.041 1.05e-11 452ms [1.692, 1.256]
22 0.0393 2.46e-12 501ms [-0.641, 0.0]
23 0.0269 3.72e-12 475ms [0.526, 1.436]
24 0.0933 7.78e-12 479ms [2.5, 3.41]</code></pre><p>The returned <code>basis</code> now has snapshot vectors of <code>ITensors.MPS</code> type, which we have to keep in mind when we want to compress observables. That is to say, the observables have to be constructed as <a href="../../api/#ReducedBasis.AffineDecomposition"><code>AffineDecomposition</code></a>s with <a href="../../api/#ReducedBasis.ApproxMPO"><code>ApproxMPO</code></a> terms as we did for the Hamiltonian. Again, we want to compute the magnetization so that we can reuse the third term of <code>H</code>:</p><pre><code class="language-julia hljs">M = AffineDecomposition([H.terms[3]], [2 / L])
1 NaN 8.88e-16 430ms [-1.0, 0.0]
2 6.3 2.29e-16 613ms [2.5, 3.5]
3 3.36 3.91e-16 362ms [2.5, 0.538]
4 1.52 1.74e-14 567ms [-0.282, 0.09]
5 1.87 1.91e-13 228ms [2.5, 2.513]
6 0.934 7.49e-15 216ms [0.795, 0.0]
7 0.726 6.06e-15 218ms [0.077, 0.718]
8 0.868 5.91e-15 212ms [2.5, 3.141]
9 0.723 6.31e-15 223ms [0.795, 0.538]
10 0.814 1.43e-14 242ms [2.5, 0.897]
11 0.708 1.12e-14 214ms [2.051, 2.423]
12 0.538 5.14e-14 247ms [0.705, 0.897]
13 0.443 3.19e-14 313ms [-0.103, 0.0]
14 0.274 3.78e-14 306ms [-0.372, 0.269]
15 0.233 1.16e-13 782ms [-0.91, 0.0]
16 0.229 8.77e-14 300ms [-0.462, 0.449]
17 0.113 1.1e-13 336ms [-0.641, 0.09]
18 0.103 1.44e-13 992ms [-0.821, 0.09]
19 0.079 9.01e-13 418ms [1.782, 0.359]
20 0.0748 8.76e-13 419ms [-0.731, 0.09]
21 0.041 1.05e-11 440ms [1.692, 1.256]
22 0.0393 2.46e-12 483ms [-0.641, 0.0]
23 0.0269 3.72e-12 472ms [0.526, 1.436]
24 0.0933 7.78e-12 478ms [2.5, 3.41]</code></pre><p>The returned <code>basis</code> now has snapshot vectors of <code>ITensors.MPS</code> type, which we have to keep in mind when we want to compress observables. That is to say, the observables have to be constructed as <a href="../../api/#ReducedBasis.AffineDecomposition"><code>AffineDecomposition</code></a>s with <a href="../../api/#ReducedBasis.ApproxMPO"><code>ApproxMPO</code></a> terms as we did for the Hamiltonian. Again, we want to compute the magnetization so that we can reuse the third term of <code>H</code>:</p><pre><code class="language-julia hljs">M = AffineDecomposition([H.terms[3]], [2 / L])
m, _ = compress(M, rbres.basis);</code></pre><p>And at that point, we continue as before since we have arrived at the online phase where we only operate in the low-dimensional RB space, agnostic of the snapshot solver method. We have to make sure, however, to choose matching degeneracy settings for the <a href="../../api/#ReducedBasis.FullDiagonalization"><code>FullDiagonalization</code></a> solver in the online phase:</p><pre><code class="language-julia hljs">fulldiag = FullDiagonalization(dm);</code></pre><p>Then we can define an online grid and compute the magnetization at all grid points, again constructing <code>m</code> at an arbitrary parameter point since its coefficient is parameter-independent:</p><pre><code class="language-julia hljs">m_reduced = m()
Δ_online = range(first(Δ), last(Δ); length=100)
hJ_online = range(first(hJ), last(hJ); length=100)
Expand All @@ -66,4 +66,4 @@
colorbar=true, clims=(0.0, 1.0), leg=false)
params = unique(rbres.basis.parameters)
scatter!(hm, [μ[1] for μ in params], [μ[2] for μ in params];
markershape=:xcross, color=:springgreen, ms=3.0, msw=2.0)</code></pre><img src="3dc08666.svg" alt="Example block output"/><p>We reproduce the ground-state phase diagram, but this time with more magnetization plateaus (due to increased system size) and we see that the greedy algorithm chose different parameter points to solve using DMRG.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../xxz_ed/">« The reduced basis workflow</a><a class="docs-footer-nextpage" href="../xxz_pod/">Basis assembly using Proper Orthogonal Decomposition »</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.4.1 on <span class="colophon-date" title="Friday 24 May 2024 09:00">Friday 24 May 2024</span>. Using Julia version 1.10.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
markershape=:xcross, color=:springgreen, ms=3.0, msw=2.0)</code></pre><img src="71af1085.svg" alt="Example block output"/><p>We reproduce the ground-state phase diagram, but this time with more magnetization plateaus (due to increased system size) and we see that the greedy algorithm chose different parameter points to solve using DMRG.</p></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../xxz_ed/">« The reduced basis workflow</a><a class="docs-footer-nextpage" href="../xxz_pod/">Basis assembly using Proper Orthogonal Decomposition »</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></select></div></p><hr/><p>This document was generated with <a href="https://github.com/JuliaDocs/Documenter.jl">Documenter.jl</a> version 1.4.1 on <span class="colophon-date" title="Friday 24 May 2024 09:21">Friday 24 May 2024</span>. Using Julia version 1.10.3.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Loading

0 comments on commit 1e81ac8

Please sign in to comment.