Skip to content

Commit 7f2ba7d

Browse files
committed
Working with all tensor spaces
1 parent d6165f0 commit 7f2ba7d

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

src/tensors/tensor.jl

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -388,15 +388,20 @@ function project_symmetric!(t::TensorMap, data::DenseArray)
388388
else
389389
for (f₁, f₂) in fusiontrees(t)
390390
F = convert(Array, (f₁, f₂))
391-
dataslice = sview(
392-
data, axes(codomain(t), f₁.uncoupled)..., axes(domain(t), f₂.uncoupled)...
393-
)
394391
if FusionStyle(I) === UniqueFusion()
392+
dataslice = sview(
393+
data, axes(codomain(t), f₁.uncoupled)..., axes(domain(t), f₂.uncoupled)...
394+
)
395395
Fscalar = first(F) # contains a single element
396396
scale!(t[f₁, f₂], dataslice, conj(Fscalar))
397397
else
398-
subblock = t[f₁, f₂]
399-
szbF = _interleave(size(F), size(subblock))
398+
# do everything on CPU
399+
dataslice = sview(
400+
Array(data), axes(codomain(t), f₁.uncoupled)..., axes(domain(t), f₂.uncoupled)...
401+
)
402+
arr_t = TensorMap{scalartype(t)}(Array(t.data), t.space)
403+
subblock = arr_t[f₁, f₂]
404+
szbF = _interleave(size(F), size(subblock))
400405
indset1 = ntuple(identity, numind(t))
401406
indset2 = 2 .* indset1
402407
indset3 = indset2 .- 1
@@ -408,6 +413,7 @@ function project_symmetric!(t::TensorMap, data::DenseArray)
408413
(indset1, ()),
409414
inv(dim(f₁.coupled)), false
410415
)
416+
t[f₁, f₂] .= arr_t[f₁, f₂]
411417
end
412418
end
413419
end

test/cuda/tensors.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ spacelist = try
2828
(Vtr, VU₁, VSU₂, Vfℤ₂)
2929
end
3030
catch
31-
(Vtr, Vℤ₂, Vfℤ₂, Vℤ₃, VU₁, VfU₁) #, VSU₃)
32-
#(Vtr, Vℤ₂, Vfℤ₂, Vℤ₃, VU₁, VfU₁, VCU₁, VSU₂, VfSU₂) #, VSU₃)
31+
(Vtr, Vℤ₂, Vfℤ₂, Vℤ₃, VU₁, VfU₁, VCU₁, VSU₂, VfSU₂) #, VSU₃)
3332
end
3433

3534
for V in spacelist

0 commit comments

Comments
 (0)