Skip to content

Commit

Permalink
build based on 1570cad
Browse files Browse the repository at this point in the history
  • Loading branch information
Documenter.jl committed Jul 3, 2024
1 parent 155fa9f commit 005f19e
Show file tree
Hide file tree
Showing 7 changed files with 86 additions and 86 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-03T09:40:19","documenter_version":"1.5.0"}}
{"documenter":{"julia_version":"1.10.4","generation_timestamp":"2024-07-03T09:46:51","documenter_version":"1.5.0"}}
44 changes: 22 additions & 22 deletions dev/documentation/index.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dev/implementation/index.html

Large diffs are not rendered by default.

56 changes: 28 additions & 28 deletions dev/index-696cd993.svg → dev/index-471c0d26.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
60 changes: 30 additions & 30 deletions dev/index-e01ef4ce.svg → dev/index-c7145693.svg
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/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
return 1e3 * cos(10 * sum(x .^ 2)) * exp(-sum(x)^4 / 1e3)
end
I = TCI.integrate(Float64, f, fill(-1.0, 10), fill(+1.0, 10); GKorder=15, tolerance=1e-8)
println(&quot;GK15 integral value: $I&quot;)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">GK15 integral value: -5.496232627515932</code></pre><p>The argument <code>GKorder</code> controls the Gauss-Kronrod quadrature rule used for the integration, and <code>tolerance</code> controls the tolerance in the TCI approximation, which is distinct from the tolerance in the integral. For complicated functions, it is recommended to integrate using two different GK rules and to compare the results to get a good estimate of the discretization error.</p><h2 id="Properties-of-the-TCI-object"><a class="docs-heading-anchor" href="#Properties-of-the-TCI-object">Properties of the TCI object</a><a id="Properties-of-the-TCI-object-1"></a><a class="docs-heading-anchor-permalink" href="#Properties-of-the-TCI-object" title="Permalink"></a></h2><p>After running the code above, <code>tci</code> is a <a href="documentation/#TensorCrossInterpolation.TensorCI2"><code>TensorCI2</code></a> object that can be interrogated for various properties. The most important ones are the rank (i.e. maximum bond dimension) and the link dimensions:</p><pre><code class="language-julia hljs">println(&quot;Maximum bond dimension / rank of tci: $(TCI.rank(tci))&quot;)
println(&quot;GK15 integral value: $I&quot;)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">GK15 integral value: -5.49623262586557</code></pre><p>The argument <code>GKorder</code> controls the Gauss-Kronrod quadrature rule used for the integration, and <code>tolerance</code> controls the tolerance in the TCI approximation, which is distinct from the tolerance in the integral. For complicated functions, it is recommended to integrate using two different GK rules and to compare the results to get a good estimate of the discretization error.</p><h2 id="Properties-of-the-TCI-object"><a class="docs-heading-anchor" href="#Properties-of-the-TCI-object">Properties of the TCI object</a><a id="Properties-of-the-TCI-object-1"></a><a class="docs-heading-anchor-permalink" href="#Properties-of-the-TCI-object" title="Permalink"></a></h2><p>After running the code above, <code>tci</code> is a <a href="documentation/#TensorCrossInterpolation.TensorCI2"><code>TensorCI2</code></a> object that can be interrogated for various properties. The most important ones are the rank (i.e. maximum bond dimension) and the link dimensions:</p><pre><code class="language-julia hljs">println(&quot;Maximum bond dimension / rank of tci: $(TCI.rank(tci))&quot;)
println(&quot;Bond dimensions along the links of tci: $(TCI.linkdims(tci))&quot;)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">Maximum bond dimension / rank of tci: 11
Bond dimensions along the links of tci: [10, 11, 11, 10]</code></pre><p>The latter can be plotted conveniently:</p><pre><code class="language-julia hljs">using Plots, LaTeXStrings
bondindices = 1:length(tci)-1
Expand All @@ -29,13 +29,13 @@
label=&quot;full rank&quot;)
plot!(bondindices, TCI.linkdims(tci), label=&quot;TCI compression&quot;)
xlabel!(L&quot;\ell&quot;)
ylabel!(L&quot;D_\ell&quot;)</code></pre><img src="index-696cd993.svg" alt="Example block output"/><p>Other methods are documented in the <a href="documentation/#Tensor-cross-interpolation-(TCI)">Tensor cross interpolation (TCI)</a> section of the documentation.</p><h2 id="Checking-convergence"><a class="docs-heading-anchor" href="#Checking-convergence">Checking convergence</a><a id="Checking-convergence-1"></a><a class="docs-heading-anchor-permalink" href="#Checking-convergence" title="Permalink"></a></h2><p>The vectors <code>ranks</code> and <code>errors</code> contain the pivot errors reached for different maximum bond dimensions. They are intended for convergence checks. The last element of <code>errors</code> can be used to check whether the tolerance was met within the maximum number of iterations:</p><pre><code class="language-julia hljs">println(&quot;Error in last iteration was: $(last(errors))&quot;)
ylabel!(L&quot;D_\ell&quot;)</code></pre><img src="index-471c0d26.svg" alt="Example block output"/><p>Other methods are documented in the <a href="documentation/#Tensor-cross-interpolation-(TCI)">Tensor cross interpolation (TCI)</a> section of the documentation.</p><h2 id="Checking-convergence"><a class="docs-heading-anchor" href="#Checking-convergence">Checking convergence</a><a id="Checking-convergence-1"></a><a class="docs-heading-anchor-permalink" href="#Checking-convergence" title="Permalink"></a></h2><p>The vectors <code>ranks</code> and <code>errors</code> contain the pivot errors reached for different maximum bond dimensions. They are intended for convergence checks. The last element of <code>errors</code> can be used to check whether the tolerance was met within the maximum number of iterations:</p><pre><code class="language-julia hljs">println(&quot;Error in last iteration was: $(last(errors))&quot;)
println(&quot;Is this below tolerance? $(last(errors) &lt; tolerance)&quot;)</code></pre><pre class="documenter-example-output"><code class="nohighlight hljs ansi">Error in last iteration was: 1.9111313748018586e-9
Is this below tolerance? true</code></pre><p>Plotting <code>errors</code> against <code>ranks</code> shows convergence behavior. In most cases, convergence will become exponential after some initial iterations. Furthermore, <code>tci.pivoterrors[D]</code> contains the error that a truncation to bond dimension <code>D</code> would incur. Plotting both, we see tha</p><pre><code class="language-julia hljs">plot(ranks, errors, yscale=:log10, seriestype=:scatter)
plot!(tci.pivoterrors / tci.maxsamplevalue, yscale=:log10)
ylims!(1e-10, 2)
xlabel!(L&quot;D_\max&quot;)
ylabel!(L&quot;\varepsilon&quot;)</code></pre><img src="index-e01ef4ce.svg" alt="Example block output"/><p>Note that the errors are normalized with <code>tci.maxsamplevalue</code>, i.e. the maximum function value that was encountered during construction of the tci. This behaviour can be disabled by passing <code>normalizeerror=false</code> to <a href="documentation/#TensorCrossInterpolation.crossinterpolate2-Union{Tuple{N}, Tuple{ValueType}, Tuple{Type{ValueType}, Any, Union{Tuple{Vararg{Int64, N}}, Vector{Int64}}}, Tuple{Type{ValueType}, Any, Union{Tuple{Vararg{Int64, N}}, Vector{Int64}}, Vector{Vector{Int64}}}} where {ValueType, N}"><code>crossinterpolate2</code></a>.</p><h2 id="Optimizing-the-first-pivot"><a class="docs-heading-anchor" href="#Optimizing-the-first-pivot">Optimizing the first pivot</a><a id="Optimizing-the-first-pivot-1"></a><a class="docs-heading-anchor-permalink" href="#Optimizing-the-first-pivot" title="Permalink"></a></h2><p>Sometimes, the performance of TCI is suboptimal due to an unfortunate choice of first pivot. In most cases, it is sufficient to choose a first pivot close to structure, e.g. on a maximum of the function. Simply pass the first pivot as a parameter to <a href="documentation/#TensorCrossInterpolation.crossinterpolate2-Union{Tuple{N}, Tuple{ValueType}, Tuple{Type{ValueType}, Any, Union{Tuple{Vararg{Int64, N}}, Vector{Int64}}}, Tuple{Type{ValueType}, Any, Union{Tuple{Vararg{Int64, N}}, Vector{Int64}}, Vector{Vector{Int64}}}} where {ValueType, N}"><code>crossinterpolate2</code></a>:</p><pre><code class="language-julia hljs">firstpivot = [1, 2, 3, 4, 5]
ylabel!(L&quot;\varepsilon&quot;)</code></pre><img src="index-c7145693.svg" alt="Example block output"/><p>Note that the errors are normalized with <code>tci.maxsamplevalue</code>, i.e. the maximum function value that was encountered during construction of the tci. This behaviour can be disabled by passing <code>normalizeerror=false</code> to <a href="documentation/#TensorCrossInterpolation.crossinterpolate2-Union{Tuple{N}, Tuple{ValueType}, Tuple{Type{ValueType}, Any, Union{Tuple{Vararg{Int64, N}}, Vector{Int64}}}, Tuple{Type{ValueType}, Any, Union{Tuple{Vararg{Int64, N}}, Vector{Int64}}, Vector{Vector{Int64}}}} where {ValueType, N}"><code>crossinterpolate2</code></a>.</p><h2 id="Optimizing-the-first-pivot"><a class="docs-heading-anchor" href="#Optimizing-the-first-pivot">Optimizing the first pivot</a><a id="Optimizing-the-first-pivot-1"></a><a class="docs-heading-anchor-permalink" href="#Optimizing-the-first-pivot" title="Permalink"></a></h2><p>Sometimes, the performance of TCI is suboptimal due to an unfortunate choice of first pivot. In most cases, it is sufficient to choose a first pivot close to structure, e.g. on a maximum of the function. Simply pass the first pivot as a parameter to <a href="documentation/#TensorCrossInterpolation.crossinterpolate2-Union{Tuple{N}, Tuple{ValueType}, Tuple{Type{ValueType}, Any, Union{Tuple{Vararg{Int64, N}}, Vector{Int64}}}, Tuple{Type{ValueType}, Any, Union{Tuple{Vararg{Int64, N}}, Vector{Int64}}, Vector{Vector{Int64}}}} where {ValueType, N}"><code>crossinterpolate2</code></a>:</p><pre><code class="language-julia hljs">firstpivot = [1, 2, 3, 4, 5]
tci, ranks, errors = TCI.crossinterpolate2(
Float64, f, localdims, [firstpivot]; tolerance=tolerance
)</code></pre><p>If this is not known (or you still have difficulties with bad convergence), the method <a href="documentation/#TensorCrossInterpolation.optfirstpivot-Union{Tuple{N}, Tuple{Any, Union{Tuple{Vararg{Int64, N}}, Vector{Int64}}}, Tuple{Any, Union{Tuple{Vararg{Int64, N}}, Vector{Int64}}, Vector{Int64}}} where N"><code>optfirstpivot</code></a> provides a simple algorithm to find a good first pivot.</p><pre><code class="language-julia hljs">firstpivot = optfirstpivot(f, localdims, [1, 2, 3, 4, 5])
Expand Down Expand Up @@ -203,4 +203,4 @@

for i in 1:4
@time parf(leftindexset, rightindexset, Val(2))
end</code></pre><p>You can simply pass the wrapped function <code>parf</code> to <code>crossinterpolate2</code>.</p></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="documentation/">Documentation »</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="Wednesday 3 July 2024 09:40">Wednesday 3 July 2024</span>. Using Julia version 1.10.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
end</code></pre><p>You can simply pass the wrapped function <code>parf</code> to <code>crossinterpolate2</code>.</p></article><nav class="docs-footer"><a class="docs-footer-nextpage" href="documentation/">Documentation »</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="Wednesday 3 July 2024 09:46">Wednesday 3 July 2024</span>. Using Julia version 1.10.4.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
Binary file modified dev/objects.inv
Binary file not shown.

0 comments on commit 005f19e

Please sign in to comment.