Cytnx icon indicating copy to clipboard operation
Cytnx copied to clipboard

Kernel crash when try to get a non-existing block.

Open pcchen opened this issue 1 year ago • 1 comments

If a UniTensor has 3 blocks. UniTensor.get_block(3) will crash the kernel.

This might be related to issue #357 .

pcchen avatar Sep 13 '24 16:09 pcchen

I guess this is the expected behavior. The index of blocks starts from zero. If my_unitensor has three blocks:

my_unitensor.get_block(0)  # OK
my_unitensor.get_block(1)  # OK
my_unitensor.get_block(2) # OK
my_unitensor.get_block(3) # raise RuntimeError in Python

IvanaGyro avatar Sep 13 '24 19:09 IvanaGyro