yingjerkao / uni10

Official Repo for Uni10
28 stars 9 forks source link

keep label information after resign bond #23

Open Wangwei-Lan opened 7 years ago

Wangwei-Lan commented 7 years ago

Hello, here,

I notice that each time I use UniTensor function assign() to reassign bond, then everything including the label information are deleted. Is it possible to keep the label information? See the below code will change the "psi" into almost another UniTensor. However, I am only changing the bond dimension, so the label information should be the same. Thanks very much.

psi.assign(bond);

rezah commented 7 years ago

do the following:

label=psi.getlabel() psi.assign(bond); psi.assignlabel(label);

Just find proper functions (above functions are to show you the main idea).