forked from abacusmodeling/abacus-develop
-
Notifications
You must be signed in to change notification settings - Fork 139
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Feature: add initsto_ecut Stochastic wave functions are initialized with a large G-ball with cutoff energy of initsto_ecut. It can make SDFT with different wfcecuts comparable. It makes results of different cores equal.
- Loading branch information
1 parent
51f1606
commit dbb28dc
Showing
17 changed files
with
150 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,51 @@ | ||
#ifndef STOCHASTIC_WF_H | ||
#define STOCHASTIC_WF_H | ||
|
||
#include "module_cell/klist.h" | ||
#include "module_base/complexmatrix.h" | ||
#include "module_cell/klist.h" | ||
#include "module_psi/psi.h" | ||
#include "module_basis/module_pw/pw_basis_k.h" | ||
|
||
//---------------------------------------------- | ||
// Generate stochastic wave functions | ||
// Generate stochastic wave functions | ||
//---------------------------------------------- | ||
class Stochastic_WF | ||
class Stochastic_WF | ||
{ | ||
public: | ||
|
||
public: | ||
Stochastic_WF(); | ||
|
||
~Stochastic_WF(); | ||
|
||
|
||
void init(K_Vectors* p_kv, const int npwx_in); | ||
void init(K_Vectors* p_kv, const int npwx_in); | ||
|
||
// origin stochastic wavefunctions in real space | ||
psi::Psi<std::complex<double>>* chi0 = nullptr; | ||
// stochastic wavefunctions after in reciprocal space orthogonalized with KS wavefunctions | ||
psi::Psi<std::complex<double>>* chiortho = nullptr; | ||
// sqrt(f(H))|chi> | ||
psi::Psi<std::complex<double>>* shchi = nullptr; | ||
int nchi = 0; // Total number of stochatic obitals | ||
int *nchip = nullptr; // The number of stochatic orbitals in current process of each k point. | ||
int nchip_max = 0; // Max number of stochastic orbitals among all k points. | ||
int nks = 0; //number of k-points | ||
int *ngk = nullptr; // ngk in klist | ||
int npwx = 0; // max ngk[ik] in all processors | ||
|
||
int nbands_diag = 0; // number of bands obtained from diagonalization | ||
|
||
int nbands_total = 0; // number of bands in total, nbands_total=nchi+nbands_diag; | ||
|
||
int nchi = 0; ///< Total number of stochatic obitals | ||
int* nchip = nullptr; ///< The number of stochatic orbitals in current process of each k point. | ||
int nchip_max = 0; ///< Max number of stochastic orbitals among all k points. | ||
int nks = 0; ///< number of k-points | ||
int* ngk = nullptr; ///< ngk in klist | ||
int npwx = 0; ///< max ngk[ik] in all processors | ||
int nbands_diag = 0; ///< number of bands obtained from diagonalization | ||
int nbands_total = 0; ///< number of bands in total, nbands_total=nchi+nbands_diag; | ||
}; | ||
//init stochastic orbitals | ||
// init stochastic orbitals | ||
void Init_Sto_Orbitals(Stochastic_WF& stowf, const int seed_in); | ||
//update stochastic orbitals | ||
// init stochastic orbitals from a large Ecut | ||
// It can test the convergence of SDFT with respect to Ecut | ||
void Init_Sto_Orbitals_Ecut(Stochastic_WF& stowf, | ||
const int seed_in, | ||
const K_Vectors& kv, | ||
const ModulePW::PW_Basis_K& wfcpw, | ||
const int max_ecut); | ||
// allocate chi0 | ||
void Allocate_Chi0(Stochastic_WF& stowf); | ||
// update stochastic orbitals | ||
void Update_Sto_Orbitals(Stochastic_WF& stowf, const int seed_in); | ||
//init complete orbitals | ||
// init complete orbitals | ||
void Init_Com_Orbitals(Stochastic_WF& stowf); | ||
#endif | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,6 +20,7 @@ | |
emax_sto 0.0 | ||
nche_sto 100 | ||
seed_sto 0 | ||
initsto_ecut 0.0 | ||
bndpar 1 | ||
kpar 1 | ||
initsto_freq 0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters