Skip to content

Commit 367c4de

Browse files
author
Kai Luo
committed
Update ROPTLITE URL to use the master branch and fix LAPACK function call in berryphase
1 parent 5d009a7 commit 367c4de

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,8 @@ include(FetchContent)
761761
# GIT_TAG "origin/master"
762762
# GIT_SHALLOW TRUE
763763
# GIT_PROGRESS TRUE)
764-
URL "https://codeload.github.com/kluonj/roptlite/tar.gz/v1.0.1"
764+
# URL "https://codeload.github.com/kluonj/roptlite/tar.gz/v1.0.1"
765+
URL "https://codeload.github.com/kluonj/roptlite/tar.gz/master"
765766
)
766767
FetchContent_MakeAvailable(ROPTLITE)
767768
target_link_libraries(${ABACUS_BIN_NAME} ROPTLITE)

source/source_io/berryphase.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ double berryphase::stringPhase(const UnitCell& ucell,
313313
std::complex<double> det(1.0, 0.0);
314314
int info = 0;
315315
std::vector<int> ipiv(nbands);
316-
LapackConnector::getrf(LapackConnector::RowMajor, nbands, nbands, mat.c, nbands, ipiv.data());
316+
LapackConnector::zgetrf(nbands, nbands, mat, nbands, ipiv.data(), &info);
317317
for (int ib = 0; ib < nbands; ib++)
318318
{
319319
if (ipiv[ib] != (ib + 1)) {

source/source_io/ctrl_scf_lcao.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "source_lcao/module_ri/Exx_LRI_interface.h" // use EXX codes
2828
#include "source_lcao/module_ri/RPA_LRI.h" // use RPA code
2929
#endif
30-
// #include "source_lcao/module_rdmft/rdmft.h" // use RDMFT codes
30+
#include "source_lcao/module_rdmft/rdmft.h" // use RDMFT codes
3131
#include "source_io/to_qo.h" // use toQO
3232

3333
namespace ModuleIO
@@ -399,17 +399,17 @@ void ctrl_scf_lcao(UnitCell& ucell,
399399
}
400400
rdmft_solver.update_elec(ucell, occ_num, *psi);
401401

402-
// //! initialize the gradients of Etotal with respect to occupation numbers and wfc,
403-
// //! and set all elements to 0.
404-
// //! dedocc = d E/d Occ_Num
405-
// ModuleBase::matrix dedocc(pelec->wg.nr, pelec->wg.nc, true);
402+
//! initialize the gradients of Etotal with respect to occupation numbers and wfc,
403+
//! and set all elements to 0.
404+
//! dedocc = d E/d Occ_Num
405+
ModuleBase::matrix dedocc(pelec->wg.nr, pelec->wg.nc, true);
406406

407-
// //! dedwfc = d E/d wfc
408-
// psi::Psi<TK> dedwfc(psi->get_nk(), psi->get_nbands(), psi->get_nbasis(), kv.ngk, true);
409-
// dedwfc.zero_out();
407+
//! dedwfc = d E/d wfc
408+
psi::Psi<TK> dedwfc(psi->get_nk(), psi->get_nbands(), psi->get_nbasis(), kv.ngk, true);
409+
dedwfc.zero_out();
410410

411-
// double etot_rdmft = rdmft_solver.run(dedocc, dedwfc);
412-
// }
411+
double etot_rdmft = rdmft_solver.run(dedocc, dedwfc);
412+
}
413413

414414
//------------------------------------------------------------------
415415
//! 17) Output quasi orbitals

0 commit comments

Comments
 (0)