CombineBond should exist as non-member function
It is a bit counterintuitive that combineBond is a member function:
bond1 = cytnx.Bond(10)
bond2 = cytnx.Bond(2)
bond12 = bond1.combineBond(bond2)
In this case there should be no difference between bond1 and bond2.
I would suggest to have a non-member function instead:
bond1 = cytnx.Bond(10)
bond2 = cytnx.Bond(2)
bond12 = cytnx.CombineBonds([bond1, bond2])
What does no difference between bond1 and bond2 mean?
We want to combine bond1 and bond2 into a new bond=bond12. In terms of physics, bond1 is not special. So, why bond1.combineBond(bond2) and not bond2.combineBond(bond1).
I would say the only different is memery layout.
bond12 = cytnx.CombineBonds([bond1, bond2]) bond21 = cytnx.CombineBonds([bond2, bond1])
differ only in memory layout.
I also tend to use bond12 = cytnx.CombineBonds([bond1, bond2]). And the order in the bond list naturally corresonds to diffetnt memory latyout.
The reason they stay for member function is because you might need different implementation depending on the impl of UniTensor (e.g. Fermion/Dense/Sparse)