Skip to content

Commit 1735845

Browse files
mohanchenabacus_fixer
andauthored
update outputs of LCAO and DeePKS (#7275)
Co-authored-by: abacus_fixer <mohanchen@pku.eud.cn>
1 parent 6beefd0 commit 1735845

2 files changed

Lines changed: 18 additions & 27 deletions

File tree

source/source_io/module_output/print_info.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ void print_parameters(
8585

8686
const bool orbinfo = (inp.basis_type=="lcao" || inp.basis_type=="lcao_in_pw"
8787
|| (inp.basis_type=="pw" && inp.init_wfc.substr(0, 3) == "nao"));
88-
if (orbinfo) { std::cout << std::setw(12) << "NBASE"; }
88+
8989

9090
std::cout << std::endl;
9191
std::cout << " " << std::setw(8) << inp.nspin;
@@ -103,13 +103,8 @@ void print_parameters(
103103
<< std::setw(14) << PARAM.globalv.nthread_per_proc
104104
<< std::setw(14) << PARAM.globalv.nthread_per_proc*GlobalV::NPROC;
105105

106-
if (orbinfo) { std::cout << std::setw(12) << PARAM.globalv.nlocal; }
107-
108106
std::cout << std::endl;
109107

110-
111-
112-
113108
std::cout << " ----------------------------------------------------------------" << std::endl;
114109
if(inp.basis_type == "lcao")
115110
{
@@ -125,11 +120,13 @@ void print_parameters(
125120
}
126121
std::cout << " ----------------------------------------------------------------" << std::endl;
127122

128-
129-
130123
//----------------------------------
131124
// second part
132125
//----------------------------------
126+
if (orbinfo)
127+
{
128+
std::cout << " TOTAL NBASE" << " " << PARAM.globalv.nlocal << std::endl;
129+
}
133130

134131
std::cout << " " << std::setw(8) << "ELEMENT";
135132

@@ -140,7 +137,6 @@ void print_parameters(
140137
}
141138
std::cout << std::setw(12) << "NATOM";
142139

143-
std::cout << std::setw(12) << "XC";
144140
std::cout << std::endl;
145141

146142

source/source_lcao/module_deepks/LCAO_deepks.cpp

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,4 @@
1-
// wenfei 2022-1-5
2-
// This file contains constructor and destructor of the class LCAO_deepks,
31
#include "source_io/module_parameter/parameter.h"
4-
// as well as subroutines for initializing and releasing relevant data structures
5-
6-
// Other than the constructor and the destructor, it contains 3 types of subroutines:
7-
// 1. subroutines that are related to calculating descriptors:
8-
// - init : allocates some arrays
9-
// - init_index : records the index (inl)
10-
// 2. subroutines that are related to V_delta:
11-
// - allocate_V_delta : allocates V_delta; if calculating force, it also allocates F_delta
122

133
#ifdef __MLALGO
144

@@ -57,7 +47,12 @@ void LCAO_Deepks<T>::init(const LCAO_Orbitals& orb,
5747
ModuleBase::TITLE("LCAO_Deepks", "init");
5848
ModuleBase::timer::start("LCAO_Deepks", "init");
5949

60-
ofs << " Initialize the descriptor index for DeePKS (lcao line)" << std::endl;
50+
ofs << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl;
51+
ofs << " | |" << std::endl;
52+
ofs << " | #Initialize DeePKS (LCAO)# |" << std::endl;
53+
ofs << " | Setup machine-Learning-Based DeePKS method based on NAO basis set |" << std::endl;
54+
ofs << " | |" << std::endl;
55+
ofs << " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << std::endl;
6156

6257
const int lm = orb.get_lmax_d();
6358
const int nm = orb.get_nchimax_d();
@@ -82,8 +77,8 @@ void LCAO_Deepks<T>::init(const LCAO_Orbitals& orb,
8277
this->deepks_param.nchi_d_l[l] = orb.Alpha[0].getNchi(l);
8378
}
8479

85-
ofs << " lmax of descriptor = " << deepks_param.lmaxd << std::endl;
86-
ofs << " nmax of descriptor = " << deepks_param.nmaxd << std::endl;
80+
ofs << " Lmax of descriptor " << deepks_param.lmaxd << std::endl;
81+
ofs << " Nmax of descriptor " << deepks_param.nmaxd << std::endl;
8782

8883
int pdm_size = 0;
8984
this->deepks_param.inlmax = tot_inl;
@@ -104,7 +99,7 @@ void LCAO_Deepks<T>::init(const LCAO_Orbitals& orb,
10499

105100
if (!PARAM.inp.deepks_equiv)
106101
{
107-
ofs << " total basis (all atoms) for descriptor = " << std::endl;
102+
// ofs << " total basis (all atoms) for descriptor = " << std::endl;
108103

109104
// init pdm
110105
for (int inl = 0; inl < this->deepks_param.inlmax; inl++)
@@ -122,7 +117,7 @@ void LCAO_Deepks<T>::init(const LCAO_Orbitals& orb,
122117
}
123118
pdm_size = pdm_size * pdm_size;
124119
this->deepks_param.des_per_atom = pdm_size;
125-
ofs << " Equivariant version, size of pdm matrices : " << pdm_size << std::endl;
120+
ofs << " Equivariant version, pdm matrices size " << pdm_size << std::endl;
126121
for (int iat = 0; iat < nat; iat++)
127122
{
128123
this->pdm[iat] = torch::zeros({pdm_size}, torch::kFloat64);
@@ -153,7 +148,7 @@ void LCAO_Deepks<T>::init_index(const int ntype,
153148
{
154149
this->deepks_param.inl_index[it].create(na[it], this->deepks_param.lmaxd + 1, this->deepks_param.nmaxd);
155150

156-
ofs << " Type " << it + 1 << " number_of_atoms " << na[it] << std::endl;
151+
//ofs << " Type " << it + 1 << " number_of_atoms " << na[it] << std::endl;
157152

158153
for (int ia = 0; ia < na[it]; ia++)
159154
{
@@ -170,8 +165,8 @@ void LCAO_Deepks<T>::init_index(const int ntype,
170165
} // end ia
171166
} // end it
172167
assert(Total_nchi == inl);
173-
ofs << " descriptors_per_atom " << this->deepks_param.des_per_atom << std::endl;
174-
ofs << " total_descriptors " << this->deepks_param.n_descriptor << std::endl;
168+
ofs << " Descriptors per atom " << this->deepks_param.des_per_atom << std::endl;
169+
ofs << " Total Descriptors " << this->deepks_param.n_descriptor << std::endl;
175170
return;
176171
}
177172

0 commit comments

Comments
 (0)