Skip to content

SCF calculation fails after first iteration with HSE functional in PW mode(set nspin = 2) #7306

@line-ar-line

Description

@line-ar-line

Describe the bug

Issue: SCF calculation fails after first iteration with HSE functional in PW mode(set nspin = 2)

Description

When setting nspin as 2, the SCF calculation for hydrogen atom using HSE functional in plane wave (PW) mode fails after the first iteration. The calculation stops at "Updating EXX and rerun SCF" without completing the SCF cycle.

Environment

  • ABACUS version: v3.11.0-beta.1 (Commit: e2bd830 (Sat May 2 09:43:15 2026 +0800))
  • Platform: CPU
  • OS: Linux

Steps to Reproduce

  1. Navigate to the directory: /home/linearline/project/00_hydrogen_abacus/00_H_scf/10_pw_hse
  2. Run ABACUS with the provided INPUT file
  3. Observe the calculation stops after first SCF iteration at "Updating EXX and rerun SCF"

Input Files

INPUT

INPUT_PARAMETERS
#Parameters (1.General)
suffix                  H
calculation             scf
symmetry                -1
pseudo_dir              ../../H_orb
basis_type              pw
ecutwfc                 50    
#Parameters (2. SCF iterations)
scf_nmax                100
scf_thr                 1e-8
#Parameters (3. Solve KS equation)
nspin                   2
nbands                  10
ks_solver               cg
#Parameters (4.Smearing)
smearing_method         gauss
smearing_sigma          0.01
#Parameters (5.Mixing)
mixing_type             broyden
mixing_beta             0.4
mixing_beta_mag         0.4
mixing_gg0              0.0
mixing_gg0_mag          0.0

dft_functional  hse

KPT

K_POINTS
0
Gamma
1 1 1 0 0 0

STRU

ATOMIC_SPECIES
H   1   H_ONCV_PBE-1.0.upf

LATTICE_CONSTANT
1.8897261258369282 

LATTICE_VECTORS
10.0000000000      0.0000000000      0.0000000000      
0.0000000000      10.0000000000      0.0000000000      
0.0000000000      0.0000000000      10.0000000000      

ATOMIC_POSITIONS
Direct
H   
0.0000000000
1
0.0000000000 0.0000000000 0.0000000000 1 1 1 mag 0.0 

Log Files

running_scf.log (relevant part)

 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 --> #ION MOVE#         1  #ELEC ITER#         5
 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Average iterative diagonalization steps for k-points is 9
 current threshold of diagonalizaiton is 4.41293e-09
          Total magnetism (Bohr mag/cell) = 1
       Absolute magnetism (Bohr mag/cell) = 1
              Electron number for spin up = 1
            Electron number for spin down = -1.55431e-15
 Electron density deviation 9.71214e-09
                          Diago Threshold = 4.41293e-09
 ----------------------------------------------------------
      Energy           Rydberg                 eV          
 ----------------------------------------------------------
  E_KohnSham     -0.9985324761        -13.5857313128       
  E_KS(sigma->0) -0.9985324761        -13.5857313128       
  E_Harris       -0.9985416096        -13.5858555804       
  E_band         -0.5556775817        -7.5603813614        
  E_one_elec     -0.6995448468        -9.5177959233        
  E_Hartree      0.4641695995         6.3153513916         
  E_xc           -0.6130139079        -8.3404821007        
  E_Ewald        -0.1501433209        -2.0428046804        
  E_entropy(-TS) -0.0000000000        -0.0000000000        
  E_descf        0.0000000000         0.0000000000         
  E_localpp      -1.5922823788        -21.6641131771       
  E_exx          0.0000000000         0.0000000000         
  E_Fermi        -0.1705965454        -2.3210850761        
  E_gap(k)       0.5342642711         7.2690383249         
 ----------------------------------------------------------

Updating EXX and rerun SCF

warning.log

 In SCAN_LINE_BEGIN, can't find: ABFS_ORBITAL block.
 In SCAN_LINE_BEGIN, can't find: ABFS_JLES_ORBITAL block.
 NAME OF ELEMENT      : H
 DFT FUNC. (PSEUDO)   : PBE
 DFT FUNC. (SET TO)   : HSE
 MAKE SURE THIS DFT FUNCTIONAL IS WHAT YOU NEED
                            startmag_type = 2
                       charge from rho_at = 0.997867
                         charge should be = 1
 Warning: negative or imaginary starting charge :  neg = -0.00030817 ima = 1.35246e-15 SPIN = 0

 SETUP ATOMIC RHO FOR SPIN 1
                 Electron number from rho = 1

 SETUP ATOMIC RHO FOR SPIN 2
                 Electron number from rho = 0
           total electron number from rho = 1
                                should be = 1
                 charge before normalized = 1.00000000000001
                  charge after normalized = 0.999999999999999
 scf  warning : Threshold on eigenvalues was too large.

Terminal Error Output

linearline@just-a-desktop:~/project/00_hydrogen_abacus/00_H_scf/10_pw_hse$ abacus_basic_para
                                                                                     
                              ABACUS v3.11.0-beta.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: e2bd83092 (Sat May 2 09:43:15 2026 +0800)

 Sat May  2 19:56:49 2026
 MAKE THE DIR         : OUT.H/
 RUNNING WITH DEVICE  : CPU / 12th Gen Intel(R) Core(TM) i5-1240P (x1)
 WARNING: some of potential function is set to zero cause of less than 1e-30.
 NAME OF ELEMENT      : H
 DFT FUNC. (PSEUDO)   : PBE
 DFT FUNC. (SET TO)   : HSE
 MAKE SURE THIS DFT FUNCTIONAL IS WHAT YOU NEED
 UNIFORM GRID DIM     : 90 * 90 * 90
 UNIFORM GRID DIM(BIG): 90 * 90 * 90
 DONE(0.303995   SEC) : SETUP UNITCELL
 DONE(0.306042   SEC) : INIT K-POINTS
 ----------------------------------------------------------------
 Self-consistent calculations for electrons
 ----------------------------------------------------------------
 SPIN    KPOINTS         PROCESSES   THREADS/PROC  THREADS/TOTAL 
 2       2               1           16            16            
 ----------------------------------------------------------------
 Use plane wave basis
 ----------------------------------------------------------------
 ELEMENT NATOM       
 H       1           
 ----------------------------------------------------------------
 Initial plane wave basis and FFT box
 ----------------------------------------------------------------
 DONE(0.47889    SEC) : INIT PLANEWAVE
 START CHARGE         : atomic
 DONE(1.64758    SEC) : LOCAL POTENTIAL
 DONE(1.65721    SEC) : NON-LOCAL POTENTIAL
 MEMORY FOR PSI (MB)  : 12.3105
 WARNING: init_wfc = atomic requires atomic pseudo wavefunctions(PP_PSWFC),
 but none available. Automatically switch to random initialization.
 DONE(1.65785    SEC) : INIT BASIS

 ================================================================
 SELF-CONSISTENT: 
 ================================================================
 DONE(2.74814    SEC) : INIT SCF
 ITER      TMAG       AMAG        ETOT/eV          EDIFF/eV         DRHO     TIME/s
 CG1      1.00e+00   1.00e+00  -1.35867943e+01   0.00000000e+00   1.3013e-03  27.84
 CG2      1.00e+00   1.00e+00  -1.35854445e+01   1.34984842e-03   3.9690e-04  12.48
 CG3      1.00e+00   1.00e+00  -1.35857244e+01  -2.79907810e-04   5.2201e-07   4.93
 CG4      1.00e+00   1.00e+00  -1.35857318e+01  -7.41243154e-06   4.4129e-08  24.74
 CG5      1.00e+00   1.00e+00  -1.35857313e+01   4.81969948e-07   9.7121e-09  25.03
terminate called after throwing an instance of 'std::runtime_error'
  what():  potrf failed with info = 1
[just-a-desktop:27344] *** Process received signal ***
[just-a-desktop:27344] Signal: Aborted (6)
[just-a-desktop:27344] Signal code:  (-6)
[just-a-desktop:27344] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x42520)[0x7a46aa042520]
[just-a-desktop:27344] [ 1] /lib/x86_64-linux-gnu/libc.so.6(pthread_kill+0x12c)[0x7a46aa0969fc]
[just-a-desktop:27344] [ 2] /lib/x86_64-linux-gnu/libc.so.6(raise+0x16)[0x7a46aa042476]
[just-a-desktop:27344] [ 3] /lib/x86_64-linux-gnu/libc.so.6(abort+0xd3)[0x7a46aa0287f3]
[just-a-desktop:27344] [ 4] /lib/x86_64-linux-gnu/libstdc++.so.6(+0xa2b9e)[0x7a46aa4a2b9e]
[just-a-desktop:27344] [ 5] /lib/x86_64-linux-gnu/libstdc++.so.6(+0xae20c)[0x7a46aa4ae20c]
[just-a-desktop:27344] [ 6] /lib/x86_64-linux-gnu/libstdc++.so.6(+0xae277)[0x7a46aa4ae277]
[just-a-desktop:27344] [ 7] /lib/x86_64-linux-gnu/libstdc++.so.6(+0xae4d8)[0x7a46aa4ae4d8]
[just-a-desktop:27344] [ 8] abacus_basic_para(+0x1aad584)[0x5f355d6bc584]
[just-a-desktop:27344] [ 9] abacus_basic_para(+0x6fb2e1)[0x5f355c30a2e1]
[just-a-desktop:27344] [10] abacus_basic_para(+0x816a39)[0x5f355c425a39]
[just-a-desktop:27344] [11] abacus_basic_para(+0x7cbd4b)[0x5f355c3dad4b]
[just-a-desktop:27344] [12] abacus_basic_para(+0x7c5971)[0x5f355c3d4971]
[just-a-desktop:27344] [13] abacus_basic_para(+0x5d9d0d)[0x5f355c1e8d0d]
[just-a-desktop:27344] [14] abacus_basic_para(+0x5f78ff)[0x5f355c2068ff]
[just-a-desktop:27344] [15] abacus_basic_para(+0x5f708a)[0x5f355c20608a]
[just-a-desktop:27344] [16] abacus_basic_para(+0x5f7240)[0x5f355c206240]
[just-a-desktop:27344] [17] abacus_basic_para(+0x123876)[0x5f355bd32876]
[just-a-desktop:27344] [18] /lib/x86_64-linux-gnu/libc.so.6(+0x29d90)[0x7a46aa029d90]
[just-a-desktop:27344] [19] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0x80)[0x7a46aa029e40]
[just-a-desktop:27344] [20] abacus_basic_para(+0x123705)[0x5f355bd32705]
[just-a-desktop:27344] *** End of error message ***
Aborted (core dumped)

Expected Behavior

The SCF calculation should complete all iterations until convergence is reached, not crash during the EXX update.

Additional Information

When setting nspin as 1, the SCF calculation for hydrogen atom using HSE functional in plane wave (PW) mode runs successfully, and the same goes when setting nspin as 2 (SCF calculation in lcao mode).But the calculation fails when setting nspin as 2 (SCF calculation in pw mode)

Expected behavior

No response

To Reproduce

No response

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions