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
174 stars 136 forks source link

Request: `auto` option for `init_wfc` #4565

Open QuantumMisaka opened 4 months ago

QuantumMisaka commented 4 months ago

Waiting for init_wfc auto option to solve the bug below

Describe the bug

After #3140 , We can use init_wfc file and init_chg file when the file is not exist, ABACUS will skip the reading process and do calculation. But in the 3.7.0 version, the wavefunction part have problem and cannot skip properly:

 Read in wave functions files: 8
Can't find the wave function file: WFC_NAO_K1.txt

 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
                         NOTICE                           
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

 Failed to read in wavefunction.
 CHECK IN FILE : OUT.ABACUS/warning.log

 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
                         NOTICE                           
 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
TIME STATISTICS

while the charge part maintained.

 START CHARGE      : file
 WARNING: Failed to read charge density from file. Possible reasons: 
 - not found: The default directory of SPIN1_CHG.cube is OUT.suffix, 
or you must set read_file_dir to a specific directory. 
 - parameter mismatch: check the previous warning.
 Use atomic initialization instead.
 DONE(13.1617    SEC) : INIT SCF
 * * * * * *
 << Start SCF iteration.

Expected behavior

The init_wfc file function should work like init_chg file , when the wavefunction file not exist, the init part should skip back to atomic.

To Reproduce

Run with init_wfc file

No response

Environment

ABACUS 3.7.0 Commit: a33935612 (Thu Jun 27 16:40:42 2024 +0800) installed by Intel-toolchain Hardware: intel-8358

No response

Additional Context

No response

Task list for Issue attackers (only for developers)

WHUweiqingzhou commented 4 months ago

@pxlxingliang @hongriTianqi could you have a look?

pxlxingliang commented 4 months ago

Hi @QuantumMisaka, set init_wfc to file and abacus can do calculation continue even the wfc file does not exist, this may confuse some user. Recently, I am changing the behavior, and ABACUS will stop and quit if the file does not exist. For your demand, I think it is better to add another option to meet it.

For init_chg, #4560 will add option auto that behavior as you expect, and for init_wfc I will also add one option recently.

QuantumMisaka commented 4 months ago

Hi @QuantumMisaka, set init_wfc to file and abacus can do calculation continue even the wfc file does not exist, this may confuse some user. Recently, I am changing the behavior, and ABACUS will stop and quit if the file does not exist. For your demand, I think it is better to add another option to meet it.

For init_chg, #4560 will add option auto that behavior as you expect, and for init_wfc I will also add one option recently.

Good solution! waiting for update

QuantumMisaka commented 4 months ago

@pxlxingliang any update?