Skip to content

Commit 08f4e3f

Browse files
author
Documenter.jl
committed
build based on 547cdd3
1 parent f14d343 commit 08f4e3f

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

dev/.documenter-siteinfo.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"documenter":{"julia_version":"1.12.5","generation_timestamp":"2026-02-13T15:28:08","documenter_version":"1.16.1"}}
1+
{"documenter":{"julia_version":"1.12.5","generation_timestamp":"2026-02-13T16:49:50","documenter_version":"1.16.1"}}

dev/blocktensors/index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@
1616
:
1717
codomain: ⊗((ℂ^1 ⊞ ℂ^2))
1818
domain: ((ℂ^1 ⊞ ℂ^2) ⊗ (ℂ^1 ⊞ ℂ^2))
19-
⠉⠈
19+
⠈⠉
2020
⎣⡀⠀⎦</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-
1.2378204004734492
26-
1.5691226218300929</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+
0.23931519614267183
26+
1.7635701610080616</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:
3030
* Trivial() =&gt; 1×1 reshape(view(::Vector{Float64}, 1:1), 1, 1) with eltype Float64:
31-
2.995783424418114</code></pre><p>Slicing operations are also supported, and the <code>AbstractBlockTensorMap</code> can be sliced in the same way as an <code>AbstractArray{AbstractTensorMap}</code>. There is however one elementary difference: as the slices still contain tensors with the same amount of legs, there can be no reduction in the number of dimensions. In particular, in contrast to <code>AbstractArray</code>, scalar dimensions are not discarded, and as a result, linear index slicing is not allowed.</p><pre><code class="language-julia-repl hljs" style="display:block;">julia&gt; ndims(t[1, 1, :]) == 3</code><code class="nohighlight hljs ansi" style="display:block;">true</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; ndims(t[:, 1:2, [1, 1]]) == 3</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:2] # error</code><code class="nohighlight hljs ansi" style="display:block;">ERROR: ArgumentError: Cannot index TensorKit.TensorMapSpace{TensorKit.ComplexSpace, 1, 2}[ℂ^1 ← (ℂ^1 ⊗ ℂ^1) ℂ^1 ← (ℂ^2 ⊗ ℂ^1); ℂ^2 ← (ℂ^1 ⊗ ℂ^1) ℂ^2 ← (ℂ^2 ⊗ ℂ^1);;; ℂ^1 ← (ℂ^1 ⊗ ℂ^2) ℂ^1 ← (ℂ^2 ⊗ ℂ^2); ℂ^2 ← (ℂ^1 ⊗ ℂ^2) ℂ^2 ← (ℂ^2 ⊗ ℂ^2)] with 1:2</code></pre><h3 id="VectorInterface.jl"><a class="docs-heading-anchor" href="#VectorInterface.jl">VectorInterface.jl</a><a id="VectorInterface.jl-1"></a><a class="docs-heading-anchor-permalink" href="#VectorInterface.jl" title="Permalink"></a></h3><p>As part of the <code>TensorKit</code> interface, <code>AbstractBlockTensorMap</code> also implements <code>VectorInterface</code>. This means that you can efficiently add, scale, and compute the inner product of <code>AbstractBlockTensorMap</code> objects.</p><pre><code class="language-julia-repl hljs" style="display:block;">julia&gt; t1, t2 = rand!(similar(t)), rand!(similar(t));</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; add(t1, t2, rand())</code><code class="nohighlight hljs ansi" style="display:block;">2×2×2-blocked 3←3×3 BlockTensorMap{TensorMap{Float64, TensorKit.ComplexSpace, 1, 2, Vector{Float64}}, …}:
31+
0.0</code></pre><p>Slicing operations are also supported, and the <code>AbstractBlockTensorMap</code> can be sliced in the same way as an <code>AbstractArray{AbstractTensorMap}</code>. There is however one elementary difference: as the slices still contain tensors with the same amount of legs, there can be no reduction in the number of dimensions. In particular, in contrast to <code>AbstractArray</code>, scalar dimensions are not discarded, and as a result, linear index slicing is not allowed.</p><pre><code class="language-julia-repl hljs" style="display:block;">julia&gt; ndims(t[1, 1, :]) == 3</code><code class="nohighlight hljs ansi" style="display:block;">true</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; ndims(t[:, 1:2, [1, 1]]) == 3</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:2] # error</code><code class="nohighlight hljs ansi" style="display:block;">ERROR: ArgumentError: Cannot index TensorKit.TensorMapSpace{TensorKit.ComplexSpace, 1, 2}[ℂ^1 ← (ℂ^1 ⊗ ℂ^1) ℂ^1 ← (ℂ^2 ⊗ ℂ^1); ℂ^2 ← (ℂ^1 ⊗ ℂ^1) ℂ^2 ← (ℂ^2 ⊗ ℂ^1);;; ℂ^1 ← (ℂ^1 ⊗ ℂ^2) ℂ^1 ← (ℂ^2 ⊗ ℂ^2); ℂ^2 ← (ℂ^1 ⊗ ℂ^2) ℂ^2 ← (ℂ^2 ⊗ ℂ^2)] with 1:2</code></pre><h3 id="VectorInterface.jl"><a class="docs-heading-anchor" href="#VectorInterface.jl">VectorInterface.jl</a><a id="VectorInterface.jl-1"></a><a class="docs-heading-anchor-permalink" href="#VectorInterface.jl" title="Permalink"></a></h3><p>As part of the <code>TensorKit</code> interface, <code>AbstractBlockTensorMap</code> also implements <code>VectorInterface</code>. This means that you can efficiently add, scale, and compute the inner product of <code>AbstractBlockTensorMap</code> objects.</p><pre><code class="language-julia-repl hljs" style="display:block;">julia&gt; t1, t2 = rand!(similar(t)), rand!(similar(t));</code><br/><code class="language-julia-repl hljs" style="display:block;">julia&gt; add(t1, t2, rand())</code><code class="nohighlight hljs ansi" style="display:block;">2×2×2-blocked 3←3×3 BlockTensorMap{TensorMap{Float64, TensorKit.ComplexSpace, 1, 2, Vector{Float64}}, …}:
3232
codomain: ⊗((ℂ^1 ⊞ ℂ^2))
3333
domain: ((ℂ^1 ⊞ ℂ^2) ⊗ (ℂ^1 ⊞ ℂ^2))
3434
[1,1,1] = 1←1×1 TensorMap{Float64, TensorKit.ComplexSpace, 1, 2, Vector{Float64}}(…, ℂ^1 ← (ℂ^1 ⊗ ℂ^1))
@@ -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;">4.703885621636705</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;">7.38096887511348</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.16.1 on <span class="colophon-date" title="Friday 13 February 2026 15:28">Friday 13 February 2026</span>. Using Julia version 1.12.5.</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.16.1 on <span class="colophon-date" title="Friday 13 February 2026 16:49">Friday 13 February 2026</span>. Using Julia version 1.12.5.</p></section><footer class="modal-card-foot"></footer></div></div></div></body></html>

0 commit comments

Comments
 (0)