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
10 changes: 9 additions & 1 deletion source/source_lcao/module_deepks/deepks_basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,15 @@ void DeePKS_domain::cal_edelta_gedm(const int nat,
// input_dim:(natom, des_per_atom)
inputs.push_back(torch::cat(descriptor, 0).reshape({1, nat, des_per_atom}));
std::vector<torch::Tensor> ec;
ec.push_back(model_deepks.forward(inputs).toTensor()); // Hartree
try
{
ec.push_back(model_deepks.forward(inputs).toTensor()); // Hartree
}
catch (const c10::Error& e)
{
ModuleBase::WARNING_QUIT("DeePKS_domain::cal_edelta_gedm", "Please check whether the input shape required by model file matches the descriptor!");
throw;
}
E_delta = ec[0].item<double>() * 2; // Ry; *2 is for Hartree to Ry

// cal gedm
Expand Down
2 changes: 1 addition & 1 deletion source/source_lcao/module_deepks/deepks_pdm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void DeePKS_domain::read_pdm(bool read_pdm_file,
{
if (read_pdm_file && !init_pdm) // for DeePKS NSCF calculation
{
const std::string file_projdm = PARAM.globalv.global_out_dir + "deepks_projdm.dat";
const std::string file_projdm = PARAM.globalv.global_readin_dir + "deepks_projdm.dat";
std::ifstream ifs(file_projdm.c_str());

if (!ifs)
Expand Down
4 changes: 2 additions & 2 deletions source/source_lcao/spar_hsr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ void sparse_format::cal_HSR(const UnitCell& ucell,
// cal_STN_R_sparse(current_spin, sparse_thr);
if (nspin == 1 || nspin == 2)
{
hamilt::HamiltLCAO<std::complex<double>, double>* p_ham_lcao
= dynamic_cast<hamilt::HamiltLCAO<std::complex<double>, double>*>(p_ham);
hamilt::HamiltLCAO<TK, double>* p_ham_lcao
= dynamic_cast<hamilt::HamiltLCAO<TK, double>*>(p_ham);

HS_Arrays.all_R_coor = get_R_range(*(p_ham_lcao->getHR()));

Expand Down
4 changes: 2 additions & 2 deletions source/source_lcao/spar_st.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ void sparse_format::cal_SR(
// cal_STN_R_sparse(current_spin, sparse_thr);
if (nspin == 1 || nspin == 2)
{
hamilt::HamiltLCAO<std::complex<double>, double>* p_ham_lcao
= dynamic_cast<hamilt::HamiltLCAO<std::complex<double>, double>*>(p_ham);
hamilt::HamiltLCAO<TK, double>* p_ham_lcao
= dynamic_cast<hamilt::HamiltLCAO<TK, double>*>(p_ham);
const int cspin = 0;
sparse_format::cal_HContainer<double>(pv, sparse_thr, *(p_ham_lcao->getSR()), SR_sparse);
}
Expand Down
Loading