Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions docs/advanced/input_files/input-main.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@
- [out\_band](#out_band)
- [out\_proj\_band](#out_proj_band)
- [out\_stru](#out_stru)
- [out\_bandgap](#out_bandgap)
- [out\_level](#out_level)
- [out\_alllog](#out_alllog)
- [out\_mat\_hs](#out_mat_hs)
Expand Down Expand Up @@ -1844,14 +1843,6 @@ These variables are used to control the output of properties.
- **Description**: Whether to output structure files per ionic step in geometry relaxation calculations into `OUT.${suffix}/STRU_ION${istep}_D`, where `${istep}` is the ionic step.
- **Default**: False

### out_bandgap

- **Type**: Boolean
- **Description**: Whether to print the bandgap per electronic iteration into `OUT.${suffix}/running_${calculation}.log`. The value of bandgaps can be obtained by searching for the keyword:
- [nupdown](#nupdown) > 0: `E_bandgap_up` and `E_bandgap_dw`
- [nupdown](#nupdown) = 0: `E_bandgap`
- **Default**: False

### out_level

- **Type**: String
Expand Down
1 change: 0 additions & 1 deletion docs/advanced/interface/TB2J.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ out_mul 1
#Parameters (4.Relaxation)
ks_solver genelpa
scf_nmax 200
out_bandgap 0

#Parameters (5.LCAO)
basis_type lcao
Expand Down
1 change: 0 additions & 1 deletion examples/03_spin_polarized/ATOM/INPUT
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ cal_force 1
cal_stress 1
out_stru 1 # print STRU in OUT
out_chg 0 # print CHG or not
out_bandgap 1 # if bandgap and mul out, chg will out
out_mul 1 # print Mulliken charge and mag of atom in mulliken.txt
# out_wfc_lcao 1
# out_interval 1
Expand Down
1 change: 0 additions & 1 deletion examples/19_dftu/NiO/INPUT
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ dft_plus_u 1
orbital_corr 2 2 -1
hubbard_u 5.0 5.0 0.0

out_bandgap 1
out_chg 1
out_mul 1

Expand Down
1 change: 0 additions & 1 deletion examples/relax/pw_output/INPUT
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ out_dos 1 # dos.txt g
out_elf 1 # elf.txt
out_band 1 # eig.txt
out_stru 1 # g
out_bandgap 1

out_app_flag 0

Expand Down
27 changes: 12 additions & 15 deletions source/source_esolver/esolver_ks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,23 +308,20 @@ template <typename T, typename Device>
void ESolver_KS<T, Device>::iter_finish(UnitCell& ucell, const int istep, int& iter, bool &conv_esolver)
{

//----------------------------------------------------------------
// 1) print out band gap
//----------------------------------------------------------------
if (!PARAM.globalv.two_fermi)
{
this->pelec->cal_bandgap();
}
else
{
this->pelec->cal_bandgap_updw();
}

if(iter % PARAM.inp.out_freq_elec == 0)
{
//----------------------------------------------------------------
// 1) print out band gap
//----------------------------------------------------------------
if (PARAM.inp.out_bandgap)
{
if (!PARAM.globalv.two_fermi)
{
this->pelec->cal_bandgap();
}
else
{
this->pelec->cal_bandgap_updw();
}
}

//----------------------------------------------------------------
// 2) print out eigenvalues and occupations
//----------------------------------------------------------------
Expand Down
6 changes: 4 additions & 2 deletions source/source_estate/elecstate_energy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ void ElecState::cal_bandgap()
this->bandgap = 0.0;
return;
}
int nbands = PARAM.inp.nbands;
// int nbands = PARAM.inp.nbands;
int nbands = this->ekb.nc;
int nks = this->klist->get_nks();
double homo = this->ekb(0, 0);
double lumo = this->ekb(0, nbands - 1);
Expand Down Expand Up @@ -47,7 +48,8 @@ void ElecState::cal_bandgap_updw()
this->bandgap_dw = 0.0;
return;
}
int nbands = PARAM.inp.nbands;
// int nbands = PARAM.inp.nbands;
int nbands = this->ekb.nc;
int nks = this->klist->get_nks();
double homo_up = this->ekb(0, 0);
double lumo_up = this->ekb(0, nbands - 1);
Expand Down
23 changes: 10 additions & 13 deletions source/source_estate/elecstate_print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,20 +276,17 @@ void print_etot(const Magnetism& magnet,
}

// print out the band gap if needed
if (PARAM.inp.out_bandgap)
if (!PARAM.globalv.two_fermi)
{
if (!PARAM.globalv.two_fermi)
{
titles.push_back("E_bandgap");
energies_Ry.push_back(elec.bandgap);
}
else
{
titles.push_back("E_bandgap_up");
energies_Ry.push_back(elec.bandgap_up);
titles.push_back("E_bandgap_dw");
energies_Ry.push_back(elec.bandgap_dw);
}
titles.push_back("E_bandgap");
energies_Ry.push_back(elec.bandgap);
}
else
{
titles.push_back("E_bandgap_up");
energies_Ry.push_back(elec.bandgap_up);
titles.push_back("E_bandgap_dw");
energies_Ry.push_back(elec.bandgap_dw);
}
energies_eV.resize(energies_Ry.size());
std::transform(energies_Ry.begin(), energies_Ry.end(), energies_eV.begin(), [](double ener) {
Expand Down
3 changes: 0 additions & 3 deletions source/source_estate/test/elecstate_print_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ TEST_F(ElecStatePrintTest, PrintEtot)
PARAM.input.efield_flag = true;
PARAM.input.gate_flag = true;
PARAM.sys.two_fermi = true;
PARAM.input.out_bandgap = true;
GlobalV::MY_RANK = 0;
PARAM.input.basis_type = "pw";
PARAM.input.nspin = 2;
Expand Down Expand Up @@ -221,7 +220,6 @@ TEST_F(ElecStatePrintTest, PrintEtotColorS2)
PARAM.input.efield_flag = true;
PARAM.input.gate_flag = true;
PARAM.sys.two_fermi = true;
PARAM.input.out_bandgap = true;
PARAM.input.nspin = 2;
GlobalV::MY_RANK = 0;

Expand Down Expand Up @@ -251,7 +249,6 @@ TEST_F(ElecStatePrintTest, PrintEtotColorS4)
PARAM.input.efield_flag = true;
PARAM.input.gate_flag = true;
PARAM.sys.two_fermi = true;
PARAM.input.out_bandgap = true;
PARAM.input.nspin = 4;
PARAM.input.noncolin = true;
GlobalV::MY_RANK = 0;
Expand Down
1 change: 0 additions & 1 deletion source/source_io/module_parameter/input_parameter.h
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,6 @@ struct Input_para
std::string out_level = "ie"; ///< control the output information.
std::vector<int> out_dmr = {0, 8}; ///< output density matrix in real space DM(R)
std::vector<int> out_dmk = {0, 8}; ///< output density matrix in reciprocal space DM(k)
bool out_bandgap = false; ///< QO added for bandgap printing
std::vector<int> out_mat_hs = {0, 8}; ///< output H matrix and S matrix in local basis.
std::vector<int> out_mat_tk = {0, 8}; ///< output T(k) matrix in local basis.
std::vector<int> out_mat_l = {0, 8}; ///< output L matrix in local basis.
Expand Down
6 changes: 0 additions & 6 deletions source/source_io/read_input_item_output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,6 @@ void ReadInput::item_output()
sync_intvec(input.out_dmr, 2, 0);
this->add_item(item);
}
{
Input_Item item("out_bandgap");
item.annotation = "if true, print out bandgap";
read_sync_bool(input.out_bandgap);
this->add_item(item);
}
{
Input_Item item("out_mat_hs");
item.annotation = "output H and S matrix (with precision 8)";
Expand Down
1 change: 0 additions & 1 deletion tests/01_PW/078_PW_S2_elec_add/INPUT
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ mixing_type plain
mixing_beta 0.7

nupdown 1.0
out_bandgap 1

cal_force 1
cal_stress 1
3 changes: 0 additions & 3 deletions tests/01_PW/209_PW_DFTHALF/INPUT
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,4 @@ mixing_beta 0.7

dft_functional PBE

#OUT
out_bandgap true

pw_seed 1
Loading