Hi Jordan,
The short answer to your question is "I don't know". I have not encountered many situations where I needed an accuracy this small so this could be a bug related to a hard-coded number somewhere as you suggest. Thanks for linking to the previous question also; that is helpful.
I have two thoughts about what could be going on:
- The particular number 1E-12 occurs because in practice that is often the most precision that can be reasonably expected when using double-precision floating point numbers. So at some point here you are really fighting against the floating point number system itself rather than the ITensor DMRG code.
If roundoff error might be the main culprit here then there isn't much that can be done within ITensor other that recompiling the library to use a higher precision floating point type than double, or doing a very detailed analysis of each step of the code and putting in possibly very specialized algorithms throughout.
- Your suggestion of just increasing niter in your DMRG sweeping parameters is definitely the first thing you should try.
But yes I am also suspicious of the ErrGoal parameter defined inside the Davidson algorithm on line 68 of itensor/eigensolver.h. You should be able to set this value like so:
dmrg(psi,H,sweeps,{"Quiet=",quiet,"ErrGoal=",my_errgoal});
to set it to a lower value. Indeed the Davidson algorithm could be exiting earlier than it should in your case.
So raising niter and lowering ErrGoal should cause the Davidson to do more iterations and possibly give you better results (i.e. hopefully prevent the energy rising issue you see).
Please give the suggestions in point #2 above a try and let me know if you see some improved behavior. Note that you can save your partially optimized wavefunction to disk and read it back in to keep from having to do all of your initial sweeps over again every time to test. Here is a little "code formula" page showing how to do that: http://itensor.org/docs.cgi?page=formulas/readwrite_mps . There is a function called fileExists("filename") you can also use to see if the file "psi" exists and if so read it in, otherwise making a new psi.
Miles