Skip to content

Commit 21b3bc4

Browse files
committed
otimes between tensormaps to account for sectorscalartype
1 parent 26c6c83 commit 21b3bc4

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/tensors/linalg.jl

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -558,10 +558,17 @@ function ⊗(t1::AbstractTensorMap, t2::AbstractTensorMap)
558558
throw(SpaceMismatch("spacetype(t1) ≠ spacetype(t2)"))
559559
cod1, cod2 = codomain(t1), codomain(t2)
560560
dom1, dom2 = domain(t1), domain(t2)
561-
cod = cod1 cod2
562-
dom = dom1 dom2
561+
p12 = ((codomainind(t1)..., (codomainind(t2) .+ numind(t1))...),
562+
(domainind(t1)..., (domainind(t2) .+ numind(t1))...))
563+
563564
T = promote_type(scalartype(t1), scalartype(t2))
564-
t = zerovector!(similar(t1, T, cod dom))
565+
TC = promote_type(sectorscalartype(sectortype(t1)), T)
566+
t = TO.tensoralloc_contract(TC,
567+
t1, ((codomainind(t1)..., domainind(t1)...), ()), false,
568+
t2, ((), (codomainind(t2)..., domainind(t2)...)), false,
569+
p12, Val(false))
570+
571+
zerovector!(t)
565572
for (f1l, f1r) in fusiontrees(t1)
566573
for (f2l, f2r) in fusiontrees(t2)
567574
c1 = f1l.coupled # = f1r.coupled

0 commit comments

Comments
 (0)