[CP2K-user] [CP2K:22123] Re: The KERKER mixing method may be more suitable than the BROYDEN mixing method for calculations involving magnetic systems.

yis...@163.com yisichi at 163.com
Fri Feb 27 15:31:42 UTC 2026


Sorry, I might have lost my cool just now. You understand that when 
computational time is relatively limited, encountering non-convergence is 
always a bit of a hair-pulling experience. Thank you very much for your 
selfless help. I will retest the similarities and differences between 
KERKER and BROYDEN for convergence in magnetic systems. CP2K is indeed a 
very powerful piece of software. Here, I would like to ask a question: when 
I use KERKER and encounter non-convergence, I usually lower the ALPHA 
parameter to 0.001. While running CP2K, I observe that the Convergence 
parameter always decreases as the number of iterations increases. However, 
with BROYDEN, it feels like it oscillates. Could this be a numerical 
artifact caused by ALPHA being too low?

在2026年2月27日星期五 UTC+8 21:28:30<yis... at 163.com> 写道:

> Thank you for your reply. However, based on the test results, it is still 
> difficult to converge.
>
> 在2026年2月26日星期四 UTC+8 18:43:32<Shiyang Wang (W0728)> 写道:
>
>> Dear yisichi-design,
>>
>> For BROYDEN_MIXING, you should use NBROYDEN instead of BETA to help 
>> convergence. Default NBROYDEN is 4, which often hinders convergence. You 
>> can increase it to 8 or even 12. BETA is used for KERKER_MIXING.
>>
>> For such systems, reducing the ALPHA value does indeed help with 
>> convergence (the default is 0.4), and this is often done in practice (we 
>> often use 0.3 or even 0.15). However, setting ALPHA too small may lead to 
>> numerical issues.
>>
>> To understand what *“Spin contamination estimate not implemented for 
>> k‑points”* means, you may need to look up what *spin contamination* 
>> refers to. In CP2K, in most cases this warning can be safely ignored.
>>
>> If there’s anything else that needs to be discussed, feel free to add it 
>> at any time.
>>
>> 在2026年2月26日星期四 UTC+8 12:37:55<yis... at 163.com> 写道:
>>
>>> Hello CP2K developers,
>>>             A few days ago on GitHub, we discussed whether the KERKER or 
>>> BROYDEN mixing method is more suitable for magnetic system calculations. 
>>> Following up on that, I have done some tests and found that the KERKER 
>>> mixing method may be more appropriate for magnetic systems than BROYDEN. 
>>> Below is my testing procedure.
>>>              I used two test models: a unit cell model of NiFe(OH)₂ and 
>>> the (010) surface of gamma-NiOOH. For the NiFe(OH)₂ unit cell, the test 
>>> procedure was as follows. First, with SMEAR enabled, the number of 
>>> iterations for the SCF calculation was set to 100. I then tested the 
>>> effects of different mixing methods, ALPHA, and BETA on convergence. The 
>>> test results are shown in Table 1. Figure 1 shows a screenshot of the SCF 
>>> results for the first 50 steps of Test1, which used the KERKER mixing 
>>> method with ALPHA = 0.2 and BETA at its default value. Both Table 1 and 
>>> Figure 1 indicate that under these parameters, SCF does not converge and 
>>> shows no trend toward convergence. In Test2, ALPHA was reduced to 0.03 
>>> while keeping other parameters the same as in Test1. Figure 1 and Table 1 
>>> show that a convergence trend appears, albeit slowly. After 100 iterations, 
>>> the convergence value reached 0.00041471. Although it has not yet met the 
>>> convergence criterion, I believe that increasing the number of iterations 
>>> would lead to successful convergence. Test3 further reduced BETA to 0.8 
>>> based on Test2. After 100 iterations, the convergence value was 0.00159217, 
>>> which is slower than Test2. However, based on my previous experience, if 
>>> the parameters in Test2 struggle to converge, trying the parameters in 
>>> Test3 can be a useful alternative.
>>> [image: 图片2.jpg]
>>>        [image: 图片3.jpg]  
>>>                                    Fingure 1 Convergence results for 
>>> unit cell
>>>           I further tested BROYDEN as the wavefunction mixing method, as 
>>> shown in Figure 1 and Table 1. Compared to KERKER, its convergence 
>>> performance is noticeably worse. The SCF results show persistent 
>>> oscillations without a clear trend of convergence. Additionally, compared 
>>> to Test4, reducing both ALPHA and BETA to 0.01 still resulted in a 
>>> convergence value of 0.07070099 after 100 iterations, but without a 
>>> distinct convergence trend. Subsequently, I disabled SMEAR and reran the 
>>> same tests. The results are shown in the lower half of Table 1. Compared to 
>>> the cases with SMEAR enabled, convergence did not improve. For the same 
>>> wavefunction mixing method, ALPHA, and BETA, convergence actually worsened. 
>>> For example, with SMEAR disabled, using the KERKER method with ALPHA = 0.03 
>>> gave a convergence value of 0.00082845 after 100 iterations, which is 
>>> higher than the case with SMEAR enabled. For the BROYDEN method with ALPHA 
>>> = 0.2 and default BETA, the convergence value increased to 0.07480723, 
>>> still worse than KERKER. Moreover, as shown in Figure 1, when appropriate 
>>> ALPHA and BETA values are used with the KERKER method, convergence steadily 
>>> improves with increasing iterations rather than oscillating continuously.
>>>         Based on these results, I draw the following conclusions:
>>>         1. The KERKER mixing method may be more suitable for magnetic 
>>> systems than BROYDEN.
>>>         2. Default parameters for KERKER generally struggle to achieve 
>>> convergence; ALPHA needs to be reduced to 0.03 or even lower.
>>>            Further, I selected the (010) surface of gamma-NiOOH to test 
>>> SCF convergence. The results are shown in Table 2 and Figure 2. First, I 
>>> tested convergence with SMEAR enabled and ADDED_MOS set to 20. Similar to 
>>> the unit cell calculations, when ALPHA = 0.2, KERKER failed to converge and 
>>> showed no trend toward convergence. For TEST3 and TEST4, after lowering 
>>> ALPHA, an interesting phenomenon was observed. In both cases, a clear 
>>> convergence trend initially appeared, but after reaching a certain value, 
>>> the convergence residual began to increase again. For TEST3 (ALPHA reduced 
>>> to 0.03), the residual gradually decreased to 0.0350084 within the first 50 
>>> iterations, but then it started to diverge. For TEST4 (BETA reduced to 0.8 
>>> and ALPHA reduced to 0.01), the residual decreased to 0.00089041 within the 
>>> first 75 steps, then gradually increased to 0.02504273.
>>> [image: 图片4.jpg]
>>>           [image: 图片5.jpg]  
>>>                        Figure 2 Convergence results for slab
>>>           For BROYDEN, the convergence behavior was more complex. With 
>>> ALPHA = 0.2 and BETA = 0.8, the residual reached 0.05432726 after 200 
>>> iterations. However, when ALPHA and BETA were both reduced to 0.01, the 
>>> convergence worsened, and the SCF residual oscillated continuously without 
>>> a clear trend.
>>>              Considering that unoccupied orbitals might affect 
>>> convergence, I set ADDED_MOS to -1 -1 and reran the tests. The results in 
>>> the lower half of Table 2 show no significant differences.
>>> In summary, I conclude:
>>>            1. KERKER may be more suitable than BROYDEN for convergence 
>>> in magnetic systems.
>>>              2. Default parameters for KERKER generally struggle to 
>>> achieve convergence; ALPHA needs to be reduced to 0.03 or even lower.
>>>             The difficulty of achieving SCF convergence for magnetic 
>>> systems in CP2K has been a longstanding issue. I would like to ask the CP2K 
>>> developers to review my testing procedure and input files and provide 
>>> suggestions for optimizing the input. Additionally, I have a question:
>>>           1. What does the warning "WARNING in qs_scf_post_gpw.F:1841 
>>> :: Spin contamination estimate not implemented for k-points" mean, and how 
>>> can it be resolved?
>>>         The input files and results have been compressed into a ZIP file 
>>> and are provided as an attachment.
>>> Thank you very much
>>>
>>>
>>>

-- 
You received this message because you are subscribed to the Google Groups "cp2k" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cp2k+unsubscribe at googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/cp2k/b4af00d7-995c-443c-a005-92f88852155bn%40googlegroups.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20260227/0d2ee95d/attachment-0001.htm>


More information about the CP2K-user mailing list