# Working in different subspace

Dear ITensor comminuty

I am interested to probe the minimum energy of a general many-body Hamiltonian, let's say spin models, in different subspaces. For example, plotting the E{min} versos S^z{total} }.

any comments and help would be appreciated

Regards

selected by

For this goal the QN conserving DMRG feature of ITensor should be exactly what you need. I believe you are using the C++ version of ITensor, correct? Either way the basic approach for conserving total Sz is to make an initial wavefunction which has a well-defined total Sz value and is the one you want to study. Then, if your site indices carry QN information (this is the default behavior in the C++ version; for Julia you have to put conserve_qns=true when making the sites), then the DMRG code will automatically keep your wavefunction in the same total Sz sector throughout the optimization.

So if you use the above approach and just change the total Sz value of your initial states to the values you want to study, and obtain the resulting energies, you should get the information you are looking for.

Best regards,
Miles

commented by (420 points)
Dear Miles

I am using c++  and many thanks for your clear explanation.

Best regards
Glad it was helpful. For calculations like this, even though the conservation of total Sz is guaranteed by the code (the tensors have a block structure that ensures this), I still like to verify that the total Sz is the same at the end of the calculation as what I put in. For this you can measure the magnetization of each site and then compute the total, or you can use the function totalQN(psi) in ITensor to evaluate the total quantum number of an MPS and check that way.