Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
14 changes: 5 additions & 9 deletions source/source_io/module_output/print_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void print_parameters(

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


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

if (orbinfo) { std::cout << std::setw(12) << PARAM.globalv.nlocal; }

std::cout << std::endl;




std::cout << " ----------------------------------------------------------------" << std::endl;
if(inp.basis_type == "lcao")
{
Expand All @@ -125,11 +120,13 @@ void print_parameters(
}
std::cout << " ----------------------------------------------------------------" << std::endl;



//----------------------------------
// second part
//----------------------------------
if (orbinfo)
{
std::cout << " TOTAL NBASE" << " " << PARAM.globalv.nlocal << std::endl;
}

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

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

std::cout << std::setw(12) << "XC";
std::cout << std::endl;


Expand Down
31 changes: 13 additions & 18 deletions source/source_lcao/module_deepks/LCAO_deepks.cpp
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
// wenfei 2022-1-5
// This file contains constructor and destructor of the class LCAO_deepks,
#include "source_io/module_parameter/parameter.h"
// as well as subroutines for initializing and releasing relevant data structures

// Other than the constructor and the destructor, it contains 3 types of subroutines:
// 1. subroutines that are related to calculating descriptors:
// - init : allocates some arrays
// - init_index : records the index (inl)
// 2. subroutines that are related to V_delta:
// - allocate_V_delta : allocates V_delta; if calculating force, it also allocates F_delta

#ifdef __MLALGO

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

ofs << " Initialize the descriptor index for DeePKS (lcao line)" << std::endl;
ofs << " >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>" << std::endl;
ofs << " | |" << std::endl;
ofs << " | #Initialize DeePKS (LCAO)# |" << std::endl;
ofs << " | Setup machine-Learning-Based DeePKS method based on NAO basis set |" << std::endl;
ofs << " | |" << std::endl;
ofs << " <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << std::endl;

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

ofs << " lmax of descriptor = " << deepks_param.lmaxd << std::endl;
ofs << " nmax of descriptor = " << deepks_param.nmaxd << std::endl;
ofs << " Lmax of descriptor " << deepks_param.lmaxd << std::endl;
ofs << " Nmax of descriptor " << deepks_param.nmaxd << std::endl;

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

if (!PARAM.inp.deepks_equiv)
{
ofs << " total basis (all atoms) for descriptor = " << std::endl;
// ofs << " total basis (all atoms) for descriptor = " << std::endl;

// init pdm
for (int inl = 0; inl < this->deepks_param.inlmax; inl++)
Expand All @@ -122,7 +117,7 @@ void LCAO_Deepks<T>::init(const LCAO_Orbitals& orb,
}
pdm_size = pdm_size * pdm_size;
this->deepks_param.des_per_atom = pdm_size;
ofs << " Equivariant version, size of pdm matrices : " << pdm_size << std::endl;
ofs << " Equivariant version, pdm matrices size " << pdm_size << std::endl;
for (int iat = 0; iat < nat; iat++)
{
this->pdm[iat] = torch::zeros({pdm_size}, torch::kFloat64);
Expand Down Expand Up @@ -153,7 +148,7 @@ void LCAO_Deepks<T>::init_index(const int ntype,
{
this->deepks_param.inl_index[it].create(na[it], this->deepks_param.lmaxd + 1, this->deepks_param.nmaxd);

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

for (int ia = 0; ia < na[it]; ia++)
{
Expand All @@ -170,8 +165,8 @@ void LCAO_Deepks<T>::init_index(const int ntype,
} // end ia
} // end it
assert(Total_nchi == inl);
ofs << " descriptors_per_atom " << this->deepks_param.des_per_atom << std::endl;
ofs << " total_descriptors " << this->deepks_param.n_descriptor << std::endl;
ofs << " Descriptors per atom " << this->deepks_param.des_per_atom << std::endl;
ofs << " Total Descriptors " << this->deepks_param.n_descriptor << std::endl;
return;
}

Expand Down
Loading