Skip to content

Commit 4ad378a

Browse files
authored
Merge branch 'deepmodeling:develop' into feature
2 parents a11d44a + 6c460fd commit 4ad378a

File tree

34 files changed

+412
-625
lines changed

34 files changed

+412
-625
lines changed

docs/advanced/input_files/input-main.md

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@
195195
- [bessel\_descriptor\_smooth](#bessel_descriptor_smooth)
196196
- [bessel\_descriptor\_sigma](#bessel_descriptor_sigma)
197197
- [deepks\_bandgap](#deepks_bandgap)
198-
- [deepks\_bandgap\_range](#deepks_bandgap_range)
198+
- [deepks\_band\_range](#deepks_band_range)
199199
- [deepks\_v\_delta](#deepks_v_delta)
200200
- [deepks\_out\_unittest](#deepks_out_unittest)
201201
- [OFDFT: orbital free density functional theory](#ofdft-orbital-free-density-functional-theory)
@@ -1626,16 +1626,15 @@ These variables are used to control the output of properties.
16261626
- **Type**: Integer
16271627
- **Description**:
16281628
- 1: Output the **total local potential** (i.e., local pseudopotential + Hartree potential + XC potential + external electric field (if exists) + dipole correction potential (if exists) + ...) on real space grids (in Ry) into files in the folder `OUT.${suffix}`. The files are named as:
1629-
- nspin = 1: SPIN1_POT.cube;
1630-
- nspin = 2: SPIN1_POT.cube, and SPIN2_POT.cube;
1631-
- nspin = 4: SPIN1_POT.cube, SPIN2_POT.cube, SPIN3_POT.cube, and SPIN4_POT.cube.
1632-
- 2: Output the **electrostatic potential** on real space grids into `OUT.${suffix}/ElecStaticPot.cube`. The Python script named `tools/average_pot/aveElecStatPot.py` can be used to calculate the average electrostatic potential along the z-axis and outputs it into ElecStaticPot_AVE.
1633-
1629+
- nspin = 1: `pots1.cube`;
1630+
- nspin = 2: `pots1.cube` and `pots2.cube`;
1631+
- nspin = 4: `pots1.cube`, `pots2.cube`, `pots3.cube`, and `pots4.cube`
1632+
- 2: Output the **electrostatic potential** on real space grids into `OUT.${suffix}/pot_es.cube`. The Python script named `tools/average_pot/aveElecStatPot.py` can be used to calculate the average electrostatic potential along the z-axis and outputs it into ElecStaticPot_AVE.
16341633
Please note that the total local potential refers to the local component of the self-consistent potential, excluding the non-local pseudopotential. The distinction between the local potential and the electrostatic potential is as follows: local potential = electrostatic potential + XC potential.
16351634
- 3: Apart from 1, also output the **total local potential** of the initial charge density. The files are named as:
1636-
- nspin = 1: SPIN1_POT_INI.cube;
1637-
- nspin = 2: SPIN1_POT_INI.cube, and SPIN2_POT_INI.cube;
1638-
- nspin = 4: SPIN1_POT_INI.cube, SPIN2_POT_INI.cube, SPIN3_POT_INI.cube, and SPIN4_POT_INI.cube.
1635+
- nspin = 1: `pots1_ini.cube`;
1636+
- nspin = 2: `pots1_ini.cube` and `pots2_ini.cube`;
1637+
- nspin = 4: `pots1_ini.cube`, `pots2_ini.cube`, `pots3_ini.cube`, and `pots4_ini.cube`
16391638

16401639
In molecular dynamics calculations, the output frequency is controlled by [out_interval](#out_interval).
16411640
- **Default**: 0
@@ -1657,7 +1656,7 @@ These variables are used to control the output of properties.
16571656

16581657
- **Type**: Boolean
16591658
- **Availability**: Numerical atomic orbital basis (multi-k points)
1660-
- **Description**: Whether to output the density matrix with Bravias lattice vector R, labelled as DM(R), into files in the folder `OUT.${suffix}`. The files are named as `dmr{s}{spin index}{g}{geometry index}{_nao} + {".csr"}`. Here, 's' refers to spin, where s1 means spin up channel while s2 means spin down channel, and the sparse matrix format 'csr' is mentioned in [out_mat_hs2](#out_mat_hs2). Finally, if [out_app_flag](#out_app_flag) is set to false, the file name contains the optinal 'g' index for each ionic step that may have different geometries, and if [out_app_flag](#out_app_flag) is set to true, the density matrix with respect to Bravias lattice vector R accumulates during ionic steps:
1659+
- **Description**: Whether to output the density matrix with Bravias lattice vector R index into files in the folder `OUT.${suffix}`. The files are named as `dmr{s}{spin index}{g}{geometry index}{_nao} + {".csr"}`. Here, 's' refers to spin, where s1 means spin up channel while s2 means spin down channel, and the sparse matrix format 'csr' is mentioned in [out_mat_hs2](#out_mat_hs2). Finally, if [out_app_flag](#out_app_flag) is set to false, the file name contains the optinal 'g' index for each ionic step that may have different geometries, and if [out_app_flag](#out_app_flag) is set to true, the density matrix with respect to Bravias lattice vector R accumulates during ionic steps:
16611660
- nspin = 1: `dmrs1_nao.csr`;
16621661
- nspin = 2: `dmrs1_nao.csr` and `dmrs2_nao.csr` for the two spin channels.
16631662
- **Default**: False
@@ -2150,20 +2149,19 @@ Warning: this function is not robust enough for the current version. Please try
21502149
- **Availability**: numerical atomic orbital basis and `deepks_scf` is true
21512150
- **Description**: include bandgap label for DeePKS training
21522151
- 0: Don't include bandgap label
2153-
- 1: Include HOMO and LOMO for bandgap label
2154-
- 2: Include multiple bandgap label (see [deepks\_bandgap\_range](#deepks_bandgap_range) for more details)
2155-
- 3: Include target bandgap label (see [deepks\_bandgap\_range](#deepks_bandgap_range) for more details)
2156-
- 4: For systems containing H atoms only, HOMO is defined as the max occupation expect H atoms and the bandgap label is the energy between (HOMO, HOMO + 1)
2152+
- 1: Include target bandgap label (see [deepks\_band\_range](#deepks_band_range) for more details)
2153+
- 2: Include multiple bandgap label (see [deepks\_band\_range](#deepks_band_range) for more details)
2154+
- 3: For systems containing H atoms only, HOMO is defined as the max occupation expect H atoms and the bandgap label is the energy between HOMO and (HOMO + 1)
21572155
- **Default**: 0
21582156

2159-
### deepks_bandgap_range
2157+
### deepks_band_range
21602158

21612159
- **Type**: Int*2
2162-
- **Availability**: numerical atomic orbital basis, `deepks_scf` is true, and `deepks_bandgap` is 2 or 3
2163-
- **Description**:
2164-
- `deepks_bandgap` is 2: Bandgap labels are energies between (LUMO + deepks_bandgap_range[0], HOMO), (LUMO + deepks_bandgap_range[0] + 1, HOMO), ..., (LUMO + deepks_bandgap_range[1], HOMO) except (HOMO, HOMO)
2165-
- `deepks_bandgap` is 3: Bandgap label is the energy between (LUMO + deepks_bandgap_range[0], LUMO + deepks_bandgap_range[1])
2166-
- **Default**: 0 0
2160+
- **Availability**: numerical atomic orbital basis, `deepks_scf` is true, and `deepks_bandgap` is 1 or 2
2161+
- **Description**: The first value should not be larger than the second one and the meaning differs in different cases below
2162+
- `deepks_bandgap` is 1: Bandgap label is the energy between `LUMO + deepks_band_range[0]` and `LUMO + deepks_band_range[1]`. If not set, it will calculate energy between HOMO and LUMO states.
2163+
- `deepks_bandgap` is 2: Bandgap labels are energies between HOMO and all states in range [`LUMO + deepks_band_range[0]`, `LUMO + deepks_band_range[1]`] (Thus there are `deepks_band_range[1] - deepks_band_range[0] + 1` bandgaps in total). If HOMO is included in the setting range, it will be ignored since it will always be zero and has no valuable messages (`deepks_band_range[1] - deepks_band_range[0]` bandgaps in this case). *NOTICE: The set range can be greater than, less than, or include the value of HOMO. In the bandgap label, we always calculate the energy of the state in the set range minus the energy of HOMO state, so the bandgap can be negative if the state is lower than HOMO.*
2164+
- **Default**: -1 0
21672165

21682166
### deepks_v_delta
21692167

source/module_esolver/esolver_fp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ void ESolver_FP::after_scf(UnitCell& ucell, const int istep, const bool conv_eso
196196
{
197197
for (int is = 0; is < PARAM.inp.nspin; is++)
198198
{
199-
std::string fn =PARAM.globalv.global_out_dir + "/SPIN" + std::to_string(is + 1) + "_POT.cube";
199+
std::string fn =PARAM.globalv.global_out_dir + "/pots" + std::to_string(is + 1) + ".cube";
200200

201201
ModuleIO::write_vdata_palgrid(Pgrid,
202202
this->pelec->pot->get_effective_v(is),
@@ -212,7 +212,7 @@ void ESolver_FP::after_scf(UnitCell& ucell, const int istep, const bool conv_eso
212212
}
213213
else if (PARAM.inp.out_pot == 2)
214214
{
215-
std::string fn =PARAM.globalv.global_out_dir + "/ElecStaticPot.cube";
215+
std::string fn =PARAM.globalv.global_out_dir + "/pot_es.cube";
216216
ModuleIO::write_elecstat_pot(
217217
#ifdef __MPI
218218
this->pw_big->bz,
@@ -359,7 +359,7 @@ void ESolver_FP::before_scf(UnitCell& ucell, const int istep)
359359
for (int is = 0; is < PARAM.inp.nspin; is++)
360360
{
361361
std::stringstream ss;
362-
ss << PARAM.globalv.global_out_dir << "SPIN" << is + 1 << "_POT_INI.cube";
362+
ss << PARAM.globalv.global_out_dir << "pots" << is + 1 << "_ini.cube";
363363
ModuleIO::write_vdata_palgrid(this->Pgrid,
364364
this->pelec->pot->get_effective_v(is),
365365
is,

0 commit comments

Comments
 (0)