diff --git a/docs/advanced/elec_properties/band.md b/docs/advanced/elec_properties/band.md index aed66d0516..44fb88e1c5 100644 --- a/docs/advanced/elec_properties/band.md +++ b/docs/advanced/elec_properties/band.md @@ -1,41 +1,40 @@ # Extracting Band Structure -ABACUS can calculate the energy band structure, and the examples can be found in [examples/band](https://github.com/deepmodeling/abacus-develop/tree/develop/examples/band). -Similar to the [DOS case](https://abacus-rtd.readthedocs.io/en/latest/advanced/elec_properties/dos.html), we first, do a ground-state energy calculation ***with one additional keyword "[out_chg](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#out-chg)" in the INPUT file***: +In ABACUS, in order to obtain the eigenvalues of Hamiltonian, or generally called band structure, examples can be found in [examples/band](https://github.com/deepmodeling/abacus-develop/tree/develop/examples/band). +Similar to the [DOS case](https://abacus-rtd.readthedocs.io/en/latest/advanced/elec_properties/dos.html), one first needs to perform a ground-state energy calculation ***with one additional keyword "[out_chg](https://abacus-rtd.readthedocs.io/en/latest/advanced/input_files/input-main.html#out-chg)" in the INPUT file***: ``` -out_chg 1 +out_chg 1 ``` -This will produce the converged charge density, which is contained in the file SPIN1_CHG.cube. -Then, use the same `STRU` file, pseudopotential file and atomic orbital file (and the local density matrix file onsite.dm if DFT+U is used) to do a non-self-consistent calculation. In this example, the potential is constructed from the ground-state charge density from the proceeding calculation. Now the INPUT file is like: +With this input parameter, the converged charge density will be output in the files such as `chgs1.cube`, `chgs2.cube`, etc. +Then, one can use the same `STRU` file, pseudopotential files and atomic orbital files (and the local density matrix file onsite.dm if DFT+U is used) to do a non-self-consistent (NSCF) calculation. In this example, the potential is constructed from the ground-state charge density from the proceeding calculation. Now the INPUT file is like: ``` INPUT_PARAMETERS #Parameters (General) -ntype 1 -nbands 8 -calculation nscf -basis_type lcao -read_file_dir ./ +nbands 8 +calculation nscf +basis_type lcao +read_file_dir ./ #Parameters (Accuracy) -ecutwfc 60 -scf_nmax 50 -scf_thr 1.0e-9 -pw_diag_thr 1.0e-7 +ecutwfc 60 +scf_nmax 50 +scf_thr 1.0e-9 +pw_diag_thr 1.0e-7 #Parameters (File) -init_chg file -out_band 1 +init_chg file +out_band 1 out_proj_band 1 #Parameters (Smearing) smearing_method gaussian -smearing_sigma 0.02 +smearing_sigma 0.02 ``` -Here the the relevant k-point file KPT looks like, +Here is a relevant k-point file KPT (in LINE mode): ``` K_POINTS # keyword for start @@ -49,16 +48,16 @@ Line # line-mode 0.0 0.0 0.0 1 # G ``` -This means we are using: +This means we are using the following k-points: -- 6 number of k points, here means 6 k points: +- 6 k points, here means 6 k points: (0.5, 0.0, 0.5) (0.0, 0.0, 0.0) (0.5, 0.5, 0.5) (0.5, 0.25, 0.75) (0.375, 0.375, 0.75) (0.0, 0.0, 0.0) - 20/1 number of k points along the segment line, which is constructed by two adjacent k points. -Run the program, and you will see a file named BANDS_1.dat in the output directory. Plot it -to get energy band structure. +Next, run ABACUS and you will see a file named `eigs1.txt` in the output directory. +Plot it and you will obtain the energy band structure! If "out_proj_band" set 1, it will also produce the projected band structure in a file called PBAND_1 in xml format. @@ -77,8 +76,8 @@ The rest of the files arranged in sections, each section with a header such as b ``` whichpool.resize(nkstot, 0); - // std::cout << " calculate : whichpool" << std::endl; - // std::cout << " nkstot is " << nkstot << std::endl; - - for (int i = 0; i < this->kpar; i++) { for (int ik = 0; ik < this->nks_pool[i]; ik++) { const int k_now = ik + startk_pool[i]; this->whichpool[k_now] = i; - // ofs_running << "\n whichpool[" << k_now <<"] = " << whichpool[k_now]; } } @@ -72,19 +67,13 @@ void Parallel_Kpoints::get_nks_pool(const int& nkstot) const int nks_ave = nkstot / this->kpar; const int remain = nkstot % this->kpar; - // ofs_running << "\n nkstot = " << nkstot; - // ofs_running << "\n this->kpar = " << this->kpar; - // ofs_running << "\n nks_ave = " << nks_ave; - for (int i = 0; i < this->kpar; i++) - { this->nks_pool[i] = nks_ave; if (i < remain) { nks_pool[i]++; } - // ofs_running << "\n nks_pool[i] = " << nks_pool[i]; } return; } @@ -93,14 +82,10 @@ void Parallel_Kpoints::get_startk_pool(const int& nkstot) { startk_pool.resize(this->kpar, 0); - // const int remain = nkstot%this->kpar; - startk_pool[0] = 0; for (int i = 1; i < this->kpar; i++) - { startk_pool[i] = startk_pool[i - 1] + nks_pool[i - 1]; - // ofs_running << "\n startk_pool[i] = " << startk_pool[i]; } return; } @@ -120,7 +105,6 @@ void Parallel_Kpoints::set_startpro_pool() { startpro_pool[i]++; } - // ofs_running << "\n startpro_pool[i] = " << startpro_pool[i]; } return; } @@ -138,8 +122,6 @@ void Parallel_Kpoints::gatherkvec(const std::vector> { vec_global[i + startk_pool[this->my_pool]] = vec_local[i]; } - // vec_global[i + startk_pool[MY_POOL]] = vec_local[i] / double(NPROC_IN_POOL); - } MPI_Allreduce(MPI_IN_PLACE, &vec_global[0], 3 * this->nkstot_np, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD); @@ -152,7 +134,6 @@ void Parallel_Kpoints::pool_collection(double& value, const double* wk, const in #ifdef __MPI const int ik_now = ik - this->startk_pool[this->my_pool]; - // ofs_running << "\n\n ik=" << ik << " ik_now=" << ik_now; const int pool = this->whichpool[ik]; @@ -167,8 +148,6 @@ void Parallel_Kpoints::pool_collection(double& value, const double* wk, const in } else { - - // ofs_running << " receive data."; MPI_Status ierror; MPI_Recv(&value, 1, MPI_DOUBLE, this->startpro_pool[pool], ik, MPI_COMM_WORLD, &ierror); @@ -178,18 +157,12 @@ void Parallel_Kpoints::pool_collection(double& value, const double* wk, const in { if (this->my_pool == pool) { - - // ofs_running << " send data."; - MPI_Send(&wk[ik_now], 1, MPI_DOUBLE, 0, ik, MPI_COMM_WORLD); } } } else { - - // ofs_running << "\n do nothing."; - } MPI_Barrier(MPI_COMM_WORLD); @@ -238,13 +211,10 @@ void Parallel_Kpoints::pool_collection_aux(T* value, const V& w, const int& dim, T* p = &w.ptr[begin]; // temprary restrict kpar=1 for NSPIN=2 case for generating_orbitals int pool = 0; - if (this->nspin != 2) { - pool = this->whichpool[ik]; -} - - - // ofs_running << "\n ik=" << ik; - + if (this->nspin != 2) + { + pool = this->whichpool[ik]; + } if (this->rank_in_pool == 0) { @@ -261,7 +231,6 @@ void Parallel_Kpoints::pool_collection_aux(T* value, const V& w, const int& dim, } else { - // ofs_running << " receive data."; MPI_Status ierror; MPI_Recv(value, dim, MPI_DOUBLE, this->startpro_pool[pool], ik * 2 + 0, MPI_COMM_WORLD, &ierror); } @@ -270,14 +239,12 @@ void Parallel_Kpoints::pool_collection_aux(T* value, const V& w, const int& dim, { if (this->my_pool == pool) { - // ofs_running << " send data."; MPI_Send(p, dim, MPI_DOUBLE, 0, ik * 2 + 0, MPI_COMM_WORLD); } } } else { - // ofs_running << "\n do nothing."; } MPI_Barrier(MPI_COMM_WORLD); @@ -292,4 +259,4 @@ void Parallel_Kpoints::pool_collection_aux(T* value, const V& w, const int& dim, } // data transfer ends. #endif -} \ No newline at end of file +} diff --git a/source/module_elecstate/elecstate_print.cpp b/source/module_elecstate/elecstate_print.cpp index 09565e4b86..8959e997c8 100644 --- a/source/module_elecstate/elecstate_print.cpp +++ b/source/module_elecstate/elecstate_print.cpp @@ -148,98 +148,6 @@ void print_scf_iterinfo(const std::string& ks_solver, } std::cout << buf; } -/// @brief print and check for band energy and occupations -/// @param ofs -void print_eigenvalue(const ModuleBase::matrix& ekb, - const ModuleBase::matrix& wg, - const K_Vectors* klist, - std::ofstream& ofs) -{ - bool wrong = false; - const int nks = klist->get_nks(); - const int nkstot = klist->get_nkstot(); - for (int ik = 0; ik < nks; ++ik) - { - for (int ib = 0; ib < ekb.nc; ++ib) - { - if (std::abs(ekb(ik, ib)) > 1.0e10) - { - GlobalV::ofs_warning << " ik=" << ik + 1 << " ib=" << ib + 1 << " " << ekb(ik, ib) << " Ry" << std::endl; - wrong = true; - } - } - } -#ifdef __MPI - MPI_Allreduce(MPI_IN_PLACE, &wrong, 1, MPI_C_BOOL, MPI_LOR, MPI_COMM_WORLD); -#endif - if (wrong) - { - ModuleBase::WARNING_QUIT("print_eigenvalue", "Eigenvalues are too large!"); - } - - std::string filename = PARAM.globalv.global_out_dir + PARAM.globalv.log_file; - std::vector ngk_tot = klist->ngk; - -#ifdef __MPI - MPI_Allreduce(MPI_IN_PLACE, ngk_tot.data(), nks, MPI_INT, MPI_SUM, POOL_WORLD); -#endif - - ModuleBase::TITLE("ESolver_KS_PW", "print_eigenvalue"); - - ofs << "\n STATE ENERGY(eV) AND OCCUPATIONS "; - const int nk_fac = PARAM.inp.nspin == 2 ? 2 : 1; - const int nks_np = nks / nk_fac; - const int nkstot_np = nkstot / nk_fac; - ofs << " NSPIN == " << PARAM.inp.nspin << std::endl; - for (int is = 0; is < nk_fac; ++is) - { - if (is == 0 && nk_fac == 2) - { - ofs << "SPIN UP : " << std::endl; - } - else if (is == 1 && nk_fac == 2) - { - ofs << "SPIN DOWN : " << std::endl; - } - - for (int ip = 0; ip < GlobalV::KPAR; ++ip) - { -#ifdef __MPI - MPI_Barrier(MPI_COMM_WORLD); -#endif - bool ip_flag = PARAM.inp.out_alllog || (GlobalV::RANK_IN_POOL == 0 && GlobalV::MY_BNDGROUP == 0); - if (GlobalV::MY_POOL == ip && ip_flag) - { - const int start_ik = nks_np * is; - const int end_ik = nks_np * (is + 1); - for (int ik = start_ik; ik < end_ik; ++ik) - { - std::ofstream ofs_eig(filename.c_str(), std::ios::app); - ofs_eig << std::setprecision(5); - ofs_eig << std::setiosflags(std::ios::showpoint); - ofs_eig << " " << klist->ik2iktot[ik] + 1 - is * nkstot_np << "/" << nkstot_np - << " kpoint (Cartesian) = " << klist->kvec_c[ik].x << " " << klist->kvec_c[ik].y - << " " << klist->kvec_c[ik].z << " (" << ngk_tot[ik] << " pws)" << std::endl; - - ofs_eig << std::setprecision(6); - ofs_eig << std::setiosflags(std::ios::showpoint); - for (int ib = 0; ib < ekb.nc; ib++) - { - ofs_eig << std::setw(8) << ib + 1 << std::setw(15) << ekb(ik, ib) * ModuleBase::Ry_to_eV - << std::setw(15) << wg(ik, ib) << std::endl; - } - ofs_eig << std::endl; - ofs_eig.close(); - } - } - } -#ifdef __MPI - MPI_Barrier(MPI_COMM_WORLD); -#endif - ofs.seekp(0, std::ios::end); - } - return; -} /// @brief function for printing eigenvalues : ekb /// @param ik: index of kpoints diff --git a/source/module_elecstate/elecstate_print.h b/source/module_elecstate/elecstate_print.h index e1ad2fb284..fcf8ec91a2 100644 --- a/source/module_elecstate/elecstate_print.h +++ b/source/module_elecstate/elecstate_print.h @@ -16,11 +16,6 @@ namespace elecstate void print_format(const std::string& name, const double& value); - void print_eigenvalue(const ModuleBase::matrix& ekb, - const ModuleBase::matrix& wg, - const K_Vectors* klist, - std::ofstream& ofs); - void print_etot(const Magnetism& magnet, const ElecState& elec, const bool converged, diff --git a/source/module_elecstate/test/elecstate_print_test.cpp b/source/module_elecstate/test/elecstate_print_test.cpp index 3f5fdf994b..196594d1f8 100644 --- a/source/module_elecstate/test/elecstate_print_test.cpp +++ b/source/module_elecstate/test/elecstate_print_test.cpp @@ -48,7 +48,6 @@ bool XC_Functional::ked_flag = false; /** * - Tested functions: * - ElecState::print_format() - * - ElecState::print_eigenvalue() */ class ElecStatePrintTest : public ::testing::Test @@ -113,50 +112,6 @@ TEST_F(ElecStatePrintTest, PrintFormat) std::remove("test.dat"); } -TEST_F(ElecStatePrintTest, PrintEigenvalueS2) -{ - PARAM.input.nspin = 2; - GlobalV::ofs_running.open("test.dat", std::ios::out); - // print eigenvalue - elecstate::print_eigenvalue(elecstate.ekb,elecstate.wg,elecstate.klist,GlobalV::ofs_running); - GlobalV::ofs_running.close(); - ifs.open("test.dat", std::ios::in); - std::string str((std::istreambuf_iterator(ifs)), std::istreambuf_iterator()); - EXPECT_THAT(str, testing::HasSubstr("STATE ENERGY(eV) AND OCCUPATIONS")); - EXPECT_THAT(str, testing::HasSubstr("NSPIN == 2")); - EXPECT_THAT(str, testing::HasSubstr("SPIN UP :")); - EXPECT_THAT(str, testing::HasSubstr("1/1 kpoint (Cartesian) = 0.10000 0.11000 0.11100 (100 pws)")); - EXPECT_THAT(str, testing::HasSubstr("1 13.6057 0.100000")); - EXPECT_THAT(str, testing::HasSubstr("2 27.2114 0.200000")); - EXPECT_THAT(str, testing::HasSubstr("SPIN DOWN :")); - EXPECT_THAT(str, testing::HasSubstr("1/1 kpoint (Cartesian) = 0.20000 0.22000 0.22200 (101 pws)")); - EXPECT_THAT(str, testing::HasSubstr("1 40.8171 0.300000")); - EXPECT_THAT(str, testing::HasSubstr("2 54.4228 0.400000")); - ifs.close(); - std::remove("test.dat"); -} - -TEST_F(ElecStatePrintTest, PrintEigenvalueS4) -{ - PARAM.input.nspin = 4; - GlobalV::ofs_running.open("test.dat", std::ios::out); - // print eigenvalue - elecstate::print_eigenvalue(elecstate.ekb,elecstate.wg,elecstate.klist,GlobalV::ofs_running); - GlobalV::ofs_running.close(); - ifs.open("test.dat", std::ios::in); - std::string str((std::istreambuf_iterator(ifs)), std::istreambuf_iterator()); - EXPECT_THAT(str, testing::HasSubstr("STATE ENERGY(eV) AND OCCUPATIONS")); - EXPECT_THAT(str, testing::HasSubstr("NSPIN == 4")); - EXPECT_THAT(str, testing::HasSubstr("1/2 kpoint (Cartesian) = 0.10000 0.11000 0.11100 (100 pws)")); - EXPECT_THAT(str, testing::HasSubstr("1 13.6057 0.100000")); - EXPECT_THAT(str, testing::HasSubstr("2 27.2114 0.200000")); - EXPECT_THAT(str, testing::HasSubstr("2/2 kpoint (Cartesian) = 0.20000 0.22000 0.22200 (101 pws)")); - EXPECT_THAT(str, testing::HasSubstr("1 40.8171 0.300000")); - EXPECT_THAT(str, testing::HasSubstr("2 54.4228 0.400000")); - ifs.close(); - std::remove("test.dat"); -} - TEST_F(ElecStatePrintTest, PrintBand) { PARAM.input.nspin = 1; @@ -179,18 +134,6 @@ TEST_F(ElecStatePrintTest, PrintBand) std::remove("test.dat"); } -TEST_F(ElecStatePrintTest, PrintEigenvalueWarning) -{ - elecstate.ekb(0, 0) = 1.0e11; - PARAM.input.nspin = 4; - GlobalV::ofs_running.open("test.dat", std::ios::out); - testing::internal::CaptureStdout(); - EXPECT_EXIT(elecstate::print_eigenvalue(elecstate.ekb,elecstate.wg,elecstate.klist,GlobalV::ofs_running), ::testing::ExitedWithCode(1), ""); - output = testing::internal::GetCapturedStdout(); - EXPECT_THAT(output, testing::HasSubstr("Eigenvalues are too large!")); - GlobalV::ofs_running.close(); - std::remove("test.dat"); -} TEST_F(ElecStatePrintTest, PrintBandWarning) { diff --git a/source/module_esolver/esolver_ks.cpp b/source/module_esolver/esolver_ks.cpp index 748ca802e7..fbb38badfb 100644 --- a/source/module_esolver/esolver_ks.cpp +++ b/source/module_esolver/esolver_ks.cpp @@ -554,66 +554,33 @@ void ESolver_KS::after_scf(UnitCell& ucell, const int istep, const bo // 3) write eigenvalues if (istep % PARAM.inp.out_interval == 0) { - elecstate::print_eigenvalue(this->pelec->ekb,this->pelec->wg,this->pelec->klist,GlobalV::ofs_running); +// elecstate::print_eigenvalue(this->pelec->ekb,this->pelec->wg,this->pelec->klist,GlobalV::ofs_running); } } template void ESolver_KS::after_all_runners(UnitCell& ucell) { + // 1) write Etot information ESolver_FP::after_all_runners(ucell); - // 1) write information - if (PARAM.inp.out_dos != 0 || PARAM.inp.out_band[0] != 0 || PARAM.inp.out_proj_band != 0) - { - GlobalV::ofs_running << "\n\n"; - GlobalV::ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" - ">>>>>>>>>>>>>>>>>>>>>>>>>" - << std::endl; - GlobalV::ofs_running << " | " - " |" - << std::endl; - GlobalV::ofs_running << " | Post-processing of data: " - " |" - << std::endl; - GlobalV::ofs_running << " | DOS (density of states) and bands will be " - "output here. |" - << std::endl; - GlobalV::ofs_running << " | If atomic orbitals are used, Mulliken " - "charge analysis can be done. |" - << std::endl; - GlobalV::ofs_running << " | Also the .bxsf file containing fermi " - "surface information can be |" - << std::endl; - GlobalV::ofs_running << " | done here. " - " |" - << std::endl; - GlobalV::ofs_running << " | " - " |" - << std::endl; - GlobalV::ofs_running << " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" - "<<<<<<<<<<<<<<<<<<<<<<<<<" - << std::endl; - GlobalV::ofs_running << "\n\n"; - } - - // 2) write information + // 2) write eigenvalue information ModuleIO::write_istate_info(this->pelec->ekb, this->pelec->wg, this->kv); - - // 3) print out band information + // 3) write band information if (PARAM.inp.out_band[0]) { const int nspin0 = (PARAM.inp.nspin == 2) ? 2 : 1; for (int is = 0; is < nspin0; is++) { std::stringstream ss2; - ss2 << PARAM.globalv.global_out_dir << "BANDS_" << is + 1 << ".dat"; - GlobalV::ofs_running << "\n Output bands in file: " << ss2.str() << std::endl; + ss2 << PARAM.globalv.global_out_dir << "eigs" << is + 1 << ".txt"; + GlobalV::ofs_running << "\n Eigenvalues for plot are saved in file: " << ss2.str() << std::endl; + const double eshift = 0.0; ModuleIO::nscf_band(is, ss2.str(), PARAM.inp.nbands, - 0.0, + eshift, PARAM.inp.out_band[1], this->pelec->ekb, this->kv); diff --git a/source/module_esolver/esolver_ks_lcao.cpp b/source/module_esolver/esolver_ks_lcao.cpp index 297a89f40e..77d3d630ac 100644 --- a/source/module_esolver/esolver_ks_lcao.cpp +++ b/source/module_esolver/esolver_ks_lcao.cpp @@ -27,8 +27,6 @@ #include "module_io/to_wannier90_lcao_in_pw.h" #include "module_io/write_HS.h" #include "module_io/write_elecstat_pot.h" -#include "module_io/write_istate_info.h" -#include "module_io/write_proj_band_lcao.h" #include "module_parameter/parameter.h" // be careful of hpp, there may be multiple definitions of functions, 20250302, mohan diff --git a/source/module_esolver/esolver_ks_lcaopw.cpp b/source/module_esolver/esolver_ks_lcaopw.cpp index bcabe7d83c..23a8f6f7d4 100644 --- a/source/module_esolver/esolver_ks_lcaopw.cpp +++ b/source/module_esolver/esolver_ks_lcaopw.cpp @@ -4,7 +4,6 @@ #include "module_io/input_conv.h" #include "module_io/nscf_band.h" #include "module_io/output_log.h" -#include "module_io/write_istate_info.h" #include diff --git a/source/module_esolver/esolver_ks_pw.cpp b/source/module_esolver/esolver_ks_pw.cpp index 5e5177d1a9..62f0d4265e 100644 --- a/source/module_esolver/esolver_ks_pw.cpp +++ b/source/module_esolver/esolver_ks_pw.cpp @@ -30,7 +30,6 @@ #include "module_io/to_wannier90_pw.h" #include "module_io/winput.h" #include "module_io/write_dos_pw.h" -#include "module_io/write_istate_info.h" #include "module_io/write_wfc_pw.h" #include "module_io/write_wfc_r.h" #include "module_parameter/parameter.h" diff --git a/source/module_esolver/esolver_sdft_pw.cpp b/source/module_esolver/esolver_sdft_pw.cpp index 706a22bd65..928d1bb052 100644 --- a/source/module_esolver/esolver_sdft_pw.cpp +++ b/source/module_esolver/esolver_sdft_pw.cpp @@ -257,16 +257,16 @@ void ESolver_SDFT_PW::cal_stress(UnitCell& ucell, ModuleBase::matrix& template void ESolver_SDFT_PW::after_all_runners(UnitCell& ucell) { - GlobalV::ofs_running << "\n\n --------------------------------------------" << std::endl; - GlobalV::ofs_running << std::setprecision(16); - GlobalV::ofs_running << " !FINAL_ETOT_IS " << this->pelec->f_en.etot * ModuleBase::Ry_to_eV << " eV" << std::endl; - GlobalV::ofs_running << " --------------------------------------------\n\n" << std::endl; - ModuleIO::write_istate_info(this->pelec->ekb, this->pelec->wg, this->kv); + // 1) write down etot and eigenvalues (for MDFT) information + ESolver_FP::after_all_runners(ucell); + // 2) release memory if (this->method_sto == 2) { stowf.clean_chiallorder(); // release lots of memories } + + // 3) write down DOS if (PARAM.inp.out_dos) { if(!std::is_same>::value || !std::is_same::value) @@ -292,7 +292,7 @@ void ESolver_SDFT_PW::after_all_runners(UnitCell& ucell) sto_dos.caldos(PARAM.inp.dos_sigma, PARAM.inp.dos_edelta_ev, PARAM.inp.npart_sto); } - // sKG cost memory, and it should be placed at the end of the program + // 4) sKG cost memory, and it should be placed at the end of the program if (PARAM.inp.cal_cond) { Sto_EleCond sto_elecond(&ucell, @@ -315,15 +315,6 @@ void ESolver_SDFT_PW::after_all_runners(UnitCell& ucell) } } -template -void ESolver_SDFT_PW::others(UnitCell& ucell, const int istep) -{ - ModuleBase::TITLE("ESolver_SDFT_PW", "others"); - - ModuleBase::WARNING_QUIT("ESolver_SDFT_PW::others", "CALCULATION type not supported"); - - return; -} // template class ESolver_SDFT_PW, base_device::DEVICE_CPU>; template class ESolver_SDFT_PW, base_device::DEVICE_CPU>; diff --git a/source/module_esolver/esolver_sdft_pw.h b/source/module_esolver/esolver_sdft_pw.h index dc284e7b21..eeb1580c96 100644 --- a/source/module_esolver/esolver_sdft_pw.h +++ b/source/module_esolver/esolver_sdft_pw.h @@ -37,8 +37,6 @@ class ESolver_SDFT_PW : public ESolver_KS_PW virtual void hamilt2rho_single(UnitCell& ucell, const int istep, const int iter, const double ethr) override; - virtual void others(UnitCell& ucell, const int istep) override; - virtual void iter_finish(UnitCell& ucell, const int istep, int& iter, bool& conv_esolver) override; virtual void after_scf(UnitCell& ucell, const int istep, const bool conv_esolver) override; diff --git a/source/module_esolver/lcao_after_scf.cpp b/source/module_esolver/lcao_after_scf.cpp index 18cef20c6d..b7829d846c 100644 --- a/source/module_esolver/lcao_after_scf.cpp +++ b/source/module_esolver/lcao_after_scf.cpp @@ -23,7 +23,6 @@ #include "module_io/to_wannier90_lcao_in_pw.h" #include "module_io/write_dmr.h" #include "module_io/write_elecstat_pot.h" -#include "module_io/write_istate_info.h" #include "module_io/write_wfc_nao.h" #include "module_io/cal_pLpR.h" #include "module_parameter/parameter.h" diff --git a/source/module_esolver/pw_others.cpp b/source/module_esolver/pw_others.cpp index 6b6fba74a3..8e2fd78c71 100644 --- a/source/module_esolver/pw_others.cpp +++ b/source/module_esolver/pw_others.cpp @@ -5,7 +5,6 @@ #include "module_io/input_conv.h" #include "module_io/nscf_band.h" #include "module_io/output_log.h" -#include "module_io/write_istate_info.h" #include diff --git a/source/module_hsolver/hsolver_pw.cpp b/source/module_hsolver/hsolver_pw.cpp index 5411b98906..ccb1ec53ef 100644 --- a/source/module_hsolver/hsolver_pw.cpp +++ b/source/module_hsolver/hsolver_pw.cpp @@ -123,9 +123,9 @@ void HSolverPW::solve(hamilt::Hamilt* pHamilt, if (skip_charge) { - GlobalV::ofs_running << "Average iterative diagonalization steps for k-points " << ik - << " is: " << DiagoIterAssist::avg_iter - << " ; where current threshold is: " << this->diag_thr << " . " << std::endl; + GlobalV::ofs_running << " k(" << ik+1 << "/" << pes->klist->get_nkstot() + << ") Iter steps (avg)=" << DiagoIterAssist::avg_iter + << " threshold=" << this->diag_thr << std::endl; DiagoIterAssist::avg_iter = 0.0; } /// calculate the contribution of Psi for charge density rho @@ -134,10 +134,8 @@ void HSolverPW::solve(hamilt::Hamilt* pHamilt, // copy eigenvalues to ekb in ElecState base_device::memory::cast_memory_op()( - // pes->ekb.c, out_eigenvalues, eigenvalues.data(), - // pes->ekb.nr * pes->ekb.nc this->wfc_basis->nks * psi.get_nbands()); auto _pes_pw = reinterpret_cast*>(pes); @@ -148,6 +146,7 @@ void HSolverPW::solve(hamilt::Hamilt* pHamilt, _pes_pw->f_en, _pes_pw->nelec_spin, _pes_pw->skip_weights); + elecstate::calEBand(_pes_pw->ekb,_pes_pw->wg,_pes_pw->f_en); if (skip_charge) { @@ -155,16 +154,14 @@ void HSolverPW::solve(hamilt::Hamilt* pHamilt, { reinterpret_cast*>(pes)->cal_becsum(psi); } - ModuleBase::timer::tick("HSolverPW", "solve"); - return; } else { reinterpret_cast*>(pes)->psiToRho(psi); - - ModuleBase::timer::tick("HSolverPW", "solve"); - return; } + + ModuleBase::timer::tick("HSolverPW", "solve"); + return; } template diff --git a/source/module_io/nscf_band.cpp b/source/module_io/nscf_band.cpp index c59ffbe5df..e824b4ce84 100644 --- a/source/module_io/nscf_band.cpp +++ b/source/module_io/nscf_band.cpp @@ -21,6 +21,19 @@ void ModuleIO::nscf_band( ModuleBase::TITLE("ModuleIO","nscf_band"); ModuleBase::timer::tick("ModuleIO", "nscf_band"); + GlobalV::ofs_running << "\n"; + GlobalV::ofs_running << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" + ">>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl; + GlobalV::ofs_running << " | " + " |" << std::endl; + GlobalV::ofs_running << " | Print out the eigenvalues. " + " |" << std::endl; + GlobalV::ofs_running << " | " + " |" << std::endl; + GlobalV::ofs_running << " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" + "<<<<<<<<<<<<<<<<<<<<<<<<<" << std::endl; + GlobalV::ofs_running << "\n"; + // number of k points without spin; // nspin = 1,2, nkstot = nkstot_np * nspin; // nspin = 4, nkstot = nkstot_np @@ -33,6 +46,7 @@ void ModuleIO::nscf_band( std::ofstream ofs(out_band_dir.c_str());//make the file clear!! ofs.close(); } + MPI_Barrier(MPI_COMM_WORLD); std::vector klength; klength.resize(nkstot_np); @@ -48,12 +62,12 @@ void ModuleIO::nscf_band( klength[ik] = klength[ik-1]; klength[ik] += (kv.kl_segids[ik] == kv.kl_segids[ik-1]) ? delta.norm() : 0.0; } - /* first find if present kpoint in present pool */ + //! first find if present kpoint in present pool if ( GlobalV::MY_POOL == kv.para_k.whichpool[ik] ) { - /* then get the local kpoint index, which starts definitly from 0 */ + //! then get the local kpoint index, which starts definitly from 0 const int ik_now = ik - kv.para_k.startk_pool[GlobalV::MY_POOL]; - /* if present kpoint corresponds the spin of the present one */ + //! if present kpoint corresponds the spin of the present one assert( kv.isk[ik_now+is*nks_np] == is ); if ( GlobalV::RANK_IN_POOL == 0) { diff --git a/source/module_io/read_wf2rho_pw.cpp b/source/module_io/read_wf2rho_pw.cpp index e6611fb271..c132d26fd6 100644 --- a/source/module_io/read_wf2rho_pw.cpp +++ b/source/module_io/read_wf2rho_pw.cpp @@ -65,7 +65,7 @@ void ModuleIO::read_wf2rho_pw( ModuleBase::matrix wg_tmp(nkstot, nbands); if (my_rank == 0) { - std::string filename = readin_dir + "istate.info"; + std::string filename = readin_dir + "eig.txt"; std::ifstream ifs(filename); if(!ifs) @@ -79,33 +79,19 @@ void ModuleIO::read_wf2rho_pw( ofs_running << " Find file containing weights of wave function: " << filename << std::endl; } - std::string useless; - if (nspin == 2) - { - const int nkstot_np = nkstot / 2; - for (int iktot_np = 0; iktot_np < nkstot_np; ++iktot_np) - { - ifs >> useless; - getline(ifs, useless); - for (int ib = 0; ib < nbands; ++ib) - { - ifs >> useless >> useless >> wg_tmp(iktot_np, ib) >> useless >> wg_tmp(iktot_np + nkstot_np, ib); - } - } - } - else - { - for (int ik_tot = 0; ik_tot < nkstot; ++ik_tot) - { - ifs >> useless; - getline(ifs, useless); - for (int ib = 0; ib < nbands; ++ib) - { - ifs >> useless >> useless >> wg_tmp(ik_tot, ib); - } - } - } - } + std::string useless; + getline(ifs, useless); + getline(ifs, useless); + for (int ik_tot = 0; ik_tot < nkstot; ++ik_tot) + { + ifs >> useless; + getline(ifs, useless); + for (int ib = 0; ib < nbands; ++ib) + { + ifs >> useless >> useless >> wg_tmp(ik_tot, ib); + } + } + } #ifdef __MPI MPI_Bcast(wg_tmp.c, nkstot * nbands, MPI_DOUBLE, 0, MPI_COMM_WORLD); diff --git a/source/module_io/test/read_wf2rho_pw_test.cpp b/source/module_io/test/read_wf2rho_pw_test.cpp index 0d3ec5dede..e8e0214236 100644 --- a/source/module_io/test/read_wf2rho_pw_test.cpp +++ b/source/module_io/test/read_wf2rho_pw_test.cpp @@ -186,14 +186,30 @@ TEST_F(ReadWfcRhoTest, ReadWfcRho) wg.fill_out(1.0); if (GlobalV::MY_RANK == 0) { - std::ofstream ofs("istate.info"); + // mohan update 2025-06-02 + std::ofstream ofs("eig.txt"); + ofs << " Electronic state energy (eV) and occupations" << std::endl; + ofs << " Spin number " << nspin << std::endl; + ofs << std::setprecision(8); + ofs << std::setiosflags(std::ios::showpoint); + + const int is = 0; // nspin is 1 for (int ik = 0; ik < nkstot; ++ik) - { - ofs << "BAND Energy(ev) Occupation Kpoint" << std::endl; - for (int ib = 0; ib < nbands; ++ib) - { - ofs << " " << ib + 1 << " 0.0000000 " << 1.0 << std::endl; - } + { + ofs << " spin=" << is+1 << " k-point=" + << ik + 1 << "/" << nkstot + << " Cartesian=" << kv->kvec_c[ik].x << " " << kv->kvec_c[ik].y + << " " << kv->kvec_c[ik].z << " (" << kv->ngk[ik] << " plane wave)" << std::endl; + + ofs << std::setprecision(16); + ofs << std::setiosflags(std::ios::showpoint); + + double ekb = -1.23456; // energy + for (int ib = 0; ib < nbands; ib++) + { + ofs << " " << ib + 1 << " " << ekb << " " << wg(ik,ib) << std::endl; + } + ofs << std::endl; } ofs.close(); @@ -313,7 +329,7 @@ TEST_F(ReadWfcRhoTest, ReadWfcRho) if (GlobalV::MY_RANK == 0) { remove("running_log0.txt"); - remove("istate.info"); + remove("eig.txt"); remove("wfs1k1_pw.dat"); remove("wfs1k2_pw.dat"); if (GlobalV::KPAR == 2) diff --git a/source/module_io/test/write_istate_info_test.cpp b/source/module_io/test/write_istate_info_test.cpp index 9e95d17fa4..e17fb2c72e 100644 --- a/source/module_io/test/write_istate_info_test.cpp +++ b/source/module_io/test/write_istate_info_test.cpp @@ -43,13 +43,14 @@ class IstateInfoTest : public ::testing::Test TEST_F(IstateInfoTest, OutIstateInfoS1) { - // preconditions + // Global variables GlobalV::KPAR = 1; PARAM.input.nbands = 4; PARAM.sys.nbands_l = 4; PARAM.input.nspin = 1; PARAM.sys.global_out_dir = "./"; - // mpi setting + + // MPI setting Parallel_Global::init_pools(GlobalV::NPROC, GlobalV::MY_RANK, PARAM.input.bndpar, @@ -60,90 +61,54 @@ TEST_F(IstateInfoTest, OutIstateInfoS1) GlobalV::NPROC_IN_POOL, GlobalV::RANK_IN_POOL, GlobalV::MY_POOL); - kv->set_nkstot(100); + + const int nkstot_init = 10; + kv->set_nkstot(nkstot_init); int nkstot = kv->get_nkstot(); - kv->para_k.kinfo(nkstot, GlobalV::KPAR, GlobalV::MY_POOL, GlobalV::RANK_IN_POOL, GlobalV::NPROC_IN_POOL, PARAM.input.nspin); - // std::cout<<"my_rank "<para_k.kinfo(nkstot, GlobalV::KPAR, GlobalV::MY_POOL, GlobalV::RANK_IN_POOL, + GlobalV::NPROC_IN_POOL, PARAM.input.nspin); kv->set_nks(kv->para_k.nks_pool[GlobalV::MY_POOL]); - // std::cout<<"nks "<get_nks()<get_nks(), PARAM.input.nbands); - wg.create(kv->get_nks(), PARAM.input.nbands); - ekb.fill_out(0.15); - wg.fill_out(0.0); - kv->kvec_d.resize(kv->get_nkstot()); - int i = 0; - for (auto& kd: kv->kvec_d) + + // The number of plane waves for each k point + kv->ngk.resize(nkstot); + kv->ik2iktot.resize(nkstot); + for(int i=0; ingk[i]=299; + kv->ik2iktot[i]=i; } - ModuleIO::write_istate_info(ekb, wg, *kv); - std::ifstream ifs; - ifs.open("istate.info"); - std::string str((std::istreambuf_iterator(ifs)), std::istreambuf_iterator()); - EXPECT_THAT( - str, - testing::HasSubstr("BAND Energy(ev) Occupation Kpoint = 100")); - EXPECT_THAT(str, testing::HasSubstr("(0.99 0.99 0.99)")); - EXPECT_THAT(str, testing::HasSubstr("4 2.0408547 0")); - ifs.close(); - remove("istate.info"); -} -TEST_F(IstateInfoTest, OutIstateInfoS2) -{ - // preconditions - GlobalV::KPAR = 1; - PARAM.input.nbands = 4; - PARAM.sys.nbands_l = 4; - PARAM.input.nspin = 2; - PARAM.sys.global_out_dir = "./"; - // mpi setting - Parallel_Global::init_pools(GlobalV::NPROC, - GlobalV::MY_RANK, - PARAM.input.bndpar, - GlobalV::KPAR, - GlobalV::NPROC_IN_BNDGROUP, - GlobalV::RANK_IN_BPGROUP, - GlobalV::MY_BNDGROUP, - GlobalV::NPROC_IN_POOL, - GlobalV::RANK_IN_POOL, - GlobalV::MY_POOL); - kv->set_nkstot(100); - int nkstot = kv->get_nkstot(); - kv->para_k.kinfo(nkstot, GlobalV::KPAR, GlobalV::MY_POOL, GlobalV::RANK_IN_POOL, GlobalV::NPROC_IN_POOL, PARAM.input.nspin); - // std::cout<<"my_rank "<set_nks(kv->para_k.nks_pool[GlobalV::MY_POOL]); - // std::cout<<"nks "<get_nks()<get_nks(), PARAM.input.nbands); wg.create(kv->get_nks(), PARAM.input.nbands); + + // fill the eigenvalues ekb.fill_out(0.15); + + // fill the weights wg.fill_out(0.0); - kv->kvec_d.resize(kv->get_nkstot()); + + // setup coordinates of k-points + kv->kvec_c.resize(kv->get_nkstot()); int i = 0; - for (auto& kd: kv->kvec_d) + for (auto& kd: kv->kvec_c) { kd.set(0.01 * i, 0.01 * i, 0.01 * i); ++i; } + + // write eigenvalues and occupations ModuleIO::write_istate_info(ekb, wg, *kv); + + // check the output files std::ifstream ifs; - ifs.open("istate.info"); + ifs.open("eig.txt"); std::string str((std::istreambuf_iterator(ifs)), std::istreambuf_iterator()); - EXPECT_THAT(str, - testing::HasSubstr("BAND Spin up Energy(ev) Occupation Spin down Energy(ev) " - " Occupation Kpoint = 50")); - EXPECT_THAT( - str, - testing::HasSubstr( - "4 2.04085 0 2.04085 0")); - EXPECT_THAT(str, testing::HasSubstr("(0.49 0.49 0.49)")); + EXPECT_THAT(str, testing::HasSubstr("Electronic state energy (eV) and occupations")); + EXPECT_THAT(str, testing::HasSubstr("spin=1 k-point=1/10 Cartesian=0.0000000 0.0000000 0.0000000 (299 plane wave)")); + EXPECT_THAT(str, testing::HasSubstr("1 2.040854700000000 0.000000000000000")); ifs.close(); - remove("istate.info"); + remove("eig.txt"); } #ifdef __MPI diff --git a/source/module_io/write_istate_info.cpp b/source/module_io/write_istate_info.cpp index 7316fa468c..d6894066ee 100644 --- a/source/module_io/write_istate_info.cpp +++ b/source/module_io/write_istate_info.cpp @@ -4,6 +4,7 @@ #include "module_base/global_function.h" #include "module_base/global_variable.h" #include "module_base/timer.h" +#include "module_base/parallel_comm.h" // use POOL_WORLD #ifdef __MPI #include // use MPI_Barrier @@ -14,81 +15,99 @@ void ModuleIO::write_istate_info(const ModuleBase::matrix &ekb,const ModuleBase: ModuleBase::TITLE("ModuleIO","write_istate_info"); ModuleBase::timer::tick("ModuleIO", "write_istate_info"); - std::stringstream ss; - ss << PARAM.globalv.global_out_dir << "istate.info"; + const int nspin = PARAM.inp.nspin; + const int nks = kv.get_nks(); + const int nkstot = kv.get_nkstot(); + + bool wrong = false; + + for (int ik = 0; ik < nks; ++ik) + { + for (int ib = 0; ib < ekb.nc; ++ib) + { + if (std::abs(ekb(ik, ib)) > 1.0e10) + { + GlobalV::ofs_warning << " ik=" << ik + 1 << " ib=" << ib + 1 + << " " << ekb(ik, ib) << " Ry" << std::endl; + wrong = true; + } + } + } + +#ifdef __MPI + MPI_Allreduce(MPI_IN_PLACE, &wrong, 1, MPI_C_BOOL, MPI_LOR, MPI_COMM_WORLD); +#endif + if (wrong) + { + ModuleBase::WARNING_QUIT("ModuleIO::write_istate_info", "Eigenvalues are too large!"); + } + + std::vector ngk_tot = kv.ngk; + +#ifdef __MPI + MPI_Allreduce(MPI_IN_PLACE, ngk_tot.data(), nks, MPI_INT, MPI_SUM, POOL_WORLD); +#endif + + // file name to store eigenvalues + std::string filename = PARAM.globalv.global_out_dir + "eig.txt"; + GlobalV::ofs_running << " The eigenvalues and occupations are in file: " << filename << std::endl; + if (GlobalV::MY_RANK == 0) { - std::ofstream ofsi(ss.str().c_str()); // clear istate.info - ofsi.close(); + std::ofstream ofs_eig0(filename.c_str()); // clear eig.txt + ofs_eig0 << " Electronic state energy (eV) and occupations" << std::endl; + ofs_eig0 << " Spin number " << nspin << std::endl; + ofs_eig0.close(); } - for (int ip = 0; ip < GlobalV::KPAR; ip++) + const int nk_fac = nspin == 2 ? 2 : 1; + const int nks_np = nks / nk_fac; + const int nkstot_np = nkstot / nk_fac; + const int kpar = GlobalV::KPAR; + + for (int is = 0; is < nk_fac; ++is) { -#ifdef __MPI - MPI_Barrier(MPI_COMM_WORLD); - if (GlobalV::MY_POOL == ip) + for (int ip = 0; ip < kpar; ++ip) { - if (GlobalV::RANK_IN_POOL != 0 || GlobalV::MY_BNDGROUP != 0 ) - { - continue; - } -#endif - std::ofstream ofsi2(ss.str().c_str(), std::ios::app); - if (PARAM.inp.nspin == 1 || PARAM.inp.nspin == 4) - { - for (int ik = 0; ik < kv.get_nks(); ik++) - { #ifdef __MPI - int ik_global = kv.para_k.startk_pool[ip] + ik + 1; -#else - int ik_global = ik + 1; + MPI_Barrier(MPI_COMM_WORLD); #endif - ofsi2 << "BAND" << std::setw(25) << "Energy(ev)" << std::setw(25) << "Occupation" - << std::setw(25) << "Kpoint = " << ik_global - << std::setw(25) << "(" << kv.kvec_d[ik].x << " " << kv.kvec_d[ik].y - << " " << kv.kvec_d[ik].z << ")" << std::endl; - for (int ib = 0; ib < PARAM.globalv.nbands_l; ib++) - { - ofsi2.precision(16); - ofsi2 << std::setw(6) << ib + 1 << std::setw(25) - << ekb(ik, ib) * ModuleBase::Ry_to_eV << std::setw(25) << wg(ik, ib) - << std::endl; - } - ofsi2 << std::endl; - ofsi2 << std::endl; - } - } - else + + bool ip_flag = PARAM.inp.out_alllog || (GlobalV::RANK_IN_POOL == 0 && GlobalV::MY_BNDGROUP == 0); + + if (GlobalV::MY_POOL == ip && ip_flag) { - for (int ik = 0; ik < kv.get_nks() / 2; ik++) + std::ofstream ofs_eig(filename.c_str(), std::ios::app); + ofs_eig << std::setprecision(8); + ofs_eig << std::setiosflags(std::ios::showpoint); + + const int start_ik = nks_np * is; + const int end_ik = nks_np * (is + 1); + for (int ik = start_ik; ik < end_ik; ++ik) { -#ifdef __MPI - int ik_global = kv.para_k.startk_pool[ip] + ik + 1; -#else - int ik_global = ik + 1; -#endif - ofsi2 << "BAND" << std::setw(25) << "Spin up Energy(ev)" << std::setw(25) << "Occupation" - << std::setw(25) << "Spin down Energy(ev)" << std::setw(25) << "Occupation" - << std::setw(25) << "Kpoint = " << ik_global - << std::setw(25) << "(" << kv.kvec_d[ik].x << " " << kv.kvec_d[ik].y - << " " << kv.kvec_d[ik].z << ")" << std::endl; + ofs_eig << " spin=" << is+1 << " k-point=" + << kv.ik2iktot[ik] + 1 - is * nkstot_np << "/" << nkstot_np + << " Cartesian=" << kv.kvec_c[ik].x << " " << kv.kvec_c[ik].y + << " " << kv.kvec_c[ik].z << " (" << ngk_tot[ik] << " plane wave)" << std::endl; - for (int ib = 0; ib < PARAM.inp.nbands; ib++) + ofs_eig << std::setprecision(16); + ofs_eig << std::setiosflags(std::ios::showpoint); + for (int ib = 0; ib < ekb.nc; ib++) { - ofsi2 << std::setw(6) << ib + 1 << std::setw(25) - << ekb(ik, ib) * ModuleBase::Ry_to_eV << std::setw(25) << wg(ik, ib) - << std::setw(25) << ekb((ik + kv.get_nks() / 2), ib) * ModuleBase::Ry_to_eV - << std::setw(25) << wg(ik + kv.get_nks() / 2, ib) << std::endl; + ofs_eig << " " << ib + 1 << " " << ekb(ik, ib) * ModuleBase::Ry_to_eV + << " " << wg(ik, ib) << std::endl; } - ofsi2 << std::endl; - ofsi2 << std::endl; + ofs_eig << std::endl; } + + ofs_eig.close(); } - ofsi2.close(); -#ifdef __MPI } +#ifdef __MPI + MPI_Barrier(MPI_COMM_WORLD); #endif } + ModuleBase::timer::tick("ModuleIO", "write_istate_info"); return; } diff --git a/tests/01_PW/051_PW_OBOD_MemSaver/refBANDS_1.dat b/tests/01_PW/051_PW_OBOD_MemSaver/eigs1.txt.ref similarity index 100% rename from tests/01_PW/051_PW_OBOD_MemSaver/refBANDS_1.dat rename to tests/01_PW/051_PW_OBOD_MemSaver/eigs1.txt.ref diff --git a/tests/01_PW/052_PW_OB/refBANDS_1.dat b/tests/01_PW/052_PW_OB/eigs1.txt.ref similarity index 100% rename from tests/01_PW/052_PW_OB/refBANDS_1.dat rename to tests/01_PW/052_PW_OB/eigs1.txt.ref diff --git a/tests/01_PW/057_PW_SO_IW/eig.txt b/tests/01_PW/057_PW_SO_IW/eig.txt new file mode 100644 index 0000000000..697d882e61 --- /dev/null +++ b/tests/01_PW/057_PW_SO_IW/eig.txt @@ -0,0 +1,42 @@ + Electronic state energy (eV) and occupations + Spin number 4 + spin=1 k-point=1/1 Cartesian=0.0000000 0.0000000 0.0000000 (459 plane wave) + 1 -5.80225222622 1.00000000000 + 2 -4.86534434633 1.00000000000 + 3 -1.35559361415 1.00000000000 + 4 -1.28770881944 1.00000000000 + 5 -1.20706060019 1.00000000000 + 6 -0.832239230496 1.00000000000 + 7 -0.745307723916 1.00000000000 + 8 -0.697268567366 1.00000000000 + 9 -0.112301628562 1.00000000000 + 10 0.123623125781 1.00000000000 + 11 0.341813744923 1.00000000000 + 12 0.428354671894 1.00000000000 + 13 5.04091981334 1.00000000000 + 14 5.77892613770 1.00000000000 + 15 7.80569592791 1.00000000000 + 16 7.87725397013 1.00000000000 + 17 8.15442595699 1.00000000000 + 18 8.89322368722 1.00000000000 + 19 9.11964038392 0.00000000000 + 20 9.19552421755 0.00000000000 + 21 10.5213838032 0.00000000000 + 22 10.6320182260 0.00000000000 + 23 10.8531271179 0.00000000000 + 24 11.3477901066 0.00000000000 + 25 11.5256948470 0.00000000000 + 26 11.6581831328 0.00000000000 + 27 14.3648470428 0.00000000000 + 28 14.6499211384 0.00000000000 + 29 20.2108680938 0.00000000000 + 30 20.2320077701 0.00000000000 + 31 20.2362409803 0.00000000000 + 32 20.3432622143 0.00000000000 + 33 20.4942834293 0.00000000000 + 34 20.6081562024 0.00000000000 + 35 20.6542582936 0.00000000000 + 36 20.6743662012 0.00000000000 + 37 21.2186717697 0.00000000000 + 38 21.4338476449 0.00000000000 + diff --git a/tests/01_PW/057_PW_SO_IW/istate.info b/tests/01_PW/057_PW_SO_IW/istate.info deleted file mode 100644 index 19f81a7f10..0000000000 --- a/tests/01_PW/057_PW_SO_IW/istate.info +++ /dev/null @@ -1,41 +0,0 @@ -BAND Energy(ev) Occupation Kpoint = 1 (0 0 0) - 1 -5.803263354735877 1 - 2 -4.866061381925486 1 - 3 -1.359289336627868 1 - 4 -1.291335226565177 1 - 5 -1.210467148364243 1 - 6 -0.835724683428713 1 - 7 -0.7487598034766753 1 - 8 -0.7006064755786422 1 - 9 -0.1159407379615029 1 - 10 0.1202752942058206 1 - 11 0.3379864351497489 1 - 12 0.42475093966947 1 - 13 5.03913292971009 1 - 14 5.777091867159064 1 - 15 7.804249418022549 1 - 16 7.875810965994963 1 - 17 8.15305132930491 1 - 18 8.892183044618475 1 - 19 9.118640257671171 0 - 20 9.194376411776567 0 - 21 10.52053980690489 0 - 22 10.63124418435923 0 - 23 10.85237946040846 0 - 24 11.34745313536697 0 - 25 11.52540297156072 0 - 26 11.65802813524961 0 - 27 14.3643931732005 0 - 28 14.64648815353438 0 - 29 20.21048953868734 0 - 30 20.23168597745261 0 - 31 20.23594172430127 0 - 32 20.34318034125117 0 - 33 20.49433237237518 0 - 34 20.60686492006229 0 - 35 20.65290020434089 0 - 36 20.67304188342674 0 - 37 21.21963361965688 0 - 38 21.43507306548812 0 - - diff --git a/tests/03_NAO_multik/15_NO_KP_OB/refBANDS_1.dat b/tests/03_NAO_multik/15_NO_KP_OB/eigs1.txt.ref similarity index 100% rename from tests/03_NAO_multik/15_NO_KP_OB/refBANDS_1.dat rename to tests/03_NAO_multik/15_NO_KP_OB/eigs1.txt.ref diff --git a/tests/integrate/tools/catch_properties.sh b/tests/integrate/tools/catch_properties.sh index bc7f7a7bb9..b4e2913b58 100755 --- a/tests/integrate/tools/catch_properties.sh +++ b/tests/integrate/tools/catch_properties.sh @@ -247,8 +247,8 @@ fi # echo $has_band #------------------------------- if ! test -z "$has_band" && [ $has_band == 1 ]; then - bandref=refBANDS_1.dat - bandcal=OUT.autotest/BANDS_1.dat + bandref=eigs1.txt.ref + bandcal=OUT.autotest/eigs1.txt python3 $COMPARE_SCRIPT $bandref $bandcal 8 echo "CompareBand_pass $?" >>$1 fi