deepmodeling / abacus-develop

An electronic structure package based on either plane wave basis or numerical atomic orbitals.
http://abacus.ustc.edu.cn
GNU Lesser General Public License v3.0
165 stars 129 forks source link

SCF hard to converge in a large Fe5C2(510) slab system #3821

Open iid-ccme opened 6 months ago

iid-ccme commented 6 months ago

Details

I calculated a Fe5C2(510) slab system with about 500 atoms using recommended settings mixing_beta=0.1 , mixing_ndim=20 and mixing_gg0=1.0. While the SCF behavior is quite different from small slab systems I calculated before: the first step of ion relaxation needs 219 SCF iterations, there may be some problems. Fe5C2-edge.zip

Task list for Issue attackers (only for developers)

QuantumMisaka commented 6 months ago

@WHUweiqingzhou These slab systems are our focus systems, and when we use original 120-atoms' Fe5C2(510) system, the convergence is not that hard in the default setting and mixing_ndim 20

                              ABACUS v3.5.4

               Atomic-orbital Based Ab-initio Computation at UStc                    

                     Website: http://abacus.ustc.edu.cn/                             
               Documentation: https://abacus.deepmodeling.com/                       
                  Repository: https://github.com/abacusmodeling/abacus-develop       
                              https://github.com/deepmodeling/abacus-develop         
                      Commit: fc31f8cb9 (Mon Mar 4 14:05:57 2024 +0800)

 Wed Mar 27 10:18:35 2024
 MAKE THE DIR         : OUT.clean/
 RUNNING WITH DEVICE  : CPU / Intel(R) Xeon(R) Platinum 8358 CPU @ 2.60GHz

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 Warning: the number of valence electrons in pseudopotential > 8 for Fe: [Ar] 3d6 4s2
 Pseudopotentials with additional electrons can yield (more) accurate outcomes, but may be less efficient.
 If you're confident that your chosen pseudopotential is appropriate, you can safely ignore this warning.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 UNIFORM GRID DIM        : 125 * 240 * 160
 UNIFORM GRID DIM(BIG)   : 25 * 48 * 32
 DONE(0.550634   SEC) : SETUP UNITCELL
 DONE(0.576459   SEC) : INIT K-POINTS
 ---------------------------------------------------------
 Self-consistent calculations for electrons
 ---------------------------------------------------------
 SPIN    KPOINTS         PROCESSORS  NBASE       
 2       8               16          2628        
 ---------------------------------------------------------
 Use Systematically Improvable Atomic bases
 ---------------------------------------------------------
 ELEMENT ORBITALS        NBASE       NATOM       XC          
 C       2s2p1d-7au      13          36          
 Fe      4s2p2d1f-8au    27          80          
 ---------------------------------------------------------
 Initial plane wave basis and FFT box
 ---------------------------------------------------------
 DONE(0.610472   SEC) : INIT PLANEWAVE
 -------------------------------------------
 SELF-CONSISTENT : 
 -------------------------------------------
 START CHARGE      : atomic
 DONE(3.06706    SEC) : INIT SCF
 ITER   TMAG      AMAG      ETOT(eV)       EDIFF(eV)      DRHO       TIME(s)    
 GE1    1.44e+02  1.50e+02  -2.631027e+05  0.000000e+00   6.835e-02  1.382e+01  
 GE2    1.17e+02  1.31e+02  -2.629799e+05  1.227759e+02   7.510e-02  1.082e+01  
 GE3    9.38e+01  1.05e+02  -2.630131e+05  -3.320615e+01  1.171e-01  1.077e+01  
 GE4    1.17e+02  1.27e+02  -2.630862e+05  -7.310246e+01  5.515e-02  1.073e+01  
 GE5    1.02e+02  1.12e+02  -2.630690e+05  1.720373e+01   6.373e-02  1.073e+01  
 GE6    1.05e+02  1.16e+02  -2.631045e+05  -3.543391e+01  5.253e-02  1.071e+01  
 GE7    1.14e+02  1.24e+02  -2.631446e+05  -4.011666e+01  3.328e-02  1.074e+01  
 GE8    1.21e+02  1.31e+02  -2.631520e+05  -7.381524e+00  2.453e-02  1.072e+01  
 GE9    1.26e+02  1.37e+02  -2.631559e+05  -3.986707e+00  1.667e-02  1.078e+01  
 GE10   1.28e+02  1.39e+02  -2.631572e+05  -1.300784e+00  1.498e-02  1.078e+01  
 GE11   1.31e+02  1.42e+02  -2.631576e+05  -3.642185e-01  1.333e-02  1.077e+01  
 GE12   1.33e+02  1.44e+02  -2.631578e+05  -2.269187e-01  1.345e-02  1.076e+01  
 GE13   1.36e+02  1.47e+02  -2.631582e+05  -3.229229e-01  1.074e-02  1.074e+01  
 GE14   1.38e+02  1.50e+02  -2.631581e+05  4.512138e-02   1.033e-02  1.076e+01  
 GE15   1.41e+02  1.53e+02  -2.631587e+05  -5.663819e-01  6.410e-03  1.072e+01  
 GE16   1.43e+02  1.56e+02  -2.631586e+05  7.995512e-02   7.153e-03  1.077e+01  
 GE17   1.43e+02  1.56e+02  -2.631588e+05  -1.945841e-01  5.131e-03  1.074e+01  
 GE18   1.44e+02  1.57e+02  -2.631586e+05  1.590707e-01   6.017e-03  1.073e+01  
 GE19   1.44e+02  1.57e+02  -2.631587e+05  -9.377202e-02  4.014e-03  1.074e+01  
 GE20   1.44e+02  1.57e+02  -2.631586e+05  9.609433e-02   3.889e-03  1.075e+01  
 GE21   1.44e+02  1.57e+02  -2.631588e+05  -1.346573e-01  1.944e-03  1.076e+01  
 GE22   1.44e+02  1.57e+02  -2.631588e+05  4.676769e-04   1.558e-03  1.075e+01  
 GE23   1.44e+02  1.57e+02  -2.631588e+05  -3.388682e-03  1.473e-03  1.073e+01  
 GE24   1.44e+02  1.57e+02  -2.631588e+05  -4.413359e-03  1.074e-03  1.074e+01  
 GE25   1.44e+02  1.57e+02  -2.631588e+05  -2.661256e-03  9.451e-04  1.074e+01  
 GE26   1.44e+02  1.57e+02  -2.631588e+05  4.974169e-03   8.677e-04  1.072e+01  
 GE27   1.44e+02  1.57e+02  -2.631588e+05  -4.727621e-03  6.752e-04  1.075e+01  
 GE28   1.44e+02  1.57e+02  -2.631588e+05  -8.326701e-04  4.678e-04  1.074e+01  
 GE29   1.44e+02  1.57e+02  -2.631588e+05  -8.837560e-04  3.616e-04  1.075e+01  
 GE30   1.44e+02  1.57e+02  -2.631588e+05  -3.740791e-04  3.354e-04  1.073e+01  
 GE31   1.44e+02  1.57e+02  -2.631588e+05  -3.903902e-05  2.275e-04  1.072e+01  
 GE32   1.44e+02  1.57e+02  -2.631588e+05  -2.253026e-04  2.783e-04  1.077e+01  
 GE33   1.44e+02  1.57e+02  -2.631588e+05  -7.689468e-04  1.684e-04  1.075e+01  
 GE34   1.44e+02  1.57e+02  -2.631588e+05  -5.118320e-04  1.615e-04  1.073e+01  
 GE35   1.44e+02  1.57e+02  -2.631588e+05  -5.910421e-04  1.072e-04  1.074e+01  
 GE36   1.44e+02  1.57e+02  -2.631588e+05  -2.592665e-04  1.231e-04  1.074e+01  
 GE37   1.44e+02  1.57e+02  -2.631588e+05  -4.257830e-04  8.716e-05  1.073e+01  
 GE38   1.44e+02  1.57e+02  -2.631588e+05  -2.994497e-04  7.687e-05  1.081e+01  
 GE39   1.44e+02  1.57e+02  -2.631588e+05  -3.184045e-04  6.456e-05  1.073e+01  
 GE40   1.44e+02  1.57e+02  -2.631588e+05  -1.930538e-04  5.465e-05  1.075e+01  
 GE41   1.44e+02  1.57e+02  -2.631588e+05  -1.894915e-04  4.635e-05  1.075e+01  
 GE42   1.44e+02  1.57e+02  -2.631588e+05  -4.756838e-04  4.054e-05  1.076e+01  
 GE43   1.44e+02  1.57e+02  -2.631588e+05  -2.256616e-04  3.077e-05  1.078e+01  
 GE44   1.44e+02  1.57e+02  -2.631588e+05  -2.359481e-04  2.639e-05  1.079e+01  
 GE45   1.44e+02  1.57e+02  -2.631588e+05  -4.113762e-04  2.241e-05  1.072e+01  
 GE46   1.44e+02  1.57e+02  -2.631588e+05  -1.788603e-04  1.708e-05  1.075e+01  
 GE47   1.44e+02  1.57e+02  -2.631588e+05  -3.174001e-04  1.362e-05  1.075e+01  
 GE48   1.44e+02  1.57e+02  -2.631588e+05  -8.960703e-05  1.030e-05  1.075e+01  
 GE49   1.44e+02  1.57e+02  -2.631588e+05  -1.330028e-04  8.429e-06  1.072e+01  
 GE50   1.44e+02  1.57e+02  -2.631588e+05  -6.902707e-05  6.668e-06  1.074e+01  
 GE51   1.44e+02  1.57e+02  -2.631588e+05  -2.975032e-05  6.184e-06  1.072e+01  
 GE52   1.44e+02  1.57e+02  -2.631588e+05  -4.148488e-05  5.342e-06  1.073e+01  
 GE53   1.44e+02  1.57e+02  -2.631588e+05  -1.305715e-04  4.441e-06  1.072e+01  
 GE54   1.44e+02  1.57e+02  -2.631588e+05  -7.502737e-05  3.080e-06  1.075e+01  
 GE55   1.44e+02  1.57e+02  -2.631588e+05  -5.822890e-05  2.031e-06  1.074e+01  
 GE56   1.44e+02  1.57e+02  -2.631588e+05  -3.495065e-05  1.583e-06  1.073e+01  
 GE57   1.44e+02  1.57e+02  -2.631588e+05  -6.655844e-06  8.101e-07  1.076e+01  
 GE58   1.44e+02  1.57e+02  -2.631588e+05  -1.245905e-05  7.616e-07  1.070e+01  
 GE59   1.44e+02  1.57e+02  -2.631588e+05  -6.708609e-06  3.784e-07  1.073e+01  
 GE60   1.44e+02  1.57e+02  -2.631588e+05  -1.295986e-06  2.060e-07  1.075e+01  
 GE61   1.44e+02  1.57e+02  -2.631588e+05  1.148336e-06   2.254e-07  1.073e+01  
 GE62   1.44e+02  1.57e+02  -2.631588e+05  -3.814257e-07  1.171e-07  1.074e+01  
 GE63   1.44e+02  1.57e+02  -2.631588e+05  -8.437795e-07  1.085e-07  1.073e+01  
 GE64   1.44e+02  1.57e+02  -2.631588e+05  1.463138e-07   9.934e-08  1.084e+01  
----------------------------------------------------------------
TOTAL-STRESS (KBAR)                                           
----------------------------------------------------------------
       -8.3719488456         0.0544372646         0.0909954944
        0.0544372646         7.6769972531         1.3780024710
        0.0909954944         1.3780024710        -1.7176384538
----------------------------------------------------------------
 TOTAL-PRESSURE: -0.804197 KBAR

TIME STATISTICS
-------------------------------------------------------------------------------------
     CLASS_NAME                  NAME            TIME(Sec)  CALLS   AVG(Sec) PER(%)
-------------------------------------------------------------------------------------
                      total                      716.33           9  79.59   100.00
Driver                reading                      0.04           1   0.04     0.01
Input                 Init                         0.01           1   0.01     0.00
Input_Conv            Convert                      0.00           1   0.00     0.00
Driver                driver_line                716.30           1 716.30    99.99
UnitCell              check_tau                    0.00           1   0.00     0.00
PW_Basis_Sup          setuptransform               0.23           1   0.23     0.03
PW_Basis_Sup          distributeg                  0.02           1   0.02     0.00
mymath                heapsort                     0.02           3   0.01     0.00
PW_Basis_K            setuptransform               0.02           1   0.02     0.00
PW_Basis_K            distributeg                  0.02           1   0.02     0.00
PW_Basis              setup_struc_factor           0.10           1   0.10     0.01
NOrbital_Lm           extra_uniform                0.36          14   0.03     0.05
Mathzone_Add1         SplineD2                     0.00          14   0.00     0.00
Mathzone_Add1         Cubic_Spline_Interpolation   0.00          14   0.00     0.00
Mathzone_Add1         Uni_Deriv_Phi                0.36          14   0.03     0.05
ppcell_vl             init_vloc                    0.32           1   0.32     0.04
Ions                  opt_ions                   714.33           1 714.33    99.72
ESolver_KS_LCAO       Run                        692.73           1 692.73    96.71
ESolver_KS_LCAO       beforescf                    1.10           1   1.10     0.15
ESolver_KS_LCAO       beforesolver                 0.31           1   0.31     0.04
ESolver_KS_LCAO       set_matrix_grid              0.11           1   0.11     0.02
atom_arrange          search                       0.01           1   0.01     0.00
Grid_Technique        init                         0.05           1   0.05     0.01
Grid_BigCell          grid_expansion_index         0.00           2   0.00     0.00
Record_adj            for_2d                       0.05           1   0.05     0.01
Grid_Driver           Find_atom                    0.05       12052   0.00     0.01
LCAO_Hamilt           grid_prepare                 0.00           1   0.00     0.00
Veff                  initialize_HR                0.00           1   0.00     0.00
OverlapNew            initialize_SR                0.00           1   0.00     0.00
EkineticNew           initialize_HR                0.00           1   0.00     0.00
NonlocalNew           initialize_HR                0.01           1   0.01     0.00
Charge                set_rho_core                 0.00           1   0.00     0.00
Charge                atomic_rho                   0.56           1   0.56     0.08
PW_Basis_Sup          recip2real                   3.17         720   0.00     0.44
PW_Basis_Sup          gathers_scatterp             1.18         720   0.00     0.16
Potential             init_pot                     0.21           1   0.21     0.03
Potential             update_from_charge          11.41          65   0.18     1.59
Potential             cal_fixed_v                  0.01           1   0.01     0.00
PotLocal              cal_fixed_v                  0.01           1   0.01     0.00
Potential             cal_v_eff                   11.34          65   0.17     1.58
H_Hartree_pw          v_hartree                    0.82          65   0.01     0.11
PW_Basis_Sup          real2recip                   3.26         783   0.00     0.45
PW_Basis_Sup          gatherp_scatters             1.36         783   0.00     0.19
PotXC                 cal_v_eff                    9.96          65   0.15     1.39
XC_Functional         v_xc                         9.89          65   0.15     1.38
Efield                add_efield                   0.27          65   0.00     0.04
Potential             interpolate_vrs              0.06          65   0.00     0.01
H_Ewald_pw            compute_ewald                0.01           1   0.01     0.00
Charge_Mixing         init_mixing                  0.00           1   0.00     0.00
HSolverLCAO           solve                      673.85          64  10.53    94.07
HamiltLCAO            updateHk                   161.89         512   0.32    22.60
OperatorLCAO          init                       160.07        1536   0.10    22.35
Veff                  contributeHR               157.36         128   1.23    21.97
Gint_interface        cal_gint                   278.45         194   1.44    38.87
Gint_interface        cal_gint_vlocal            137.97         128   1.08    19.26
Gint_Tools            cal_psir_ylm                28.93       94656   0.00     4.04
Gint_k                transfer_pvpR               19.39         128   0.15     2.71
OverlapNew            calculate_SR                 0.40           1   0.40     0.06
OverlapNew            contributeHk                 1.41         512   0.00     0.20
EkineticNew           contributeHR                 0.40         128   0.00     0.06
EkineticNew           calculate_HR                 0.40           1   0.40     0.06
NonlocalNew           contributeHR                 1.37         128   0.01     0.19
NonlocalNew           calculate_HR                 1.10           1   1.10     0.15
OperatorLCAO          contributeHk                 0.54         512   0.00     0.08
HSolverLCAO           hamiltSolvePsiK            336.96         512   0.66    47.04
DiagoElpa             elpa_solve                 334.37         512   0.65    46.68
ElecStateLCAO         psiToRho                   175.00          64   2.73    24.43
elecstate             cal_dm                      22.30          65   0.34     3.11
psiMulPsiMpi          pdgemm                      22.09         520   0.04     3.08
DensityMatrix         cal_DMR                      0.88          65   0.01     0.12
Local_Orbital_wfc     wfc_2d_to_grid              10.77         520   0.02     1.50
Gint                  transfer_DMR                 8.76          64   0.14     1.22
Gint_interface        cal_gint_rho               126.93          64   1.98    17.72
Charge_Mixing         get_drho                     0.04          64   0.00     0.01
Charge                mix_rho                      3.35          63   0.05     0.47
Charge                Broyden_mixing               0.91          63   0.01     0.13
ESolver_KS_LCAO       out_deepks_labels            0.00           1   0.00     0.00
LCAO_Deepks_Interface out_deepks_labels            0.00           1   0.00     0.00
HamiltLCAO            updateSk                     0.02           8   0.00     0.00
Force_Stress_LCAO     getForceStress              21.60           1  21.60     3.02
Forces                cal_force_loc                0.11           1   0.11     0.02
Forces                cal_force_ew                 0.11           1   0.11     0.01
Forces                cal_force_cc                 0.00           1   0.00     0.00
Forces                cal_force_scc                0.47           1   0.47     0.07
Stress_Func           stress_loc                   1.83           1   1.83     0.26
Stress_Func           stress_har                   0.01           1   0.01     0.00
Stress_Func           stress_ewa                   0.10           1   0.10     0.01
Stress_Func           stress_cc                    0.00           1   0.00     0.00
Stress_Func           stress_gga                   0.08           1   0.08     0.01
Force_LCAO_k          ftable_k                    18.89           1  18.89     2.64
Force_LCAO_k          allocate_k                   2.01           1   2.01     0.28
LCAO_gen_fixedH       b_NL_mu_new                  1.02           1   1.02     0.14
Force_LCAO_k          cal_foverlap_k               0.68           1   0.68     0.09
Force_LCAO_k          cal_edm_2d                   0.66           1   0.66     0.09
DensityMatrix         sum_DMR_spin                 0.00           1   0.00     0.00
Force_LCAO_k          cal_ftvnl_dphi_k             0.00           1   0.00     0.00
Force_LCAO_k          cal_fvl_dphi_k              13.55           1  13.55     1.89
Gint_interface        cal_gint_force              13.55           2   6.77     1.89
Gint_Tools            cal_dpsir_ylm                3.48         986   0.00     0.49
Gint_Tools            cal_dpsirr_ylm               1.51         986   0.00     0.21
Force_LCAO_k          cal_fvnl_dbeta_k_new         1.65           1   1.65     0.23
ModuleIO              write_istate_info            0.02           1   0.02     0.00
-------------------------------------------------------------------------------------

 START  Time  : Wed Mar 27 10:18:35 2024
 FINISH Time  : Wed Mar 27 10:30:32 2024
 TOTAL  Time  : 717
 SEE INFORMATION IN : OUT.clean/

But in the fully-optimized supercell, the SCF performance is much lower, I consider it is important to find out why.

kirk0830 commented 6 months ago

Just a comment: Including slab the highly heterogenous system, charge sloshing seems to be a origin of failure of scf convergence, supporting local-TF may someday be necessary, perhaps. https://journals.aps.org/prb/abstract/10.1103/PhysRevB.64.121101

WHUweiqingzhou commented 6 months ago

@iid-ccme and @QuantumMisaka, could you upload input and output for us?

QuantumMisaka commented 6 months ago

@WHUweiqingzhou My input and output for primitive Fe5C2_510 surface system

Fe5C2_510_pri.tar.gz

The input and output for large supercell of surface is in the opening of this issue.

Also, we have tried pulay/broyden mixing with different smearing_sigma/mixing_beta/initial magmom and so on which can be uploaded @iid-ccme but this result seems to be not good as which in the file uploaded in the opening.

I'm double checking

iid-ccme commented 6 months ago

Here are some related results with similar SCF behavior: edge-stru2.zip edge-stru2-femag3.zip edge-femag3.zip

QuantumMisaka commented 6 months ago

@WHUweiqingzhou @iid-ccme

I've double checked SCF of these 500-atoms surfaces above, this structure below can be converged within 140 electronic steps by setting initial magmom of Fe is 3.0, smearing_sigma 0.010, mixing_beta 0.1, mixing_gg0 1.0 and mixing_ndim 20

edge-stru1-conv.tar.gz

But for this structure (which is a fully relaxed structure by Genetic Algorism by ASE-DPA2), the convergence cannot be reached

edge-stru2-noconv.tar.gz

And also:

  1. In the primitive surface, setting magmom of Fe to be 2.0 is enough, but for large surface this setting will let the magmom to be much low during SCF calculation, and one should set initial magmom at least 3.0 to maintain the magnetic SCF.
  2. I consider that we are lack of test dataset of surface SCF and magnetic system SCF
iid-ccme commented 13 hours ago

Thank you everyone for sharing data and advice. In past months, I found that mixing_beta 0.05 mixing_gg0 1.0 and mixing_ndim 20 can be helpful in Fe5C2 and similar large FeCx surfaces. Here is an example: Fe5C2-Crich-opt.zip