hema-ted / pycdft

MIT License
30 stars 9 forks source link

Runtime errors #6

Open langson-jnr opened 9 months ago

langson-jnr commented 9 months ago

We have been trying to reproduce the tutorial on the diabatic electronic coupling for the helium dimer He2 with PyCDFT.

We find that when we use the “brenth” optimizer for the Lagrangian multiplier, the code runs for few iterations and then crashes with (<class 'TypeError'>, TypeError('cannot unpack non-iterable float object')

However, when we use the “secant” optimizer, the potential never converges.

Please find attached the inputs and out files for this. 2-pyCDFT_He2.zip

Best, Jonah Nagura The University of Chicago

wwwennie commented 8 months ago

Hi Jonah, thank you for your patience.

One aspect I can note is the software versions involved in generating the data in the paper (10.1002/JCC.26354):

qbox-1.71 python-3.7.0 mkl/2018.up2 intelmpi/2018.2.199+intel-18.0 xerces/3.1.4

With regards to the "brenth" optimizer, the error you receive is perhaps indicative that the optimizer failed. In some cases, this is because the range of values provided to V_brak is not sufficiently close to the actual root. It may help to display intermediate values of the optimizer. The choice of the optimizer is encoded in cdft.py

With regards to the "secant" optimizer, one suggestion is to have a much tighter scf convergence threshold when solving for the constrained potential. Currently, the scf convergence threshold is set to 1e-5. Perhaps try a tighter threshold (1e-8), similar to that for generating the initial ground-state wavefunctions. Often, well-converged charge state is needed to get a stable optimization.

Please let me know of your progress in running the tutorial. Best, Wennie