Dear Miles,
Thanks for the reply. I just found the error. So in the dmrg.h, around line 250 to line 261, one can comment off the lines involving quantum numbers:
251 // auto psi_qn = totalQN(psi);
252 // for(auto n : range(psis))
253 // {
254 // auto qn_n = totalQN(psis[n]);
255 // if(qn_n != psi_qn)
256 // {
257 // printfln("totalQN of initial state: %s",psi_qn);
258 // printfln("totalQN of state n=%d (n is 0-indexed): %s",n,qn_n);
259 // Error("Excited-state DMRG intended for states with same totalQN");
260 // }
261 // }
Once this is is done, the code runs successfully.
Yantao