Skip to content

Commit 5576561

Browse files
author
Documenter.jl
committed
build based on 3eaf316
1 parent 80b72e9 commit 5576561

5 files changed

Lines changed: 11 additions & 11 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"documenter":{"documenter_version":"1.17.0","generation_timestamp":"2026-06-08T05:16:36","julia_version":"1.12.6"}}
1+
{"documenter":{"documenter_version":"1.17.0","generation_timestamp":"2026-06-08T15:24:07","julia_version":"1.12.6"}}

previews/PR61/blocktensors/index.html

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@
1212
[1,1,2] = 1←1×2 TensorMap{Float64, TensorKit.ComplexSpace, 1, 2, Vector{Float64}}(…, ℂ^1 ← (ℂ^1 ⊗ ℂ^2))
1313
[2,1,2] = 2←1×2 TensorMap{Float64, TensorKit.ComplexSpace, 1, 2, Vector{Float64}}(…, ℂ^2 ← (ℂ^1 ⊗ ℂ^2))
1414
[1,2,2] = 1←2×2 TensorMap{Float64, TensorKit.ComplexSpace, 1, 2, Vector{Float64}}(…, ℂ^1 ← (ℂ^2 ⊗ ℂ^2))
15-
[2,2,2] = 2←2×2 TensorMap{Float64, TensorKit.ComplexSpace, 1, 2, Vector{Float64}}(…, ℂ^2 ← (ℂ^2 ⊗ ℂ^2))</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; eltype(t)</code><code class="nohighlight hljs ansi" style="display:block;">TensorKit.TensorMap{Float64, TensorKit.ComplexSpace, 1, 2, Vector{Float64}}</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; s = sprand(W, 0.5)</code><code class="nohighlight hljs ansi" style="display:block;">2×2×2-blocked 3←3×3 SparseBlockTensorMap{TensorMap{Float64, TensorKit.ComplexSpace, 1, 2, Vector{Float64}}, Float64, TensorKit.ComplexSpace, 1, 2, 3} with 2 stored entries:
15+
[2,2,2] = 2←2×2 TensorMap{Float64, TensorKit.ComplexSpace, 1, 2, Vector{Float64}}(…, ℂ^2 ← (ℂ^2 ⊗ ℂ^2))</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; eltype(t)</code><code class="nohighlight hljs ansi" style="display:block;">TensorKit.TensorMap{Float64, TensorKit.ComplexSpace, 1, 2, Vector{Float64}}</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; s = sprand(W, 0.5)</code><code class="nohighlight hljs ansi" style="display:block;">2×2×2-blocked 3←3×3 SparseBlockTensorMap{TensorMap{Float64, TensorKit.ComplexSpace, 1, 2, Vector{Float64}}, Float64, TensorKit.ComplexSpace, 1, 2, 3} with 3 stored entries:
1616
:
1717
codomain: ⊗((ℂ^1 ⊞ ℂ^2))
1818
domain: ((ℂ^1 ⊞ ℂ^2) ⊗ (ℂ^1 ⊞ ℂ^2))
19-
⎡⠀
20-
⎣⠀⣀⎦</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; eltype(s)</code><code class="nohighlight hljs ansi" style="display:block;">TensorKit.TensorMap{Float64, TensorKit.ComplexSpace, 1, 2, Vector{Float64}}</code></pre><div class="admonition is-info" id="Note-2ecbf9be9dc6971e"><header class="admonition-header">Note<a class="admonition-anchor" href="#Note-2ecbf9be9dc6971e" title="Permalink"></a></header><div class="admonition-body"><p>In analogy to <code>TensorKit</code>, most of the functionality that requires a <code>space</code> object can equally well be called in terms of <code>codomain(space), domain(space)</code>, if that is more convenient.</p></div></div><h3 id="Indexing"><a class="docs-heading-anchor" href="#Indexing">Indexing</a><a id="Indexing-1"></a><a class="docs-heading-anchor-permalink" href="#Indexing" title="Permalink"></a></h3><p>For indexing operators, <code>AbstractBlockTensorMap</code> behaves like an <code>AbstractArray{AbstractTensorMap}</code>, and the individual tensors can be accessed via the <code>getindex</code> and <code>setindex!</code> functions. In particular, the <code>getindex</code> function returns a <code>TT</code> object, and the <code>setindex!</code> function expects a <code>TT</code> object. Both linear and cartesian indexing styles are supported.</p><pre><code class="language-julia-repl hljs" style="display:block;">julia&gt; t[1] isa eltype(t)</code><code class="nohighlight hljs ansi" style="display:block;">true</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; t[1] == t[1, 1, 1]</code><code class="nohighlight hljs ansi" style="display:block;">true</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; t[2] = 3 * t[2]</code><code class="nohighlight hljs ansi" style="display:block;">2←1×1 TensorMap{Float64, TensorKit.ComplexSpace, 1, 2, Vector{Float64}}:
19+
⎡⠀
20+
⎣⡀⠀⎦</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; eltype(s)</code><code class="nohighlight hljs ansi" style="display:block;">TensorKit.TensorMap{Float64, TensorKit.ComplexSpace, 1, 2, Vector{Float64}}</code></pre><div class="admonition is-info" id="Note-2ecbf9be9dc6971e"><header class="admonition-header">Note<a class="admonition-anchor" href="#Note-2ecbf9be9dc6971e" title="Permalink"></a></header><div class="admonition-body"><p>In analogy to <code>TensorKit</code>, most of the functionality that requires a <code>space</code> object can equally well be called in terms of <code>codomain(space), domain(space)</code>, if that is more convenient.</p></div></div><h3 id="Indexing"><a class="docs-heading-anchor" href="#Indexing">Indexing</a><a id="Indexing-1"></a><a class="docs-heading-anchor-permalink" href="#Indexing" title="Permalink"></a></h3><p>For indexing operators, <code>AbstractBlockTensorMap</code> behaves like an <code>AbstractArray{AbstractTensorMap}</code>, and the individual tensors can be accessed via the <code>getindex</code> and <code>setindex!</code> functions. In particular, the <code>getindex</code> function returns a <code>TT</code> object, and the <code>setindex!</code> function expects a <code>TT</code> object. Both linear and cartesian indexing styles are supported.</p><pre><code class="language-julia-repl hljs" style="display:block;">julia&gt; t[1] isa eltype(t)</code><code class="nohighlight hljs ansi" style="display:block;">true</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; t[1] == t[1, 1, 1]</code><code class="nohighlight hljs ansi" style="display:block;">true</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; t[2] = 3 * t[2]</code><code class="nohighlight hljs ansi" style="display:block;">2←1×1 TensorMap{Float64, TensorKit.ComplexSpace, 1, 2, Vector{Float64}}:
2121
codomain: ⊗(ℂ^2)
2222
domain: (ℂ^1 ⊗ ℂ^1)
2323
blocks:
2424
* Trivial() =&gt; 2×1 reshape(view(::Vector{Float64}, 1:2), 2, 1) with eltype Float64:
25-
0.25170377893268536
26-
2.479111895889382</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; s[1] isa eltype(t)</code><code class="nohighlight hljs ansi" style="display:block;">true</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; s[1] == s[1, 1, 1]</code><code class="nohighlight hljs ansi" style="display:block;">true</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; s[1] += 2 * s[1]</code><code class="nohighlight hljs ansi" style="display:block;">1←1×1 TensorMap{Float64, TensorKit.ComplexSpace, 1, 2, Vector{Float64}}:
25+
1.9687026798381173
26+
2.7313364051463296</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; s[1] isa eltype(t)</code><code class="nohighlight hljs ansi" style="display:block;">true</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; s[1] == s[1, 1, 1]</code><code class="nohighlight hljs ansi" style="display:block;">true</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; s[1] += 2 * s[1]</code><code class="nohighlight hljs ansi" style="display:block;">1←1×1 TensorMap{Float64, TensorKit.ComplexSpace, 1, 2, Vector{Float64}}:
2727
codomain: ⊗(ℂ^1)
2828
domain: (ℂ^1 ⊗ ℂ^1)
2929
blocks:
@@ -48,7 +48,7 @@
4848
[1,1,2] = 1←1×2 TensorMap{Float64, TensorKit.ComplexSpace, 1, 2, Vector{Float64}}(…, ℂ^1 ← (ℂ^1 ⊗ ℂ^2))
4949
[2,1,2] = 2←1×2 TensorMap{Float64, TensorKit.ComplexSpace, 1, 2, Vector{Float64}}(…, ℂ^2 ← (ℂ^1 ⊗ ℂ^2))
5050
[1,2,2] = 1←2×2 TensorMap{Float64, TensorKit.ComplexSpace, 1, 2, Vector{Float64}}(…, ℂ^1 ← (ℂ^2 ⊗ ℂ^2))
51-
[2,2,2] = 2←2×2 TensorMap{Float64, TensorKit.ComplexSpace, 1, 2, Vector{Float64}}(…, ℂ^2 ← (ℂ^2 ⊗ ℂ^2))</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; inner(t1, t2)</code><code class="nohighlight hljs ansi" style="display:block;">6.117874282757839</code></pre><p>For further in-place and possibly-in-place methods, see <a href="https://github.com/Jutho/VectorInterface.jl"><code>VectorInterface.jl</code></a></p><h3 id="TensorOperations.jl"><a class="docs-heading-anchor" href="#TensorOperations.jl">TensorOperations.jl</a><a id="TensorOperations.jl-1"></a><a class="docs-heading-anchor-permalink" href="#TensorOperations.jl" title="Permalink"></a></h3><p>The <code>TensorOperations.jl</code> interface is also implemented for <code>AbstractBlockTensorMap</code>. In particular, the <code>AbstractBlockTensorMap</code> can be contracted with other <code>AbstractBlockTensorMap</code> objects, as well as with <code>AbstractTensorMap</code> objects. In order for that mix to work, the <code>AbstractTensorMap</code> objects are automatically converted to <code>AbstractBlockTensorMap</code> objects with a single tensor, i.e. the sum spaces will be a sum of one space. As a consequence, as soon as one of the input tensors is blocked, the output tensor will also be blocked, even though its size might be trivial. In these cases, <code>only</code> can be used to retrieve the single element in the <code>BlockTensorMap</code>.</p><pre><code class="language-julia-repl hljs" style="display:block;">julia&gt; @tensor t3[a; b] := t[a; c d] * conj(t[b; c d])</code><code class="nohighlight hljs ansi" style="display:block;">2×2-blocked 3←3 BlockTensorMap{TensorMap{Float64, TensorKit.ComplexSpace, 1, 1, Vector{Float64}}, …}:
51+
[2,2,2] = 2←2×2 TensorMap{Float64, TensorKit.ComplexSpace, 1, 2, Vector{Float64}}(…, ℂ^2 ← (ℂ^2 ⊗ ℂ^2))</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; inner(t1, t2)</code><code class="nohighlight hljs ansi" style="display:block;">8.185901784728937</code></pre><p>For further in-place and possibly-in-place methods, see <a href="https://github.com/Jutho/VectorInterface.jl"><code>VectorInterface.jl</code></a></p><h3 id="TensorOperations.jl"><a class="docs-heading-anchor" href="#TensorOperations.jl">TensorOperations.jl</a><a id="TensorOperations.jl-1"></a><a class="docs-heading-anchor-permalink" href="#TensorOperations.jl" title="Permalink"></a></h3><p>The <code>TensorOperations.jl</code> interface is also implemented for <code>AbstractBlockTensorMap</code>. In particular, the <code>AbstractBlockTensorMap</code> can be contracted with other <code>AbstractBlockTensorMap</code> objects, as well as with <code>AbstractTensorMap</code> objects. In order for that mix to work, the <code>AbstractTensorMap</code> objects are automatically converted to <code>AbstractBlockTensorMap</code> objects with a single tensor, i.e. the sum spaces will be a sum of one space. As a consequence, as soon as one of the input tensors is blocked, the output tensor will also be blocked, even though its size might be trivial. In these cases, <code>only</code> can be used to retrieve the single element in the <code>BlockTensorMap</code>.</p><pre><code class="language-julia-repl hljs" style="display:block;">julia&gt; @tensor t3[a; b] := t[a; c d] * conj(t[b; c d])</code><code class="nohighlight hljs ansi" style="display:block;">2×2-blocked 3←3 BlockTensorMap{TensorMap{Float64, TensorKit.ComplexSpace, 1, 1, Vector{Float64}}, …}:
5252
codomain: ⊗((ℂ^1 ⊞ ℂ^2))
5353
domain: ⊗((ℂ^1 ⊞ ℂ^2))
5454
[1,1] = 1←1 TensorMap{Float64, TensorKit.ComplexSpace, 1, 1, Vector{Float64}}(…, ℂ^1 ← ℂ^1)
@@ -60,4 +60,4 @@
6060
[1,1] = 1←1 TensorMap{Float64, TensorKit.ComplexSpace, 1, 1, Vector{Float64}}(…, ℂ^1 ← ℂ^1)</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; t4 isa AbstractBlockTensorMap</code><code class="nohighlight hljs ansi" style="display:block;">true</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; only(t4) isa eltype(t4)</code><code class="nohighlight hljs ansi" style="display:block;">true</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; @tensor t5[a; b] := t[1][a; c d] * conj(t[1:1, 1:1, 1:1][b; c d]) # tensor * blocktensor = blocktensor</code><code class="nohighlight hljs ansi" style="display:block;">1×1-blocked 1←1 BlockTensorMap{TensorMap{Float64, TensorKit.ComplexSpace, 1, 1, Vector{Float64}}, …}:
6161
codomain: ⊗(⊞(ℂ^1))
6262
domain: ⊗(⊞(ℂ^1))
63-
[1,1] = 1←1 TensorMap{Float64, TensorKit.ComplexSpace, 1, 1, Vector{Float64}}(…, ℂ^1 ← ℂ^1)</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; t5 isa AbstractBlockTensorMap</code><code class="nohighlight hljs ansi" style="display:block;">true</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; only(t5) isa eltype(t5)</code><code class="nohighlight hljs ansi" style="display:block;">true</code></pre><h3 id="Factorizations"><a class="docs-heading-anchor" href="#Factorizations">Factorizations</a><a id="Factorizations-1"></a><a class="docs-heading-anchor-permalink" href="#Factorizations" title="Permalink"></a></h3><p>Currently, there is only rudimentary support for factorizations of <code>AbstractBlockTensorMap</code> objects. In particular, the implementations are not yet optimized for performance, and the factorizations are typically carried out by mapping to a dense tensor, and then performing the factorization on that tensor.</p><div class="admonition is-info" id="Note-d86dd487d5079337"><header class="admonition-header">Note<a class="admonition-anchor" href="#Note-d86dd487d5079337" title="Permalink"></a></header><div class="admonition-body"><p>Most factorizations do not retain the additional imposed block structure. In particular, constructions of orthogonal bases will typically mix up the subspaces, and as such the resulting vector spaces will be <code>SumSpace</code>s of a single term.</p></div></div></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../sumspaces/">« SumSpace</a><a class="docs-footer-nextpage" href="../lib/">Library »</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.17.0 on <span class="colophon-date" title="Monday 8 June 2026 05:16">Monday 8 June 2026</span>. Using Julia version 1.12.6.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>
63+
[1,1] = 1←1 TensorMap{Float64, TensorKit.ComplexSpace, 1, 1, Vector{Float64}}(…, ℂ^1 ← ℂ^1)</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; t5 isa AbstractBlockTensorMap</code><code class="nohighlight hljs ansi" style="display:block;">true</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; only(t5) isa eltype(t5)</code><code class="nohighlight hljs ansi" style="display:block;">true</code></pre><h3 id="Factorizations"><a class="docs-heading-anchor" href="#Factorizations">Factorizations</a><a id="Factorizations-1"></a><a class="docs-heading-anchor-permalink" href="#Factorizations" title="Permalink"></a></h3><p>Currently, there is only rudimentary support for factorizations of <code>AbstractBlockTensorMap</code> objects. In particular, the implementations are not yet optimized for performance, and the factorizations are typically carried out by mapping to a dense tensor, and then performing the factorization on that tensor.</p><div class="admonition is-info" id="Note-d86dd487d5079337"><header class="admonition-header">Note<a class="admonition-anchor" href="#Note-d86dd487d5079337" title="Permalink"></a></header><div class="admonition-body"><p>Most factorizations do not retain the additional imposed block structure. In particular, constructions of orthogonal bases will typically mix up the subspaces, and as such the resulting vector spaces will be <code>SumSpace</code>s of a single term.</p></div></div></article><nav class="docs-footer"><a class="docs-footer-prevpage" href="../sumspaces/">« SumSpace</a><a class="docs-footer-nextpage" href="../lib/">Library »</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.17.0 on <span class="colophon-date" title="Monday 8 June 2026 15:24">Monday 8 June 2026</span>. Using Julia version 1.12.6.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

0 commit comments

Comments
 (0)