Hi Po-Hao,

The good news about using symmetries (conserving Abelian quantum numbers) with ITensor is that it usually requires minimal changes to your code. If you have a look at the iqdmrg sample code (the file sample/iqdmrg.cc) that is a good example of how to set up DMRG for a spin model which conserves Sz.

The way the initial total Sz value is set is through the initial state given to DMRG. The InitState object helps you with this; in the sample code the total Sz is zero, but you could flip one of the spins to access another sector. Let me know if you still have some questions after looking at that code.

Unfortunately we don't offer non-Abelian symmetries, so you can't use S^2 as a quantum number (this is much more technical to implement than Abelian quantum numbers). Momentum conservation is also tricky; as far as I know it's not really known how to conserve momentum with DMRG in 1d systems. For narrow 2d systems one can work in a momentum-space basis in the y-direction to conserve momentum that way. But working in a momentum-space basis in the x-direction would lead to a huge increase in entanglement and ruin much of the usefulness of DMRG. For infinite DMRG perhaps there is a clever way to implement momentum conservation but that would require further research (and would make a nice paper if one figured it out!).

Best,

Miles

So if I want to know those quantum numbers for a few lower energy states, I should use the corresponding operators to obtain them. Obtaining momentum quantum number seems to require a little work but it is still doable.