Skip to content

Commit 30f4988

Browse files
committed
more careful with tensoroperations
1 parent 97741f6 commit 30f4988

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/tensors/tensoroperations.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ function TO.tensoralloc(
1111
A = storagetype(TT)
1212
dim = fusionblockstructure(structure).totaldim
1313
data = TO.tensoralloc(A, dim, istemp, allocator)
14-
TT′ = tensormaptype(spacetype(structure), numout(structure), numin(structure), typeof(data))
14+
15+
# the following doesn't work since data isn't actually restricted to <: A
16+
# so hardcode type instead
17+
# TT′ = tensormaptype(spacetype(structure), numout(structure), numin(structure), typeof(data))
18+
TT′ = TensorMap{scalartype(data), spacetype(structure), numout(structure), numin(structure), typeof(data)}
19+
1520
return TT′(data, structure)
1621
end
1722

@@ -156,7 +161,7 @@ function TO.tensorcontract_type(
156161
spacetype(A) == spacetype(B) || throw(SpaceMismatch("incompatible space types"))
157162
I = sectortype(A)
158163
TC′ = isreal(I) ? TC : complex(TC)
159-
M = pomote_storagetype(similarstoragetype(A, TC′), similarstoragetype(B, TC′))
164+
M = promote_storagetype(similarstoragetype(A, TC′), similarstoragetype(B, TC′))
160165
return tensormaptype(spacetype(A), N₁, N₂, M)
161166
end
162167

0 commit comments

Comments
 (0)