Skip to content

Commit ded0eb0

Browse files
committed
Route similar_operator through TensorAlgebra.similar_map
Centralizes the linear-map allocation primitive in TensorAlgebra so backends only need to overload `similar_map`, while `similar_operator` keeps the named-axis wrapping. Also drops the redundant `[sources.TensorAlgebra]` pin from `docs/`, `examples/`, and `test/Project.toml`; the workspace root `Project.toml` already pins the upstream feature branch for all subprojects.
1 parent 8de3a6f commit ded0eb0

4 files changed

Lines changed: 1 addition & 13 deletions

File tree

docs/Project.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
99
[sources.NamedDimsArrays]
1010
path = ".."
1111

12-
[sources.TensorAlgebra]
13-
rev = "mf/gram-eigh-balanced"
14-
url = "https://github.com/ITensor/TensorAlgebra.jl"
15-
1612
[compat]
1713
Documenter = "1"
1814
ITensorFormatter = "0.2.27"

examples/Project.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
66
[sources.NamedDimsArrays]
77
path = ".."
88

9-
[sources.TensorAlgebra]
10-
rev = "mf/gram-eigh-balanced"
11-
url = "https://github.com/ITensor/TensorAlgebra.jl"
12-
139
[compat]
1410
NamedDimsArrays = "0.15"
1511
TensorAlgebra = "0.8, 0.9"

src/nameddimsoperator.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ function similar_operator(
271271
unnamed_codomain_axes = conj.(unnamed_domain_axes)
272272
codomain_axes = named.(unnamed_codomain_axes, codomain_names)
273273
domain_axes = named.(unnamed_domain_axes, domain_names)
274-
raw = similar(prototype, T, (codomain_axes..., domain_axes...))
274+
raw = TA.similar_map(prototype, T, codomain_axes, domain_axes)
275275
return operator(raw, codomain_names, domain_names)
276276
end
277277
function similar_operator(

test/Project.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ VectorInterface = "409d34a3-91d5-4945-b6ec-7529ddf182d8"
2020
[sources.NamedDimsArrays]
2121
path = ".."
2222

23-
[sources.TensorAlgebra]
24-
rev = "mf/gram-eigh-balanced"
25-
url = "https://github.com/ITensor/TensorAlgebra.jl"
26-
2723
[compat]
2824
AbstractTrees = "0.4.5"
2925
Adapt = "4"

0 commit comments

Comments
 (0)