SSCHAcode / python-sscha

The python implementation of the Stochastic Self-Consistent Harmonic Approximation (SSCHA).
GNU General Public License v3.0
55 stars 21 forks source link

Eigenvalues did not converge during minimization #52

Open mesonepigreco opened 3 years ago

mesonepigreco commented 3 years ago

Sometimes, during the minimization, the eigenvalues do not converge, causing an error that halts the code.

This seems to happen especially with the new line-minimization feature, and in systems with big unit cells (>100 atoms)

mesonepigreco commented 2 years ago

It happens in the new gold thermal expansion example sometimes.

mesonepigreco commented 2 years ago

It should not come from the self.update() as this error is now handled there, maybe in the preconditioning of the structure?

ManexAlkorta commented 3 weeks ago

What is the output of SSCHA when this occurs? I’m having problems with a system of around 200 atoms. Without a root representation it founds imaginary modes at some point in the minimisation, while with the root represantation the the Free energy is fluctuating at some point

mesonepigreco commented 3 weeks ago

Hi, this is not the issue of the imaginary frequencies, in this case (which is very hard to reproduce) the code halts with an internal error that the numpy library is not able to diagonalize the dynamical matrix (the error state that the eigenvalue problem is not converging).

In your case, you can probably start with the root representation and then switch it off after some steps with something like:

minim.root_representation = "sqrt"
minim.max_ka = 100 # Set the maximum number of steps
minim.run()
minim.max_ka = 1000 # Maximum number of steps
minim.root_representation = "normal"
minim.run()

You can adapt the script to your use