codes for arbitrary bond dimension, randomizing initial lamdas, rescaling resulting lamdas