## Preconditioning in response solver

taylor
Posts: 570
Joined: 15 Oct 2013, 05:37
First name(s): Peter
Middle name(s): Robert
Last name(s): Taylor
Affiliation: Tianjin University
Country: China

### Preconditioning in response solver

We have run a lot of shielding calculations with LSDalton, and I had noticed the code (by default) chooses "MO preconditioning", and then for each of the three sets of response equations, it has been my experience that the solver converges in one microiteration, giving immediately a residual norm of 10^{-7} or less. That is, the iterative solver appears to do no iterations at all. I don't have a problem with this per se: the chemical shifts are correct (or at least they agree with regular Dalton) and I had rather assumed that "MO preconditioning" led, at least for these perturbations, to a set of linear equations Ax = b in which the matrix A was diagonal, and so the preconditioner was its inverse and thus one obtained x = A^{-1}b in a single step, and a residual b - Ax that was effectively a zero vector straight away.

My first question is whether my analysis above is indeed correct? I ask because it is not obvious to me under what circumstances the matrix A might become ill-conditioned, and the vector x obtained from applying the preconditioner described above to b might then have idiotic values? While I have not seen any NaN entries is the case I am about to describe, I recently ran one calculation whether not only did the response solver (again, for shieldings) not converge in one microiteration, it did not converge at all within the default 100 iterations, not for any of the three field directions. Further, there was no sign of monotonic behaviour in the microiterations --- the residual norm started at around 10^2 and while in 100 iterations it fell to about 10^{-2} there was no sign whatever that this was going to converge further and the residual norm simply bounced around.

If my picture above of how the solver works is correct, how does one deal with an ill-conditioned A, should such a thing arise? Is it then appropriate to switch to a different preconditioner? If my picture is wrong, there is clearly a more fundamental problem with my calculation. At this stage I post neither inputs nor outputs because the calculation has more than 13,000 basis functions on 1800 centres and I doubt that anyone simply wants to run it themselves to see! It needs about 50,000 core-hours...

Best regards
Pete

Joanna
Posts: 116
Joined: 27 Aug 2013, 16:38
First name(s): Joanna
Last name(s): Kauczor
Affiliation: Helsinki
Country: Finland

### Re: Preconditioning in response solver

Dear Peter Taylor,

could you, please, attach your input.dal, so I could run a similar calculation for a smaller system and know exactly which path does the program take in your case?
taylor wrote: My first question is whether my analysis above is indeed correct?
The preconditioner is the inverse of A_0, where A_0 is a diagonal approximation of the A matrix.
However, to me your first case sounds a bit too good to be true (in different words: suspicious) unless you run it for a very small system or your A matrix is indeed diagonal.
On the other hand, in the large case you have described, I am surprised it is even possible to perform MO preconditioning (again: suspicious). Could you paste the residual norms in the 100 iterations it run?
taylor wrote: If my picture above of how the solver works is correct, how does one deal with an ill-conditioned A, should such a thing arise? Is it then appropriate to switch to a different preconditioner?
In general, since the preconditioner is a diagonal of A matrix, as long as it's elements are not equal to zero, the idiotic numbers (or NaN) should not appear. The chaotic (or lack of) convergence, on the other hand, may in case of ill-conditioned A matrix. In my experience (must admit, very limited) it is hardly ever the case, unless one hits an eigenvalue, but even in this case to actually diverge one needs to 'hit' it with the accuracy of several significant digits.
I will look into the problem.

All the best,
Joanna

helgaker
Posts: 1
Joined: 17 Mar 2014, 11:34
First name(s): Trygve
Last name(s): Helgaker
Affiliation: University of Oslo
Country: Norway

### Re: Preconditioning in response solver

The GGA Hessian for magnetic perturbations is diagonal (consisting only of orbital energy differences) and therefore no iterations are needed.

Joanna
Posts: 116
Joined: 27 Aug 2013, 16:38
First name(s): Joanna
Last name(s): Kauczor
Affiliation: Helsinki
Country: Finland

### Re: Preconditioning in response solver

Then it seems like there is some inconsistency between the linear transformations and the orbital energy differences (MO preconditioning), since as Trygve wrote, it should always converge in a one iteration.
Of course, it could also be a bug somewhere in the solver. I will try to look into it.

taylor
Posts: 570
Joined: 15 Oct 2013, 05:37
First name(s): Peter
Middle name(s): Robert
Last name(s): Taylor
Affiliation: Tianjin University
Country: China

### Re: Preconditioning in response solver

Thanks for the various comments. It seems to me that, assuming "orbital energy differences" means differences between occupied and virtual orbital energies (or sums of each), the only situation in which the matrix A could become near-singular is when there are (near-)degeneracies between the occupied and virtual spaces? That is not the case here, which suggests there is a problem with the code, or at the very least with the build.

Joanna, I tried to send you a message in which I included a (very long) Email exchange on multiple issues I am having with Thomas Kjaergaard but I clearly don't understand how to do "personal messaging" via the forum, because it didn't work... I am happy to extend that dialog to include you but I would prefer to take it off-forum --- can you let me have your Email address?

Best regards
Pete

Joanna
Posts: 116
Joined: 27 Aug 2013, 16:38
First name(s): Joanna
Last name(s): Kauczor
Affiliation: Helsinki
Country: Finland

### Re: Preconditioning in response solver

I sent you an email yesterday. Please, let me know in case you have not received it.

All the best,
Joanna

### Who is online

Users browsing this forum: No registered users and 1 guest