As the title suggests, I provide a minimal example to reproduce it. I am using the latest commit on master: commit c4f89dcfc6fce48b6d8da45204c9c309f3900a8f
import ctf
import numpy as np
print(ctf.__file__)
vals = [1,2,3,4,5,6]
indices = [0,1,3,4,5,7]
s = ctf.tensor([2,2,2,2], sym=[1,0,1,0], sp=1)
s.write(indices, vals)
d = ctf.tensor([2,2,2,2], sym=[1,0,1,0], sp=0)
d.write(indices, vals)
print(s)
print(d)
assert(np.array_equal(s.to_nparray(),d.to_nparray()))
d_1 = d[:,:,:,:1]
print(d_1)
s_1 = s[:,:,:,:1]
print(s_1)
assert(np.array_equal(s_1.to_nparray(),d_1.to_nparray()))
One can see that d_1 is as intended, while s_1 is wrong. One can also test that as long as we don't use symmetries in the tensor, the slicing works fine for both dense and sparse tensors:
Dear Edgar,
As the title suggests, I provide a minimal example to reproduce it. I am using the latest commit on master: commit c4f89dcfc6fce48b6d8da45204c9c309f3900a8f
One can see that d_1 is as intended, while s_1 is wrong. One can also test that as long as we don't use symmetries in the tensor, the slicing works fine for both dense and sparse tensors:
I ran the examples on 1 core only.
If you need further information, please let me know.
Thanks in advance, Ke