Skip to content

Commit dba2cd7

Browse files
author
abacus_fixer
committed
mulliken for spin 1
1 parent 76e9e60 commit dba2cd7

1 file changed

Lines changed: 24 additions & 25 deletions

File tree

source/source_io/module_mulliken/output_mulliken.cpp

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,27 @@ void Output_Mulliken<TK>::write_mulliken_nspin1(int istep,
7070
{
7171
os << std::setprecision(4);
7272
/// step info
73-
os << " Ionic Step " << istep+1 << std::endl;
74-
os << " Mulliken Analysis for Each Atom" << std::endl;
75-
os << " Total Charge\t" << tot_chg[0] << std::endl;
73+
os << " --- Ionic Step " << istep+1 << " ---" << std::endl;
74+
os << " Total charge " << tot_chg[0] << std::endl;
7675
/// orbital decomposed mulliken populations
77-
FmtCore fmt_of_chg("%20.4f");
78-
FmtCore fmt_of_label("%-20s");
79-
FmtCore fmt_of_Z("%10d");
80-
os << " Decomposed Mulliken Populations" << std::endl;
76+
FmtCore fmt_of_chg("%10.4f");
77+
FmtCore fmt_of_label("%6s");
78+
FmtCore fmt_of_Z("%2d");
79+
FmtCore fmt_of_sum("%8s");
80+
os << " Decomposed Mulliken population analysis for each atom" << std::endl;
81+
os << " l and m from Ylm, z stands for zeta orbital" << std::endl;
82+
os << std::endl;
83+
8184
for (int iat = 0; iat < this->cell_index_->get_nat(); ++iat)
8285
{
8386
/// header of the table
8487
std::string atom_label = this->cell_index_->get_atom_label(iat);
85-
os << " Atom " << FmtCore::format("%-20d", (iat+1))
86-
<< FmtCore::format("%10s", std::string("Zeta of ") + atom_label)
87-
<< FmtCore::format("%20s", std::string("Spin 1")) << std::endl;
88+
os << " ------------------" << std::endl;
89+
os << " Atom " << iat+1 << " is " << atom_label << std::endl;
90+
os << " ------------------" << std::endl;
91+
os << FmtCore::format("%8s", std::string("zeta"))
92+
<< FmtCore::format("%10s", std::string("spin1")) << std::endl;
93+
8894
/// loop of L
8995
for (int L = 0; L <= this->cell_index_->get_maxL(iat); L++)
9096
{
@@ -93,8 +99,8 @@ void Output_Mulliken<TK>::write_mulliken_nspin1(int istep,
9399
{
94100
for (int M = 0; M < (2 * L + 1); M++)
95101
{
96-
os << " "
97-
<< fmt_of_label.format(ModuleBase::Name_Angular[L][M]) << fmt_of_Z.format(Z)
102+
os << fmt_of_label.format(ModuleBase::Name_Angular[L][M])
103+
<< fmt_of_Z.format(Z+1)
98104
<< fmt_of_chg.format(orb_chg[std::vector<int>{iat, 0, L, Z, M}]) << std::endl;
99105
}
100106
// sum over m
@@ -109,27 +115,20 @@ void Output_Mulliken<TK>::write_mulliken_nspin1(int istep,
109115
}
110116
if (L > 0)
111117
{
112-
os << " "
113-
<< fmt_of_label.format(std::string("SUM OVER M"))
114-
<< std::setw(10) << ""
115-
<< fmt_of_chg.format(sum_over_m[0]) << std::endl;
118+
os << fmt_of_sum.format(std::string(" sum m"))
119+
<< fmt_of_chg.format(sum_over_m[0]) << std::endl;
116120
}
117121
}
118-
os << " "
119-
<< fmt_of_label.format(std::string("SUM OVER M+Zeta"))
120-
<< std::setw(10) << ""
122+
os << fmt_of_sum.format(std::string(" sum mz"))
121123
<< fmt_of_chg.format(sum_over_m_and_z[0]) << std::endl;
122124
os << std::endl;
123125
}
124-
os << " "
125-
<< fmt_of_label.format(std::string("SUM OVER M+Zeta+L"))
126-
<< std::setw(10) << ""
126+
os << fmt_of_sum.format(std::string(" sum lmz"))
127127
<< fmt_of_chg.format(atom_chg[iat][0]) << std::endl;
128128
os << std::endl;
129-
os << std::left << std::setw(30) << " Total Charge on atom "
130-
<< std::right << std::setw(6) << atom_label
129+
os << std::left << " total charge on atom " << iat+1 << " "
131130
<< fmt_of_chg.format(atom_chg[iat][0]) << std::endl;
132-
os << std::endl << std::endl;
131+
os << std::endl;
133132
}
134133
}
135134

0 commit comments

Comments
 (0)