Skip to content

Commit 454779a

Browse files
borisdevoslkdvos
authored andcommitted
otimes between tensormaps to account for sectorscalartype
1 parent 6efcb05 commit 454779a

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
@@ -569,10 +569,17 @@ function ⊗(t1::AbstractTensorMap, t2::AbstractTensorMap)
569569
throw(SpaceMismatch("spacetype(t1) ≠ spacetype(t2)"))
570570
cod1, cod2 = codomain(t1), codomain(t2)
571571
dom1, dom2 = domain(t1), domain(t2)
572-
cod = cod1 cod2
573-
dom = dom1 dom2
572+
p12 = ((codomainind(t1)..., (codomainind(t2) .+ numind(t1))...),
573+
(domainind(t1)..., (domainind(t2) .+ numind(t1))...))
574+
574575
T = promote_type(scalartype(t1), scalartype(t2))
575-
t = zerovector!(similar(t1, T, cod dom))
576+
TC = promote_type(sectorscalartype(sectortype(t1)), T)
577+
t = TO.tensoralloc_contract(TC,
578+
t1, ((codomainind(t1)..., domainind(t1)...), ()), false,
579+
t2, ((), (codomainind(t2)..., domainind(t2)...)), false,
580+
p12, Val(false))
581+
582+
zerovector!(t)
576583
for (f1l, f1r) in fusiontrees(t1)
577584
for (f2l, f2r) in fusiontrees(t2)
578585
c1 = f1l.coupled # = f1r.coupled

0 commit comments

Comments
 (0)