Cytnx
Cytnx copied to clipboard
Add get_block_unitensor() and get_block_unitensor_()
We need to add get_block_unitensor() and get_block_unitensor_() which return a UniTensor instead of a Tensor.
Actually, I think there is a better way to do this.
If we just make Tensor has a method Tensor.unitensor(labels)
So the idea is we can do
UT.get_block().unitensor(labels)
In the user guide, we can say:
``get_block() return the data of a block (as a Tensor, see Appendix.XXX). To get the block as a unitensor, simply chaining with .unitensor(labels) as following:"
UT.get_block().unitensor(labels)
and for the generator, one can do
cytnx.zeros(100).unitensor(labels)