本帖最后由 liyuanhe211 于 2019-12-9 16:15 编辑
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 摘要:Gaussian官方对于IOp(5/13=1)的态度是:IOp(5/13=1)只是debug用的,除了开发者外,不应在任何计算之中使用。 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 【此文在标明出处(网址)、且Gaussian回复部分(不包括英语原文)无删改的情况下可任意转载。为防止产生误解,其他情况转载需联系我。】
IOp(5/13=1)是诸多广为谬传的垃圾关键词之中,影响最广、破坏性也几乎最严重的关键词。
近日在群里又有人讨论在几何优化中使用IOp(5/13=1)的合理性,故我向Gaussian Support发了一封邮件,其很快就回复了,其中很多内容主要包括:
- 在任何计算中不要用IOp(5/13=1)
- 遇到SCF不收敛时应当检查的错误
- 解决SCF不收敛的方法
这些与大家的日常提问都有很大关系,我大概翻译了一下,内容如下(原文全文见本文末尾):
---------------------------------------------------------------------------------------------------------------------------------------------------------- 我的提问(大意) ----------------------------------------------------------------------------------------------------------------------------------------------------------
我做几何优化(实际上用的群里另一人的例子),在几何优化的第一步遇到SCF不收敛问题,失败前已收敛到 Convg =1.031E-6,有人说此时使用IOp(5/13=1)可以“跳过”当前步骤、用未收敛波函数估计梯度、最终也可能收敛,这种做法是否合理?
另外,据我所知,由于使用 IOP(5/13=1) 之后不再提示 SCF 收敛失败,故而有极多的人把 IOP(5/13=1) 当成是“解决”SCF不收敛的方法,甚至用在单点计算中。他们看到 "Normal termination of Gaussian 09" 就感觉万事大吉了,根本不会手动去检查SCF收敛性。所以我建议在后续版本中,使用了 IOP(5/13=1) 时,应在输出结尾之前输出一个巨大的警告,例如:
- (Enter /home/gauuser/g09/l9999.exe)
- [Archieve & motto]
- Job cpu time: 0 days *********
- File lengths (MBytes): *********
-
-
- >>>>>>>> IOp(5/13=1) is used and SCF IS NOT CONVERGED. USE THE RESULT WITH CAUTION.
-
-
- Normal termination of Gaussian 09 at Sun May 22 02:33:01 2016.
复制代码 并且让GaussView程序读这一警告,在载入Log文件时弹出一个警告窗口告知这件事
----------------------------------------------------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------------------------------------- Gaussian Support 回复 ----------------------------------------------------------------------------------------------------------------------------------------------------------
(原文(英文)由Gaussian公司的 Technical Support Zou Lufeng 撰写)
感谢你的建议,我们会报告给开发人员(对IOp(5/13=1)进行警告)。
使用 IOp(5/13=1) 时,程序不会检查 SCF 收敛性,而使用 SCF 未收敛的波函数继续计算。这会导致结果没有物理意义。这一 IOp 只是开发者 debug 用的,作为用户,不应在任何计算中使用。
一般的说,应该尽量用现成关键词来解决问题,使用IOp时应十分谨慎。
使用较差 SCF 收敛限 —— 如"SCF(Conver=5)"做计算 —— 是一个常见的错误做法。在几何优化中,这可能导致接近收敛、梯度接近0时,无法提供较为精确地梯度,从而使得几何优化不收敛。一般使用的几何优化收敛限是 10^-4,如果 SCF 收敛至 10^-6,则梯度的精度只有 10^-3 或更低,比收敛限还要高,所以根本不会收敛。即使它(数值巧合?)收敛了,结果也不可靠,不应用在实际计算之中(avoided in “production runs”)。
只要你遇到了 SCF 收敛问题,应当在输入文件中,用“#P”代替“#”以显示SCF收敛过程。
在尝试下述方法之前,应检查这些可能 SCF 不收敛的错误:几何构型初猜太差,多了/少了 氢原子,电荷/多重度 输入错误,数值精度不够(尤其是在用了弥散函数的时候),等等
在此之上我们推荐这些解决SCF不收敛的方法,从其语气推测,下面的方法是按照推荐的优先级排序的,可按顺序尝试(包括其互相组合)。这部分与Sob的文章《解决SCF不收敛问题的方法》( http://sobereva.com/61)有很多重复之处,建议先阅读Sob的文章,同时与之重复内容的不再翻译。
- SCF=NoVarAcc:【首先尝试】(见Sob文章),高斯官方称“这绝对是应该首先尝试的解决方法”
- Integral=(Acc2E=N):【在有 “非常弥散的基函数” 时使用,Sob建议一般情况下不要使用】增加(双电子?)积分精度,默认积分精度是 10^-10,即此处默认N=10,用户可将其提高至 N=11 或 N=12。由于“非常弥散的函数”涉及小量的计算,应当增加积分精度。
- Int=Ultrafine:(见Sob文章)增加DFT数值积分精度。注意若在一个任务中使用了这个选项,则应该在相关的所有任务中均使用这个选项。一般来说不需要使用高于Ultrafine的积分精度.
- SCF=Fermi:【前述策略失效,且是SCF初期不收敛时使用】使用SCF=Fermi时,程序会动态的使用 Fermi 展宽、Damping、Level shifting 等一系列手段进行 SCF 收敛,程序会自动选用最合适的策略来做。这一手段只在SCF初期有效,且应该在前述各方法均无效的情况下再尝试。
- SCF=XQC:(见Sob文章)极其慢,但十分 Robust,几乎总是能用 QC 收敛。XQC 默认尝试 64 次常规 SCF 方法之后再做 QC(不是128次),这一次数可以用 SCF=(MaxConventionalCyc=N) 控制。 QC 方法相比其他 SCF 方法更容易收敛到离初猜最近的 SCF 解,这意味着得到的解不一定是稳定解。所以在使用 QC 时应用 Stable=Opt 检查波函数的稳定性,确认 "Stability analysis" 输出中没有 "The wavefunction has an internal instability"。如果发现确实有波函数不稳定问题,应当确认 Stable=Opt 得到的波函数确实是你需要的态,确认后应当在使用 Guess=Read 读取波函数的情况下重新优化结构。下面的 SCF=YQC 和 SCF=XQC 一样都有可能得到非最优解。这在组合方法(如CBS方法)中应尤其注意,用户需要检查组合方法中的每一步都收敛到了最优解。除非(组合方法中的)各不同方法的PES差别很大,否则一般Gaussian不会因为选用方法不同、就收敛到不同的态:但这并不总是成立。所以建议用户在使用这些 SCF 收敛方法的时候,应当通过查看轨道图、检查S^2的值等方法、确认确实得到了所想计算的态。
- SCF=YQC:在 G09 D.01 新加入的关键词,其使用线性搜索的方法做初步迭代,之后换用标准的 SCF 算法。(与XQC类似)如果上述步骤不收敛,则切换到QC方法。
----------------------------------------------------------------------------------------------------------------------------------------------------------
原文:
我的提问:- ***********
- *******
- I was optimizing the structure in the attachment. The SCF iteration doesn't converge on the first geometry optimization step (Convg =1.031E-6). I was told to use IOp(5/13=1), to use the not converged wavefunction in geometry optimization.
- Although IOp(5/13=1) can help one to "skip" the problem, I'm not sure it's a good idea to do that: using IOp(5/13=1) meaning using a [Conv=0.26D-04] SCF result (default SCF maxstep decrease to 64), inaccurate wavefunction might provide erroneous forces, which might cause optimization problem. So generally speaking, is it acceptable to use IOp(5/13=1) in geometry optimization?
- P.S., as far as I know, (in China) MANY Gaussian users regard IOp(5/13=1) as a "powerful" way of solving SCF convergence failure in SP calculations like post-HF, TD-DFT calculations. They found that with IOp(5/13=1) they never got L502 failures, so they added it to almost all calculations by default. When they looked at the output file, they found "Normal termination of Gaussian 09", and believed they made it right, without ever checking SCF convergence manually. This actually caused lots of unnoticed erroneous calculation result, especially for beginners.
- I suggest, in the later versions, when IOp(5/13=1) is used and SCF has not converged, Gaussian should output a HUGE warning JUST BEFORE "Normal termination", that the result is not "Normal". Something like this:
- --------------------------------------------------------------------------------------------
- (Enter /home/gauuser/g09/l9999.exe)
- [Archieve & motto]
- Job cpu time: 0 days *********
- File lengths (MBytes): *********
- >>>>>>>> IOp(5/13=1) is used and SCF IS NOT CONVERGED. USE THE RESULT WITH CAUTION.
- Normal termination of Gaussian 09 at Sun May 22 02:33:01 2016.
- --------------------------------------------------------------------------------------------
- Also let GaussView read this sentence and pop up a warning Message_Box when loading the output file.
- Sincerely,
- Li Yuan-He
复制代码
Gaussian的回复(翻译的比较草,若有翻译错误欢迎指出):
- Hello Yuanhe,
- Thank you for your suggestion, I'll report it to the developers. You're right, IOp(5/13=1) continues calculation even when the SCF is not converged; this option could lead to unphysical results and is for debug test only; it should be avoided in ALL production runs. In general, it is recommend to go with the default options for beginners and the IOps should only be used with caution.
- A related common mistake is to use "SCF(Conver=5)" or lower as the result will be unreliable. In fact, it could lead to failure in convergence for geometry optimization as the gradient approaches 0 near stationary points so you need a reasonable accuracy. There are several thresholds used in the geometry optimization and simply lowering the SCF convergence threshold makes it impossible to meet other convergence criteria. The default optimization convergence criteria for gradient is on the order of 10^(-4). However, when SCF energy is converged to 10^(-5), the gradient is only good to 10^(-3) or lower, which is above the optimization convergence threshold, so it cannot converge. Even if it converges, the result is unreliable and should be avoided in production runs.
- The SCF convergence problem could result from various reasons, including bad initial geometry, extra/missing hydrogens, wrong charge/multiplicity, and/or insufficient numerical accuracy, especially when diffuse functions are used, etc. Whenever you may expect to have SCF convergence problems, it is recommended to use "#P" instead of "#" so that you can monitor the convergence during each SCF cycle. After checking the possible reasons above, here are a few general guidelines to follow in case of SCF convergence difficulties:
- 1) "SCF=NoVarAcc". This one requests the use of full integral accuracy from the first SCF cycle. The default is to use lower accuracy in the first few cycles in interest of speed and then switch to full accuracy as the SCF approaches convergence. In some cases, the initial lower integral accuracy is not good enough and the SCF procedure might do a lot of useless iterations. This option never hurts, it would make the first few cycles a little slower but the overall time may be lower if it takes fewer cycles to get close to convergence, so it is definitely the first thing to try.
-
- 2) Increase integral accuracy. The default thresholds are set for an integral accuracy of 10^-10. In some cases when using very diffuse functions, one might need to use tighter thresholds since there will be very small quantities being computed. The integral accuracy is controlled with "Integral=(Acc2E=N)" in G09. The default is N=10. One may try increasing the accuracy by one or two orders of magnitude (i.e. N=11 or N=12).
-
- 3) Tighten the grid for numerical integration in DFT (This does not apply to non-DFT jobs such as pm6, HF, MP2, etc.). The default ("Fine") grid for numerical integration is adequate for most purposes but in some cases the small numerical noise might make difficult SCF convergence and the SCF procedure takes too many iterations when it is close to convergence. If the problem is with large oscillations in early SCF cycles, this is likely not going to help. One can tighten the grid with "Integral=(Grid=XXXXX)", where XXXXX is the value of the integration grid (see the documentation of the "Integral" keyword for more details). In most cases, tightening the grid to the "Ultrafine" grid is sufficient. Note that using a different integration grid changes the total energy for DFT, so "Integral(Grid=UltraFine)" must be used throughout the study, including geometry optimizations, frequencies and other jobs. So you'll have to reoptimize all the reactants, products, etc, with the new integration grid.
- 4) "SCF=NoIncFock". Turning off the incremental Fock formation can help in cases with very diffuse functions. This increases the computational cost of the SCF calculation as it requests the recomputation of the full Fock matrix at each SCF cycle, instead of only doing an incremental Fock formation (default). There is an increase in the cost of the whole SCF procedure since the full Fock matrix is formed at every SCF cycle, but such increase in cost with respect to the default SCF procedure is lower than doing QC SCF.
- 5) "SCF=Fermi". This one does a combination of things including Fermi broadening, damping and level shifting, deciding dynamically the most suitable strategy. It can be helpful in cases with oscillations in early cycles of the SCF procedure, but I only recommend it in such cases and when the other options above do not make a difference on the early oscillations.
- 6) "SCF=XQC". Turns on the QC SCF procedure after the maximum number of regular SCF cycles have been done without convergence (if the SCF is converged in fewer cycles with the regular SCF procedure, then the QC step is skipped). The maximum number of regular SCF cycles by default is 64, and this can be controlled by "SCF=(MaxConventionalCyc=N)". The QC procedure is much slower than the regular SCF procedure but it is very robust and almost guaranteed to converge to an SCF solution. The "SCF=XQC" option thus provides a fall-back solution when the regular SCF procedure fails to converge. It also has higher chance to converge to the nearest SCF solution (which could be an unstable solution) than the regular SCF procedure, so it is strongly recommended to check for instabilities with a "Stable=Opt" calculation.
- In the output, go to the section with "Stability analysis". If you there is NOTHING like "The wavefunction has an internal instability", then you're OK; If not, please check whether the new ground state is the one you're looking for, and if so you will need to re-optimize the structure with the stable wavefunction from the checkpoint file using "Guess=Read".
-
- 7) G09 Rev. D and later add "SCF=YQC" which uses the linear search but switching to the standard algorithm after reaching initial convergence; if it failed to converge, it will switch to the quadratic algorithm again.
- As you see, the issue with SCF=XQC is that it will usually converge (or SCF=YQC for G09 Rev. D01 or later); however, it may well not be the desired one or the lowest. In the case of a compound method (like CBS), you have to check the lowest solution is found in each step of the calculation. Often (and again not always), Gaussian will not change states with various methods except in cases where the potential energy surface differs significantly between the methods. Plotting the orbitals, checking the value of S**2 are recommended.
- If you continue to have SCF convergence issues, please do not hesitate to let us know and we'll be glad to help.
- Lufeng Zou, Ph.D.
- Technical Support
- Gaussian, Inc.
- help@gaussian.com
复制代码
|