Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: add the output of E_KS(sigma->0) #2571

Merged
merged 32 commits into from
Jun 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
bc37c2b
add docs of ShengBTE
Chentao168 May 9, 2023
4f65dea
Merge branch 'deepmodeling:develop' into develop
Chentao168 May 10, 2023
0de0f93
Merge branch 'deepmodeling:develop' into develop
Chentao168 May 15, 2023
4418002
Update
Chentao168 May 15, 2023
abe16ca
Merge branch 'deepmodeling:develop' into develop
Chentao168 May 25, 2023
b144ae1
update doc of tddft
Chentao168 May 25, 2023
f1b1e64
update doc of tddft
Chentao168 May 25, 2023
19a084f
update ShengBTE
Chentao168 May 26, 2023
9811fec
update tddft
Chentao168 May 26, 2023
43a8aaf
Merge branch 'develop'
Chentao168 May 26, 2023
28b18bd
update td
Chentao168 May 26, 2023
dca4b3a
rename E_demet
Chentao168 May 26, 2023
f0f1ea9
Merge
Chentao168 May 26, 2023
a1fdcea
Merge branch 'develop' into develop
Qianruipku May 26, 2023
cc1ee4f
Merge branch 'develop' into develop
Qianruipku May 26, 2023
936ff84
Merge branches 'develop'
Chentao168 May 29, 2023
bc59e8d
merge
Chentao168 May 29, 2023
ae79e9d
Merge branch 'deepmodeling:develop' into develop
Chentao168 May 30, 2023
369543d
Merge branch 'deepmodeling:develop' into develop
Chentao168 May 31, 2023
5cddeb0
add output fo E_KS(sigma->0)
Chentao168 May 31, 2023
89e4440
add test
Chentao168 May 31, 2023
e993312
Merge branch 'develop' into develop
Chentao168 May 31, 2023
792b82a
add test for " entropy(-TS)="
Chentao168 May 31, 2023
2e94e6d
Merge branch 'develop' into develop
Chentao168 May 31, 2023
5a87daa
Merge branch 'develop' into develop
Chentao168 Jun 1, 2023
4e8a5a8
update entro(-TS)
Chentao168 Jun 1, 2023
8ed9eb2
Merge branch 'develop' into develop
Chentao168 Jun 1, 2023
0a9f524
Merge branch 'develop' into develop
Chentao168 Jun 2, 2023
4913af7
change setw(12) to setw(16)
Chentao168 Jun 2, 2023
e6d68db
rename E_demet
Chentao168 Jun 2, 2023
5caac73
update setw of Energy
Chentao168 Jun 3, 2023
bb82138
Merge branch 'develop' into develop
Chentao168 Jun 4, 2023
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
2 changes: 1 addition & 1 deletion examples/compensating_charge/Pt-slab/running_scf.ref
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ Adding potential to prevent interaction between lower and upper part of unit cel
E_Hartree +35359.0518925 +481084.581615
E_xc -634.577232217 -8633.86617922
E_Ewald +29678.9985233 +403803.49085
E_entropy (-TS) -0.0892771920843 -1.21467851379
E_entropy(-TS) -0.0892771920843 -1.21467851379
E_descf +0 +0
E_exx +0 +0
E_gatefield -82.1196854771 -1117.29564046
Expand Down
2 changes: 1 addition & 1 deletion examples/dipole_correction/Pt-slab/running_scf.ref1
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@
E_Hartree +35397.5519375 +481608.401602
E_xc -634.356374811 -8630.86126006
E_Ewald +29678.9985233 +403803.49085
E_entropy (-TS) -0.0749559760553 -1.0198283735
E_entropy(-TS) -0.0749559760553 -1.0198283735
E_descf +0 +0
E_efield +0.000187211029487 +0.00254713672947
E_exx +0 +0
Expand Down
2 changes: 1 addition & 1 deletion examples/dipole_correction/Pt-slab/running_scf.ref2
Original file line number Diff line number Diff line change
Expand Up @@ -1680,7 +1680,7 @@
E_Hartree +35398.4908392 +481621.176014
E_xc -634.363096169 -8630.95270882
E_Ewald +29678.9985233 +403803.49085
E_entropy (-TS) -0.0749163320998 -1.01928898982
E_entropy(-TS) -0.0749163320998 -1.01928898982
E_descf +0 +0
E_efield -0.00629112673183 -0.085595170393
E_exx +0 +0
Expand Down
2 changes: 1 addition & 1 deletion examples/electric_field/Pt-slab/running_scf.ref
Original file line number Diff line number Diff line change
Expand Up @@ -726,7 +726,7 @@
E_Hartree +35398.6450101 +481623.273616
E_xc -634.364166778 -8630.9672752
E_Ewald +29678.9985233 +403803.49085
E_entropy (-TS) -0.0749083107075 -1.01917985318
E_entropy(-TS) -0.0749083107075 -1.01917985318
E_descf +0 +0
E_efield +65.8831689157 +896.38649955
E_exx +0 +0
Expand Down
27 changes: 14 additions & 13 deletions examples/hse/lcao_Si2/running_scf.log_ref
Original file line number Diff line number Diff line change
Expand Up @@ -1939,7 +1939,7 @@
E_Hartree +1.10667694662 +15.0571123192
E_xc -4.82858433413 -65.6962602177
E_Ewald -16.8399168386 -229.118822851
E_entropy (-TS) -6.20958974012e-08 -8.4485802708e-07
E_entropy(-TS) -6.20958974012e-08 -8.4485802708e-07
E_descf +0 +0
E_exx +0 +0
E_Fermi +0.499839538991 +6.80066581597
Expand Down Expand Up @@ -2037,7 +2037,7 @@
E_Hartree +1.11795346903 +15.2105372776
E_xc -4.00712646646 -54.5197525505
E_Ewald -16.8399168386 -229.118822851
E_entropy (-TS) -2.26876585152e-13 -3.08681430085e-12
E_entropy(-TS) -2.26876585152e-13 -3.08681430085e-12
E_descf +0 +0
E_exx -0.825392419557 -11.230039992
E_Fermi +0.494769863971 +6.73168934869
Expand Down Expand Up @@ -2099,7 +2099,7 @@
E_Hartree +1.12051836301 +15.2454344506
E_xc -4.00793074663 -54.5306953436
E_Ewald -16.8399168386 -229.118822851
E_entropy (-TS) -4.77655097026e-14 -6.4988309983e-13
E_entropy(-TS) -4.77655097026e-14 -6.4988309983e-13
E_descf +0 +0
E_exx -0.829154349922 -11.2812236804
E_Fermi +0.494847349764 +6.73274359699
Expand Down Expand Up @@ -2152,7 +2152,7 @@
E_Hartree +1.12092731947 +15.2509985887
E_xc -4.00805852837 -54.5324339033
E_Ewald -16.8399168386 -229.118822851
E_entropy (-TS) -3.88585201082e-14 -5.2869728932e-13
E_entropy(-TS) -3.88585201082e-14 -5.2869728932e-13
E_descf +0 +0
E_exx -0.829702282533 -11.2886786861
E_Fermi +0.494856784126 +6.73287195807
Expand Down Expand Up @@ -2196,7 +2196,7 @@
E_Hartree +1.12098787539 +15.2518224942
E_xc -4.00807743723 -54.5326911715
E_Ewald -16.8399168386 -229.118822851
E_entropy (-TS) -3.77974044302e-14 -5.14260069861e-13
E_entropy(-TS) -3.77974044302e-14 -5.14260069861e-13
E_descf +0 +0
E_exx -0.829780785696 -11.2897467764
E_Fermi +0.494858510961 +6.73289545286
Expand Down Expand Up @@ -2240,7 +2240,7 @@
E_Hartree +1.12099658868 +15.2519410446
E_xc -4.00808015437 -54.5327281401
E_Ewald -16.8399168386 -229.118822851
E_entropy (-TS) -3.76545077609e-14 -5.12315860933e-13
E_entropy(-TS) -3.76545077609e-14 -5.12315860933e-13
E_descf +0 +0
E_exx -0.829791879854 -11.2898977202
E_Fermi +0.494858741556 +6.73289859027
Expand Down Expand Up @@ -2284,7 +2284,7 @@
E_Hartree +1.12099782749 +15.2519578995
E_xc -4.00808054048 -54.5327333934
E_Ewald -16.8399168386 -229.118822851
E_entropy (-TS) -3.76346748752e-14 -5.12046020681e-13
E_entropy(-TS) -3.76346748752e-14 -5.12046020681e-13
E_descf +0 +0
E_exx -0.829793443389 -11.2899189931
E_Fermi +0.494858776068 +6.73289905984
Expand Down Expand Up @@ -2319,7 +2319,7 @@
E_Hartree +1.12099800111 +15.2519602617
E_xc -4.00808059457 -54.5327341294
E_Ewald -16.8399168386 -229.118822851
E_entropy (-TS) -3.76319136851e-14 -5.12008452762e-13
E_entropy(-TS) -3.76319136851e-14 -5.12008452762e-13
E_descf +0 +0
E_exx -0.829793663087 -11.2899219823
E_Fermi +0.494858781529 +6.73289913413
Expand All @@ -2345,7 +2345,7 @@
E_Hartree +1.12099803045 +15.2519606609
E_xc -4.00808060369 -54.5327342535
E_Ewald -16.8399168386 -229.118822851
E_entropy (-TS) -3.76314880624e-14 -5.12002661868e-13
E_entropy(-TS) -3.76314880624e-14 -5.12002661868e-13
E_descf +0 +0
E_exx -0.829793693763 -11.2899223996
E_Fermi +0.494858780652 +6.7328991222
Expand All @@ -2362,10 +2362,11 @@
E_Hartree +1.12099803109 +15.2519606696
E_xc -4.0080806039 -54.5327342564
E_Ewald -16.8399168386 -229.118822851
E_entropy (-TS) -3.76314560219e-14 -5.12002225935e-13
E_descf +0 +0
E_exx -0.829793698689 -11.2899224667
E_Fermi +0.494858781849 +6.73289913849
E_entropy(-TS) -4.01309875949e-14 -5.46010097658e-13
E_descf +0.00000000000 +0.00000000000
E_efield +0.00000000000 +0.00000000000
E_exx -0.829833792770 -11.2904679746
E_Fermi +0.494804756627 +6.73216408763

charge density convergence is achieved
final etot is -214.064897898 eV
Expand Down
9 changes: 6 additions & 3 deletions source/module_elecstate/elecstate_print.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "elecstate.h"
#include "occupy.h"
#include "elecstate_getters.h"
#include "module_base/global_variable.h"
#include "module_elecstate/potentials/H_Hartree_pw.h"
Expand Down Expand Up @@ -173,16 +174,18 @@ void ElecState::print_etot(const bool converged,

if (printe > 0 && ((iter + 1) % printe == 0 || converged || iter == GlobalV::SCF_NMAX))
{
GlobalV::ofs_running << "\n " << std::setw(12) << "Energy" << std::setw(30) << "Rydberg" << std::setw(30)
int n_order = std::max(0, Occupy::gaussian_type);
GlobalV::ofs_running << "\n " << std::setw(16) << "Energy" << std::setw(30) << "Rydberg" << std::setw(30)
<< "eV" << std::endl;
this->print_format("E_KohnSham", this->f_en.etot);
this->print_format("E_KS(sigma->0)", this->f_en.etot - this->f_en.demet/(2+n_order));
this->print_format("E_Harris", this->f_en.etot_harris);
this->print_format("E_band", this->f_en.eband);
this->print_format("E_one_elec", this->f_en.eband + this->f_en.deband);
this->print_format("E_Hartree", this->f_en.hartree_energy);
this->print_format("E_xc", this->f_en.etxc - this->f_en.etxcc);
this->print_format("E_Ewald", this->f_en.ewald_energy);
this->print_format("E_entropy (-TS)", this->f_en.demet); // mohan add 2011-12-02
this->print_format("E_entropy(-TS)", this->f_en.demet); // mohan add 2011-12-02
this->print_format("E_descf", this->f_en.descf);
std::string vdw_method = get_input_vdw_method();
if (vdw_method == "d2") // Peize Lin add 2014-04, update 2021-03-09
Expand Down Expand Up @@ -378,7 +381,7 @@ void ElecState::print_format(const std::string& name, const double& value)
GlobalV::ofs_running << std::setiosflags(ios::showpos);
std::stringstream name2;
name2 << name;
GlobalV::ofs_running << " " << std::setw(12) << name2.str() << std::setw(30) << value << std::setw(30)
GlobalV::ofs_running << " " << std::setw(16) << name2.str() << std::setw(30) << value << std::setw(30)
<< value * ModuleBase::Ry_to_eV << std::endl;
GlobalV::ofs_running << std::resetiosflags(ios::showpos);
return;
Expand Down
2 changes: 1 addition & 1 deletion source/module_elecstate/fp_energy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void fenergy::print_all() const
std::cout << " etxc-etxcc=" << etxc - etxcc << std::endl;
std::cout << " ewld=" << ewald_energy << std::endl;
std::cout << " ehart=" << hartree_energy << std::endl;
std::cout << " demet=" << demet << std::endl;
std::cout << " entropy(-TS)=" << demet << std::endl;
hongriTianqi marked this conversation as resolved.
Show resolved Hide resolved
std::cout << " descf=" << descf << std::endl;
std::cout << " exx=" << exx << std::endl;
std::cout << " efiled=" << efield << std::endl;
Expand Down
2 changes: 1 addition & 1 deletion source/module_elecstate/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ AddTest(
AddTest(
TARGET elecstate_print
LIBS ${math_libs} base device
SOURCES elecstate_print_test.cpp ../elecstate_print.cpp
SOURCES elecstate_print_test.cpp ../elecstate_print.cpp ../occupy.cpp
)

AddTest(
Expand Down
1 change: 1 addition & 0 deletions source/module_elecstate/test/elecstate_fp_energy_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ TEST_F(fenergy, print_all)
f_en.print_all();
std::string output = testing::internal::GetCapturedStdout();
EXPECT_THAT(output, testing::HasSubstr("total="));
EXPECT_THAT(output, testing::HasSubstr("entropy(-TS)="));
hongriTianqi marked this conversation as resolved.
Show resolved Hide resolved
}

TEST_F(fenergy, eferm_get_ef)
Expand Down