Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
b69c085
Refactor: Encapsulate timer functionality in timer_wrapper.h
Jan 23, 2026
3829268
Refactor timer code and clean_esolver function
Jan 23, 2026
6fbf3dc
Merge branch 'develop' of github.com:mohanchen/abacus-mc into develop
Jan 24, 2026
ddafac6
Merge branch 'deepmodeling:develop' into develop
mohanchen Jan 25, 2026
202eac6
Merge branch 'deepmodeling:develop' into develop
mohanchen Jan 25, 2026
44a271b
Merge branch 'deepmodeling:develop' into develop
mohanchen Jan 25, 2026
2ac905d
Merge branch 'deepmodeling:develop' into develop
mohanchen Jan 25, 2026
1a0f1b4
Merge branch 'deepmodeling:develop' into develop
mohanchen Jan 27, 2026
47998bb
Merge branch 'deepmodeling:develop' into develop
mohanchen Jan 27, 2026
97c89da
Merge branch 'deepmodeling:develop' into develop
mohanchen Jan 28, 2026
fcbc6ab
Merge branch 'deepmodeling:develop' into develop
mohanchen Jan 28, 2026
fdd2606
Merge branch 'deepmodeling:develop' into develop
mohanchen Jan 31, 2026
3aa510e
Merge branch 'deepmodeling:develop' into develop
mohanchen Feb 1, 2026
a11361e
add module_energy directory
Feb 1, 2026
a18f0f2
Merge branch 'deepmodeling:develop' into develop
mohanchen Feb 2, 2026
16a65d2
updates
Feb 3, 2026
11938fe
Rename json_output to module_json and move para_json files, update in…
Feb 3, 2026
75775ec
Merge branch 'deepmodeling:develop' into develop
mohanchen Feb 7, 2026
ba64c35
Update CMakeLists.txt: change json_output to module_json
Feb 7, 2026
a9db0b1
Merge branch 'develop' into 20260203
mohanchen Feb 7, 2026
08370ea
Fix CMakeLists.txt: update source_io file paths to module_output dire…
Feb 7, 2026
d556f85
Fix csr_reader.h include paths: update to module_output directory
Feb 7, 2026
92afac8
fix bugs related to libxc
Feb 8, 2026
03983eb
fix
Feb 8, 2026
0da1a53
fix
Feb 8, 2026
f2a83e9
fix several CMakeLists
Feb 8, 2026
e256f0c
update CMake and other test files
Feb 8, 2026
2df5f84
Merge branch 'deepmodeling:develop' into develop
mohanchen Feb 8, 2026
3343370
update cmakelists
Feb 8, 2026
cc881a9
Merge branch 'develop' of github.com:mohanchen/abacus-mc into develop
Feb 8, 2026
26433bb
solve conflict
Feb 8, 2026
b6fcfa7
fix bugs
Feb 8, 2026
80b74c1
Fix: Correct para_json.cpp path in test CMakeLists.txt
Feb 8, 2026
b84febd
fix cmake
Feb 8, 2026
7c0865c
fix
Feb 8, 2026
0c811ee
fix
Feb 8, 2026
e9de93e
fix
Feb 8, 2026
468dd53
fix
Feb 8, 2026
0a5aaa4
fix
Feb 8, 2026
019b502
json!
Feb 8, 2026
d608d35
small updates of mulliken file format
Feb 8, 2026
3b75f45
update mulliken charge output nspin=1
Feb 8, 2026
58ce9ca
Fix: Create symbolic link 'abacus' for test compatibility
Feb 14, 2026
2942075
Merge branch 'deepmodeling:develop' into develop
mohanchen Feb 20, 2026
8897aa2
Merge branch '20260214' into develop
Feb 20, 2026
23fbce0
update mulliken output
Feb 20, 2026
27c7079
update mulliken spin 2
Feb 20, 2026
76e9e60
update mulliken 4
Feb 20, 2026
dba2cd7
mulliken for spin 1
Feb 20, 2026
40b6fa5
update mulliken and refs
Feb 20, 2026
58f40b1
update mulliken test to match new output format
Feb 20, 2026
2bbe4d4
update pchg
Feb 21, 2026
000427c
update mulliken test
Feb 21, 2026
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 source/source_base/name_angular.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace ModuleBase
{"dz^2", "dxz", "dyz", "dx^2-y^2", "dxy"},
{"fz^3", "fxz^2", "fyz^2", "fzx^2-zy^2", "fxyz", "fx^3-3*xy^2", "f3yx^2-y^3"},
{"g1", "g2", "g3", "g4", "g5", "g6", "g7", "g8", "g9"}
}; // name of atomic orbital jiyy add 2022-05-10
}; // name of atomic orbital jiyy add 2022-05-10
}

#endif
15 changes: 11 additions & 4 deletions source/source_io/module_chgpot/get_pchg_lcao.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,11 @@ void Get_pchg_lcao::begin(double** rho,

// Use a const vector to store efermi for all spins, replace the original implementation:
// const double ef_tmp = pelec->eferm.get_efval(is);
const int precision = 6;
double ef_spin = ef_all_spin[is];
ModuleIO::write_vdata_palgrid(pgrid, rho_save[is].data(), is, nspin, 0, ssc.str(), ef_spin, ucell_in);
ModuleIO::write_vdata_palgrid(pgrid,
rho_save[is].data(), is, nspin, 0,
ssc.str(), ef_spin, ucell_in, precision);
}
}
}
Expand Down Expand Up @@ -180,14 +183,16 @@ void Get_pchg_lcao::begin(double** rho,
ofs_running << " Writing cube file " << ssc.str() << std::endl;

double ef_spin = ef_all_spin[is];
const int precision = 6;
ModuleIO::write_vdata_palgrid(pgrid,
rho_save[is].data(),
is,
nspin,
0,
ssc.str(),
ef_spin,
ucell_in);
ucell_in,
precision);
}
}
}
Expand Down Expand Up @@ -230,14 +235,16 @@ void Get_pchg_lcao::begin(double** rho,
ofs_running << " Writing cube file " << ssc.str() << std::endl;

double ef_spin = ef_all_spin[is];
const int precision = 6;
ModuleIO::write_vdata_palgrid(pgrid,
rho_save[is].data(),
is,
nspin,
0,
ssc.str(),
ef_spin,
ucell_in);
ucell_in,
precision);
}
}
}
Expand Down Expand Up @@ -460,4 +467,4 @@ void Get_pchg_lcao::prepare_get_pchg(std::ofstream& ofs_running)
ofs_running << "\n\n";

ofs_running << std::setprecision(6);
}
}
8 changes: 6 additions & 2 deletions source/source_io/module_mulliken/output_dmk.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ template <typename TK>
class Output_DMK
{
public:
Output_DMK(elecstate::DensityMatrix<TK, double>* p_DM, Parallel_Orbitals* ParaV, int nspin, int nks);
Output_DMK(elecstate::DensityMatrix<TK, double>* p_DM,
Parallel_Orbitals* ParaV,
int nspin,
int nks);

TK* get_DMK(int ik);

private:
Expand All @@ -23,4 +27,4 @@ class Output_DMK

} // namespace ModuleIO

#endif // MODULE_IO_OUTPUT_DMK_H
#endif // MODULE_IO_OUTPUT_DMK_H
164 changes: 101 additions & 63 deletions source/source_io/module_mulliken/output_mulliken.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ Output_Mulliken<TK>::Output_Mulliken(Output_Sk<TK>* output_sk,
CellIndex* cell_index,
const std::vector<int>& isk,
int nspin)
: output_sk_(output_sk), output_dmk_(output_dmk), ParaV_(ParaV), cell_index_(cell_index), isk_(isk), nspin_(nspin)
: output_sk_(output_sk), output_dmk_(output_dmk),
ParaV_(ParaV), cell_index_(cell_index), isk_(isk), nspin_(nspin)
{
this->set_nspin(nspin);
this->set_ParaV(ParaV);
Expand Down Expand Up @@ -69,20 +70,27 @@ void Output_Mulliken<TK>::write_mulliken_nspin1(int istep,
{
os << std::setprecision(4);
/// step info
os << "STEP: " << istep << std::endl;
os << "CALCULATE THE MULLIkEN ANALYSIS FOR EACH ATOM" << std::endl;
os << " Total charge:\t" << tot_chg[0] << std::endl;
os << " --- Ionic Step " << istep+1 << " ---" << std::endl;
os << " Total charge " << tot_chg[0] << std::endl;
/// orbital decomposed mulliken populations
FmtCore fmt_of_chg("%20.4f");
FmtCore fmt_of_label("%-20s");
FmtCore fmt_of_Z("%20d");
os << "Decomposed Mulliken populations" << std::endl;
FmtCore fmt_of_chg("%10.4f");
FmtCore fmt_of_label("%12s");
FmtCore fmt_of_Z("%2d");
FmtCore fmt_of_sum("%14s");
os << " Decomposed Mulliken population analysis for each atom" << std::endl;
os << " l and m from Ylm, z stands for zeta orbital" << std::endl;
os << std::endl;

for (int iat = 0; iat < this->cell_index_->get_nat(); ++iat)
{
/// header of the table
std::string atom_label = this->cell_index_->get_atom_label(iat);
os << FmtCore::format("%-20d", iat) << FmtCore::format("%20s", std::string("Zeta of ") + atom_label)
<< FmtCore::format("%20s", std::string("Spin 1")) << std::endl;
os << " ------------------" << std::endl;
os << " Atom " << iat+1 << " is " << atom_label << std::endl;
os << " ------------------" << std::endl;
os << FmtCore::format("%14s", std::string("zeta"))
<< FmtCore::format("%10s", std::string("spin1")) << std::endl;

/// loop of L
for (int L = 0; L <= this->cell_index_->get_maxL(iat); L++)
{
Expand All @@ -91,7 +99,8 @@ void Output_Mulliken<TK>::write_mulliken_nspin1(int istep,
{
for (int M = 0; M < (2 * L + 1); M++)
{
os << fmt_of_label.format(ModuleBase::Name_Angular[L][M]) << fmt_of_Z.format(Z)
os << fmt_of_label.format(ModuleBase::Name_Angular[L][M])
<< fmt_of_Z.format(Z+1)
<< fmt_of_chg.format(orb_chg[std::vector<int>{iat, 0, L, Z, M}]) << std::endl;
}
// sum over m
Expand All @@ -106,20 +115,20 @@ void Output_Mulliken<TK>::write_mulliken_nspin1(int istep,
}
if (L > 0)
{
os << fmt_of_label.format(std::string("SUM OVER M")) << std::setw(20) << ""
os << fmt_of_sum.format(std::string(" sum m"))
<< fmt_of_chg.format(sum_over_m[0]) << std::endl;
}
}
os << fmt_of_label.format(std::string("SUM OVER M+Zeta")) << std::setw(20) << ""
os << fmt_of_sum.format(std::string(" sum mz"))
<< fmt_of_chg.format(sum_over_m_and_z[0]) << std::endl;
os << std::endl;
}
os << fmt_of_label.format(std::string("SUM OVER M+Zeta+L")) << std::setw(20) << ""
os << fmt_of_sum.format(std::string(" sum lmz"))
<< fmt_of_chg.format(atom_chg[iat][0]) << std::endl;
os << std::endl;
os << std::left << std::setw(30) << "Total Charge on atom:" << std::right << std::setw(10) << atom_label
os << std::left << " total charge on atom " << iat+1 << " "
<< fmt_of_chg.format(atom_chg[iat][0]) << std::endl;
os << std::endl << std::endl;
os << std::endl;
}
}

Expand All @@ -132,23 +141,32 @@ void Output_Mulliken<TK>::write_mulliken_nspin2(int istep,
{
os << std::setprecision(4);
/// step info
os << "STEP: " << istep << std::endl;
os << "CALCULATE THE MULLIkEN ANALYSIS FOR EACH ATOM" << std::endl;
os << " Total charge of spin " << 1 << ":\t" << tot_chg[0] << std::endl;
os << " Total charge of spin " << 2 << ":\t" << tot_chg[1] << std::endl;
os << " Total charge:\t" << tot_chg[0] + tot_chg[1] << std::endl;
os << " --- Ionic Step " << istep+1 << " ---" << std::endl;
os << " Total charge " << tot_chg[0] + tot_chg[1] << std::endl;
os << " Total charge of spin1 " << tot_chg[0] << std::endl;
os << " Total charge of spin2 " << tot_chg[1] << std::endl;
/// orbital decomposed mulliken populations
FmtCore fmt_of_chg("%20.4f");
FmtCore fmt_of_label("%-20s");
FmtCore fmt_of_Z("%20d");
os << "Decomposed Mulliken populations" << std::endl;
FmtCore fmt_of_chg("%10.4f");
FmtCore fmt_of_label("%12s");
FmtCore fmt_of_Z("%2d");
FmtCore fmt_of_sum("%14s");
os << " Decomposed Mulliken population analysis for each atom" << std::endl;
os << " l and m from Ylm, z stands for zeta orbital" << std::endl;
os << std::endl;

for (int iat = 0; iat < this->cell_index_->get_nat(); ++iat)
{
/// header of the table
std::string atom_label = this->cell_index_->get_atom_label(iat);
os << FmtCore::format("%-20d", iat) << FmtCore::format("%20s", std::string("Zeta of ") + atom_label)
<< FmtCore::format("%20s", std::string("Spin 1")) << FmtCore::format("%20s", std::string("Spin 2"))
<< FmtCore::format("%20s", std::string("Sum")) << FmtCore::format("%20s", std::string("Diff")) << std::endl;
os << " ------------------" << std::endl;
os << " Atom " << iat+1 << " is " << atom_label << std::endl;
os << " ------------------" << std::endl;
os << FmtCore::format("%14s", std::string("zeta"))
<< FmtCore::format("%10s", std::string("spin1"))
<< FmtCore::format("%10s", std::string("spin2"))
<< FmtCore::format("%10s", std::string("sum"))
<< FmtCore::format("%10s", std::string("diff")) << std::endl;

/// loop of L
for (int L = 0; L <= this->cell_index_->get_maxL(iat); L++)
{
Expand All @@ -157,7 +175,8 @@ void Output_Mulliken<TK>::write_mulliken_nspin2(int istep,
{
for (int M = 0; M < (2 * L + 1); M++)
{
os << fmt_of_label.format(ModuleBase::Name_Angular[L][M]) << fmt_of_Z.format(Z)
os << fmt_of_label.format(ModuleBase::Name_Angular[L][M])
<< fmt_of_Z.format(Z+1) // be careful, Z+1, modified by mohan 2026-02-21
<< fmt_of_chg.format(orb_chg[std::vector<int>{iat, 0, L, Z, M}])
<< fmt_of_chg.format(orb_chg[std::vector<int>{iat, 1, L, Z, M}])
<< fmt_of_chg.format(orb_chg[std::vector<int>{iat, 0, L, Z, M}]
Expand All @@ -178,28 +197,31 @@ void Output_Mulliken<TK>::write_mulliken_nspin2(int istep,
}
if (L > 0)
{
os << fmt_of_label.format(std::string("SUM OVER M")) << std::setw(20) << ""
<< fmt_of_chg.format(sum_over_m[0]) << fmt_of_chg.format(sum_over_m[1])
os << fmt_of_sum.format(std::string(" sum m"))
<< fmt_of_chg.format(sum_over_m[0])
<< fmt_of_chg.format(sum_over_m[1])
<< fmt_of_chg.format(sum_over_m[0] + sum_over_m[1])
<< fmt_of_chg.format(sum_over_m[0] - sum_over_m[1]) << std::endl;
}
}
os << fmt_of_label.format(std::string("SUM OVER M+Zeta")) << std::setw(20) << ""
<< fmt_of_chg.format(sum_over_m_and_z[0]) << fmt_of_chg.format(sum_over_m_and_z[1])
os << fmt_of_sum.format(std::string(" sum mz"))
<< fmt_of_chg.format(sum_over_m_and_z[0])
<< fmt_of_chg.format(sum_over_m_and_z[1])
<< fmt_of_chg.format(sum_over_m_and_z[0] + sum_over_m_and_z[1])
<< fmt_of_chg.format(sum_over_m_and_z[0] - sum_over_m_and_z[1]) << std::endl;
os << std::endl;
}
os << fmt_of_label.format(std::string("SUM OVER M+Zeta+L")) << std::setw(20) << ""
<< fmt_of_chg.format(atom_chg[iat][0]) << fmt_of_chg.format(atom_chg[iat][1])
os << fmt_of_sum.format(std::string(" sum lmz"))
<< fmt_of_chg.format(atom_chg[iat][0])
<< fmt_of_chg.format(atom_chg[iat][1])
<< fmt_of_chg.format(atom_chg[iat][0] + atom_chg[iat][1])
<< fmt_of_chg.format(atom_chg[iat][0] - atom_chg[iat][1]) << std::endl;
os << std::endl;
os << std::left << std::setw(30) << "Total Charge on atom:" << std::right << std::setw(10) << atom_label
os << std::left << " total charge on atom " << iat+1 << " "
<< fmt_of_chg.format(atom_chg[iat][0] + atom_chg[iat][1]) << std::endl;
os << std::left << std::setw(30) << "Total Magnetism on atom: " << std::right << std::setw(10) << atom_label
os << std::left << " total magnetism on atom " << iat+1 << " "
<< fmt_of_chg.format(atom_chg[iat][0] - atom_chg[iat][1]) << std::endl;
os << std::endl << std::endl;
os << std::endl;
}
}

Expand All @@ -212,22 +234,30 @@ void Output_Mulliken<TK>::write_mulliken_nspin4(int istep,
{
os << std::setprecision(4);
/// step info
os << "STEP: " << istep << std::endl;
os << "CALCULATE THE MULLIkEN ANALYSIS FOR EACH ATOM" << std::endl;
os << " Total charge:\t" << tot_chg[0] << std::endl;
os << " --- Ionic Step " << istep+1 << " ---" << std::endl;
os << " Total charge " << tot_chg[0] << std::endl;
/// orbital decomposed mulliken populations
FmtCore fmt_of_chg("%20.4f");
FmtCore fmt_of_label("%-20s");
FmtCore fmt_of_Z("%20d");
os << "Decomposed Mulliken populations" << std::endl;
FmtCore fmt_of_chg("%10.4f");
FmtCore fmt_of_label("%12s");
FmtCore fmt_of_Z("%2d");
FmtCore fmt_of_sum("%14s");
os << " Decomposed Mulliken population analysis for each atom" << std::endl;
os << " l and m from Ylm, z stands for zeta orbital" << std::endl;
os << std::endl;

for (int iat = 0; iat < this->cell_index_->get_nat(); ++iat)
{
/// header of the table
std::string atom_label = this->cell_index_->get_atom_label(iat);
os << FmtCore::format("%-20d", iat) << FmtCore::format("%20s", std::string("Zeta of ") + atom_label)
<< FmtCore::format("%20s", std::string("Spin 1")) << FmtCore::format("%20s", std::string("Spin 2"))
<< FmtCore::format("%20s", std::string("Spin 3")) << FmtCore::format("%20s", std::string("Spin 4"))
<< std::endl;
os << " ------------------" << std::endl;
os << " Atom " << iat+1 << " is " << atom_label << std::endl;
os << " ------------------" << std::endl;
os << FmtCore::format("%14s", std::string("zeta"))
<< FmtCore::format("%10s", std::string("spin1"))
<< FmtCore::format("%10s", std::string("spin2"))
<< FmtCore::format("%10s", std::string("spin3"))
<< FmtCore::format("%10s", std::string("spin4")) << std::endl;

/// loop of L
for (int L = 0; L <= this->cell_index_->get_maxL(iat); L++)
{
Expand All @@ -236,7 +266,8 @@ void Output_Mulliken<TK>::write_mulliken_nspin4(int istep,
{
for (int M = 0; M < (2 * L + 1); M++)
{
os << fmt_of_label.format(ModuleBase::Name_Angular[L][M]) << fmt_of_Z.format(Z)
os << fmt_of_label.format(ModuleBase::Name_Angular[L][M])
<< fmt_of_Z.format(Z+1)
<< fmt_of_chg.format(orb_chg[std::vector<int>{iat, 0, L, Z, M}])
<< fmt_of_chg.format(orb_chg[std::vector<int>{iat, 1, L, Z, M}])
<< fmt_of_chg.format(orb_chg[std::vector<int>{iat, 2, L, Z, M}])
Expand All @@ -254,26 +285,33 @@ void Output_Mulliken<TK>::write_mulliken_nspin4(int istep,
}
if (L > 0)
{
os << fmt_of_label.format(std::string("SUM OVER M")) << std::setw(20) << ""
<< fmt_of_chg.format(sum_over_m[0]) << fmt_of_chg.format(sum_over_m[1])
<< fmt_of_chg.format(sum_over_m[2]) << fmt_of_chg.format(sum_over_m[3]) << std::endl;
os << fmt_of_sum.format(std::string(" sum m"))
<< fmt_of_chg.format(sum_over_m[0])
<< fmt_of_chg.format(sum_over_m[1])
<< fmt_of_chg.format(sum_over_m[2])
<< fmt_of_chg.format(sum_over_m[3]) << std::endl;
}
}
os << fmt_of_label.format(std::string("SUM OVER M+Zeta")) << std::setw(20) << ""
<< fmt_of_chg.format(sum_over_m_and_z[0]) << fmt_of_chg.format(sum_over_m_and_z[1])
<< fmt_of_chg.format(sum_over_m_and_z[2]) << fmt_of_chg.format(sum_over_m_and_z[3]) << std::endl;
os << fmt_of_sum.format(std::string(" sum mz"))
<< fmt_of_chg.format(sum_over_m_and_z[0])
<< fmt_of_chg.format(sum_over_m_and_z[1])
<< fmt_of_chg.format(sum_over_m_and_z[2])
<< fmt_of_chg.format(sum_over_m_and_z[3]) << std::endl;
os << std::endl;
}
os << fmt_of_label.format(std::string("SUM OVER M+Zeta+L")) << std::setw(20) << ""
<< fmt_of_chg.format(atom_chg[iat][0]) << fmt_of_chg.format(atom_chg[iat][1])
<< fmt_of_chg.format(atom_chg[iat][2]) << fmt_of_chg.format(atom_chg[iat][3]) << std::endl;
os << fmt_of_sum.format(std::string(" sum lmz"))
<< fmt_of_chg.format(atom_chg[iat][0])
<< fmt_of_chg.format(atom_chg[iat][1])
<< fmt_of_chg.format(atom_chg[iat][2])
<< fmt_of_chg.format(atom_chg[iat][3]) << std::endl;
os << std::endl;
os << std::left << std::setw(30) << "Total Charge on atom:" << std::right << std::setw(10) << atom_label
os << std::left << " total charge on atom " << iat+1 << " "
<< fmt_of_chg.format(atom_chg[iat][0]) << std::endl;
os << std::left << std::setw(30) << "Total Magnetism on atom: " << std::right << std::setw(10) << atom_label
<< fmt_of_chg.format(atom_chg[iat][1]) << fmt_of_chg.format(atom_chg[iat][2])
os << std::left << " total magnetism on atom " << iat+1 << " "
<< fmt_of_chg.format(atom_chg[iat][1]) << " "
<< fmt_of_chg.format(atom_chg[iat][2]) << " "
<< fmt_of_chg.format(atom_chg[iat][3]) << std::endl;
os << std::endl << std::endl;
os << std::endl;
}
}

Expand Down
Loading
Loading