Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Charge read-in have bad result in mGGA SCF #5383

Open
16 tasks
QuantumMisaka opened this issue Oct 31, 2024 · 2 comments
Open
16 tasks

Bug: Charge read-in have bad result in mGGA SCF #5383

QuantumMisaka opened this issue Oct 31, 2024 · 2 comments
Assignees
Labels
Bugs Bugs that only solvable with sufficient knowledge of DFT Questions Raise your quesiton! We will answer it.

Comments

@QuantumMisaka
Copy link
Collaborator

QuantumMisaka commented Oct 31, 2024

Describe the bug

Example: R2SCAN SCF for O2:
SCF without charge file:

                               ABACUS v3.8.1

               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: 3984296df (Thu Oct 31 14:49:09 2024 +0800)

 Thu Oct 31 11:30:53 2024
 MAKE THE DIR         : OUT.O2/
 RUNNING WITH DEVICE  : CPU / AMD EPYC 7B12 64-Core Processor
 dft_functional readin is: MGGA_X_R2SCAN+MGGA_C_R2SCAN
 dft_functional in pseudopot file is: PBE
 Please make sure this is what you need
 UNIFORM GRID DIM        : 125 * 125 * 125
 UNIFORM GRID DIM(BIG)   : 25 * 25 * 25
func,idMGGA_X_R2SCAN 497
func,idMGGA_C_R2SCAN 498
 DONE(0.0511097  SEC) : SETUP UNITCELL
 DONE(0.0519344  SEC) : INIT K-POINTS
 ---------------------------------------------------------
 Ion relaxation calculations
 ---------------------------------------------------------
 SPIN    KPOINTS         PROCESSORS  THREADS     NBASE       
 2       2               16          16          26          
 ---------------------------------------------------------
 Use Systematically Improvable Atomic bases
 ---------------------------------------------------------
 ELEMENT ORBITALS        NBASE       NATOM       XC          
 O       2s2p1d-7au      13          2           
 ---------------------------------------------------------
 Initial plane wave basis and FFT box
 ---------------------------------------------------------
 DONE(0.0760956  SEC) : INIT PLANEWAVE
 -------------------------------------------
 STEP OF ION RELAXATION : 1
 -------------------------------------------
 START CHARGE      : auto
 DONE(1.24574    SEC) : INIT SCF
 * * * * * *
 << Start SCF iteration.
 ITER      TMAG       AMAG        ETOT/eV          EDIFF/eV         DRHO         DKIN     TIME/s
 GE1      0.00e+00   0.00e+00  -8.12952645e+02   0.00000000e+00   5.5010e-01   1.9029e+00   0.82
 GE2      2.00e+00   2.02e+00  -8.75517855e+02  -6.25652105e+01   3.2067e-01   2.5228e+00   0.86
 GE3      2.00e+00   2.08e+00  -8.64267006e+02   1.12508492e+01   1.9958e-01   1.8132e-01   0.90
 GE4      2.00e+00   2.06e+00  -8.64558112e+02  -2.91105623e-01   1.1254e-01   1.4298e-01   0.92
 GE5      2.00e+00   2.06e+00  -8.64814321e+02  -2.56209072e-01   7.8151e-02   5.2950e-02   0.99
 GE6      2.00e+00   2.06e+00  -8.64786844e+02   2.74765287e-02   4.6139e-02   5.2759e-02   1.19
 GE7      2.00e+00   2.06e+00  -8.64767834e+02   1.90105077e-02   9.5561e-03   7.0338e-02   1.23
 GE8      2.00e+00   2.05e+00  -8.65059898e+02  -2.92064431e-01   3.9888e-03   4.5239e-03   1.24
 GE9      2.00e+00   2.05e+00  -8.65089445e+02  -2.95466870e-02   3.6407e-03   3.0589e-03   1.26
 GE10     2.00e+00   2.06e+00  -8.65042808e+02   4.66374894e-02   2.7190e-03   7.2330e-03   1.25
 GE11     2.00e+00   2.06e+00  -8.65076529e+02  -3.37215215e-02   1.7899e-03   3.9600e-04   1.24
 GE12     2.00e+00   2.06e+00  -8.65074201e+02   2.32831246e-03   1.4220e-03   3.5845e-04   1.25
 GE13     2.00e+00   2.06e+00  -8.65072745e+02   1.45611609e-03   1.1736e-03   3.1819e-04   1.22
 GE14     2.00e+00   2.06e+00  -8.65074078e+02  -1.33352795e-03   7.5266e-04   1.9271e-04   1.22
 GE15     2.00e+00   2.06e+00  -8.65075263e+02  -1.18516527e-03   6.1095e-04   5.5160e-05   1.20
 GE16     2.00e+00   2.06e+00  -8.65076478e+02  -1.21439634e-03   5.3164e-04   3.8431e-05   1.17
 GE17     2.00e+00   2.06e+00  -8.65077095e+02  -6.16815405e-04   3.7594e-04   1.0956e-04   1.16
 GE18     2.00e+00   2.06e+00  -8.65077545e+02  -4.50230787e-04   2.2459e-04   4.7779e-05   1.15
 GE19     2.00e+00   2.06e+00  -8.65077719e+02  -1.73896824e-04   1.6474e-04   4.3287e-05   1.12
 GE20     2.00e+00   2.06e+00  -8.65077505e+02   2.13349955e-04   1.4946e-04   9.8240e-05   1.10
 GE21     2.00e+00   2.06e+00  -8.65077788e+02  -2.82447139e-04   1.6215e-04   5.8668e-05   1.10
 GE22     2.00e+00   2.06e+00  -8.65077894e+02  -1.06583108e-04   1.6139e-04   8.5539e-06   1.12
 GE23     2.00e+00   2.06e+00  -8.65078000e+02  -1.05809092e-04   1.5791e-04   2.2764e-05   1.15
 GE24     2.00e+00   2.06e+00  -8.65077749e+02   2.51233579e-04   1.5355e-04   3.2183e-05   1.11
 GE25     2.00e+00   2.06e+00  -8.65078233e+02  -4.84491730e-04   1.4970e-04   5.9991e-05   1.08
 GE26     2.00e+00   2.06e+00  -8.65077415e+02   8.18581807e-04   1.5746e-04   1.2430e-04   1.09
 GE27     2.00e+00   2.06e+00  -8.65078155e+02  -7.40048108e-04   1.4688e-04   2.3816e-05   1.11
 GE28     2.00e+00   2.06e+00  -8.65078371e+02  -2.15653251e-04   1.2532e-04   2.5351e-05   1.09
 GE29     2.00e+00   2.06e+00  -8.65078808e+02  -4.37491243e-04   1.0126e-04   1.3083e-04   1.09
 GE30     2.00e+00   2.06e+00  -8.65078451e+02   3.57141698e-04   7.1239e-05   2.0585e-05   1.08
 GE31     2.00e+00   2.06e+00  -8.65078631e+02  -1.79816608e-04   5.6965e-05   4.6710e-05   1.11
 GE32     2.00e+00   2.06e+00  -8.65078380e+02   2.50401016e-04   5.5935e-05   8.0078e-06   1.11
 GE33     2.00e+00   2.06e+00  -8.65078392e+02  -1.17061065e-05   4.3898e-05   8.3416e-06   1.07
 GE34     2.00e+00   2.06e+00  -8.65078429e+02  -3.66029138e-05   3.4833e-05   4.7946e-06   0.99
 GE35     2.00e+00   2.06e+00  -8.65078408e+02   2.08408016e-05   1.6882e-05   1.0056e-05   1.00
 GE36     2.00e+00   2.06e+00  -8.65078437e+02  -2.94742651e-05   1.2763e-05   6.7177e-06   1.00
 GE37     2.00e+00   2.06e+00  -8.65078430e+02   7.21761875e-06   7.7092e-06   5.9200e-06   0.98
 GE38     2.00e+00   2.06e+00  -8.65078452e+02  -2.23304111e-05   4.7783e-06   1.4001e-06   1.00
 GE39     2.00e+00   2.06e+00  -8.65078457e+02  -4.54862243e-06   2.0994e-06   1.5989e-06   1.08
 GE40     2.00e+00   2.06e+00  -8.65078461e+02  -4.21012250e-06   1.0693e-06   4.7554e-07   1.09
 GE41     2.00e+00   2.06e+00  -8.65078462e+02  -1.12864634e-06   6.6140e-07   2.5960e-07   1.10
 GE42     2.00e+00   2.06e+00  -8.65078462e+02   7.18302608e-07   3.9520e-07   9.3916e-08   1.11
 GE43     2.00e+00   2.06e+00  -8.65078462e+02  -1.58768781e-07   3.3959e-07   7.2582e-08   1.10
 GE44     2.00e+00   2.06e+00  -8.65078461e+02   2.78387951e-07   2.6439e-07   6.1801e-09   1.11
 GE45     2.00e+00   2.06e+00  -8.65078462e+02  -1.29302455e-07   2.2258e-07   6.3529e-09   1.13
 GE46     2.00e+00   2.06e+00  -8.65078462e+02  -6.40150138e-08   1.1225e-07   1.9863e-08   1.14
 GE47     2.00e+00   2.06e+00  -8.65078462e+02  -4.31871161e-08   7.2074e-08   4.9201e-09   0.87

Use the charge file as read-in for SCF in same structure

 GE1      0.00e+00   0.00e+00  -8.12952643e+02   0.00000000e+00   5.5010e-01   1.9029e+00   0.82
 GE2     -2.00e+00   2.02e+00  -8.75517859e+02  -6.25652152e+01   3.2067e-01   2.5228e+00   0.85
 GE3     -2.00e+00   2.08e+00  -8.64267008e+02   1.12508507e+01   1.9958e-01   1.8132e-01   0.90
 GE4     -2.00e+00   2.06e+00  -8.64558112e+02  -2.91104321e-01   1.1254e-01   1.4298e-01   0.93
 GE5     -2.00e+00   2.06e+00  -8.64814321e+02  -2.56209106e-01   7.8151e-02   5.2950e-02   1.01
 GE6     -2.00e+00   2.06e+00  -8.64786844e+02   2.74767990e-02   4.6139e-02   5.2759e-02   1.18
 GE7     -2.00e+00   2.06e+00  -8.64767834e+02   1.90105626e-02   9.5561e-03   7.0338e-02   1.24
 GE8     -2.00e+00   2.05e+00  -8.65059898e+02  -2.92064324e-01   3.9888e-03   4.5240e-03   1.23
 GE9     -2.00e+00   2.05e+00  -8.65089445e+02  -2.95468537e-02   3.6407e-03   3.0589e-03   1.26
 GE10    -2.00e+00   2.06e+00  -8.65042807e+02   4.66378367e-02   2.7190e-03   7.2330e-03   1.25
 GE11    -2.00e+00   2.06e+00  -8.65076529e+02  -3.37216999e-02   1.7899e-03   3.9598e-04   1.25
 GE12    -2.00e+00   2.06e+00  -8.65074201e+02   2.32823464e-03   1.4220e-03   3.5843e-04   1.23
 GE13    -2.00e+00   2.06e+00  -8.65072744e+02   1.45626263e-03   1.1735e-03   3.1823e-04   1.22
 GE14    -2.00e+00   2.06e+00  -8.65074078e+02  -1.33390827e-03   7.5265e-04   1.9267e-04   1.21
 GE15    -2.00e+00   2.06e+00  -8.65075263e+02  -1.18501476e-03   6.1096e-04   5.5166e-05   1.20
 GE16    -2.00e+00   2.06e+00  -8.65076478e+02  -1.21442889e-03   5.3163e-04   3.8417e-05   1.18
 GE17    -2.00e+00   2.06e+00  -8.65077094e+02  -6.16700625e-04   3.7593e-04   1.0959e-04   1.13
 GE18    -2.00e+00   2.06e+00  -8.65077545e+02  -4.50274933e-04   2.2457e-04   4.7775e-05   1.10
 GE19    -2.00e+00   2.06e+00  -8.65077719e+02  -1.73757805e-04   1.6475e-04   4.3316e-05   1.10
 GE20    -2.00e+00   2.06e+00  -8.65077505e+02   2.13800703e-04   1.4944e-04   9.8184e-05   1.10
 GE21    -2.00e+00   2.06e+00  -8.65077803e+02  -2.98522369e-04   1.6146e-04   5.4336e-05   1.11
 GE22    -2.00e+00   2.06e+00  -8.65077864e+02  -6.05117967e-05   1.6176e-04   1.2038e-05   1.11
 GE23    -2.00e+00   2.06e+00  -8.65077925e+02  -6.14773264e-05   1.6465e-04   7.5806e-06   1.10
 GE24    -2.00e+00   2.06e+00  -8.65077871e+02   5.43982386e-05   1.5582e-04   3.3781e-05   1.09
 GE25    -2.00e+00   2.06e+00  -8.65077898e+02  -2.74444779e-05   1.5326e-04   4.5286e-05   1.10
 GE26    -2.00e+00   2.06e+00  -8.65078457e+02  -5.59005423e-04   1.3786e-04   5.8816e-05   1.09
 GE27    -2.00e+00   2.06e+00  -8.65078179e+02   2.78573837e-04   1.2763e-04   5.3665e-05   1.10
 GE28    -2.00e+00   2.06e+00  -8.65078413e+02  -2.34730009e-04   1.1006e-04   2.1619e-05   1.11
 GE29    -2.00e+00   2.06e+00  -8.65079183e+02  -7.69713547e-04   7.3079e-05   1.7504e-04   1.13
 GE30    -2.00e+00   2.06e+00  -8.65078045e+02   1.13768008e-03   7.2016e-05   4.6089e-05   1.11
 GE31    -2.00e+00   2.06e+00  -8.65078328e+02  -2.82406112e-04   7.0756e-05   2.0873e-06   1.10
 GE32    -2.00e+00   2.06e+00  -8.65078517e+02  -1.88728613e-04   6.6107e-05   2.7039e-05   1.12
 GE33    -2.00e+00   2.06e+00  -8.65078389e+02   1.27864848e-04   6.2173e-05   9.5171e-06   1.13
 GE34    -2.00e+00   2.06e+00  -8.65078309e+02   7.99485095e-05   6.0393e-05   1.6825e-05   1.13
 GE35    -2.00e+00   2.06e+00  -8.65078344e+02  -3.54531314e-05   3.6870e-05   2.9927e-05   1.07
 GE36    -2.00e+00   2.06e+00  -8.65078386e+02  -4.16234896e-05   2.8453e-05   1.3937e-05   1.04
 GE37    -2.00e+00   2.06e+00  -8.65078412e+02  -2.57400110e-05   1.9704e-05   7.1861e-06   1.06
 GE38    -2.00e+00   2.06e+00  -8.65078520e+02  -1.08257939e-04   1.3878e-05   1.6587e-05   1.06
 GE39    -2.00e+00   2.06e+00  -8.65078455e+02   6.44483760e-05   4.5135e-06   1.7537e-06   1.05
 GE40    -2.00e+00   2.06e+00  -8.65078458e+02  -2.57598462e-06   2.7939e-06   9.6497e-07   1.10
 GE41    -2.00e+00   2.06e+00  -8.65078466e+02  -8.43952089e-06   1.3935e-06   1.2286e-06   1.16
 GE42    -2.00e+00   2.06e+00  -8.65078461e+02   5.84938972e-06   8.5127e-07   2.4210e-07   1.17
 GE43    -2.00e+00   2.06e+00  -8.65078462e+02  -1.31246391e-06   7.4657e-07   1.3894e-07   1.17
 GE44    -2.00e+00   2.06e+00  -8.65078461e+02   5.05340245e-07   3.9624e-07   5.0804e-08   1.21
 GE45    -2.00e+00   2.06e+00  -8.65078461e+02  -1.77687361e-10   1.6092e-07   3.8485e-08   1.23
 GE46    -2.00e+00   2.06e+00  -8.65078461e+02  -1.13172928e-07   1.4236e-07   1.4385e-08   1.23
 GE47    -2.00e+00   2.06e+00  -8.65078462e+02  -1.25688769e-07   8.6194e-08   1.4987e-08   0.88

Which is truly abnormal

Expected behavior

When charge files are read-in, the SCF steps should be very short (in principle, 1) to get convergence

To Reproduce

ABACUS version: 3.8.1 Commit: 3984296 (Thu Oct 31 14:49:09 2024 +0800)
Installed by intel toolchain in AMD 7b12

Environment

No response

Additional Context

No response

Task list for Issue attackers (only for developers)

  • Verify the issue is not a duplicate.
  • Describe the bug.
  • Steps to reproduce.
  • Expected behavior.
  • Error message.
  • Environment details.
  • Additional context.
  • Assign a priority level (low, medium, high, urgent).
  • Assign the issue to a team member.
  • Label the issue with relevant tags.
  • Identify possible related issues.
  • Create a unit test or automated test to reproduce the bug (if applicable).
  • Fix the bug.
  • Test the fix.
  • Update documentation (if necessary).
  • Close the issue and inform the reporter (if applicable).
@QuantumMisaka
Copy link
Collaborator Author

INPUT:

INPUT_PARAMETERS RUNNING ABACUS-DFT

#Parameters (1.General)
suffix                  O2  # suffix of OUTPUT DIR
#ntype                   4   #  number of element
nspin                   2   #  1/2/4 4 for SOC
symmetry                0   #  0/1  1 for open, default
# symmetry_autoclose      1   # if symmetry error: set symmetry to 0
# symmetry_prec           1e-5  # default
esolver_type            ksdft  # ksdft, ofdft, sdft, tddft, lj, dp
dft_functional          MGGA_X_R2SCAN+MGGA_C_R2SCAN  # same as upf file, can be lda/pbe/scan/hf/pbe0/hse
ks_solver             genelpa  # default for ksdft-lcao
vdw_method              none  # d3 , d3_bj, none
pseudo_dir              /data/home/liuzq/example/PP
orbital_dir             /data/home/liuzq/example/ORB

#Parameters (2.Iteration)
calculation             relax # scf relax cell-relax md
ecutwfc                 100
scf_thr                 1e-7
scf_nmax                300
relax_nmax              200
relax_method            bfgs  # cg, bfgs, cg_bfgs, sd, "fire"
force_thr_ev            0.01  # ev
# stress_thr            5

#Parameters (3.Basis)
basis_type              lcao  # lcao or pw
kspacing              1 # replace KPT
gamma_only            0  # 0/1, replace KPT

#Parameters (4.Smearing)
smearing_method         gau    # mp/gaussian/fixed
smearing_sigma          0.001  # Rydberg

#Parameters (5.Mixing)
mixing_type             broyden  # pulay/broyden
#mixing_beta             0.2  # for metal: 0.05-0.4
#mixing_gg0              1.5  # only for metal

#Parameters (6.Calculation)
init_chg     auto
cal_force          1
cal_stress         1
out_stru           1  # print STRU in OUT
out_chg            1 7  # print CHG or not
out_bandgap        1
out_mul            1  # print Mulliken charge and mag of atom in mulliken.txt

STRU

ATOMIC_SPECIES
O  15.9990 O_ONCV_PBE-1.0.upf upf201

NUMERICAL_ORBITAL
O_gga_7au_100Ry_2s2p1d.orb

LATTICE_CONSTANT
1.8897260000

LATTICE_VECTORS
       10.0000000000        0.0000000000        0.0000000000
        0.0000000000       10.0000000000        0.0000000000
        0.0000000000        0.0000000000       10.0000000000

ATOMIC_POSITIONS
Direct

O #label
0.0000   #magnetism
2 #number of atoms
        0.4393496711        0.5000000000        0.5000000000 m 1 1 1 mag 1.0000
        0.5606503289        0.5000000000        0.5000000000 m 1 1 1 mag 1.0000

@kirk0830
Copy link
Collaborator

kirk0830 commented Oct 31, 2024

quite strange... the SCF behaviors in two cases seem to be identical... this is unexpected. But what is true is, the kinetic energy density is not implemented to dump as kin_r_g, indeed.

@mohanchen mohanchen added the Questions Raise your quesiton! We will answer it. label Nov 1, 2024
@QuantumMisaka QuantumMisaka added the Bugs Bugs that only solvable with sufficient knowledge of DFT label Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugs Bugs that only solvable with sufficient knowledge of DFT Questions Raise your quesiton! We will answer it.
Projects
None yet
Development

No branches or pull requests

3 participants