Skip to content

Commit

Permalink
Truncation of Gaussian expansion of integral kernel in SeparatedConvo…
Browse files Browse the repository at this point in the history
…lution can be controlled by the user, if needed; the default is unchanged (truncate the expansion if periodic, not otherwise)
  • Loading branch information
evaleev committed Nov 13, 2024
1 parent afa1122 commit 9ed6314
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/madness/mra/operator.h
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,9 @@ namespace madness {

// WARNING! More fine-grained control over the last argument is needed.
// This is a hotfix.
if (bc(0,0) == BC_PERIODIC) {
if (info.truncate_lowexp_gaussians.value_or(bc(0,0) == BC_PERIODIC)) {
fit.truncate_periodic_expansion(coeff, expnt, cell_width.max(), true);
info.truncate_lowexp_gaussians = true;
}

return std::make_pair(coeff,expnt);
Expand Down
3 changes: 2 additions & 1 deletion src/madness/mra/operatorinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,14 @@ std::ostream& operator<<(std::ostream& os, const OpType type) {

struct OperatorInfo {
OperatorInfo() = default;
OperatorInfo(double mu, double lo, double thresh, OpType type) : mu(mu), lo(lo), thresh(thresh), type(type) { }
OperatorInfo(double mu, double lo, double thresh, OpType type, std::optional<bool> truncate = {}) : mu(mu), lo(lo), thresh(thresh), type(type), truncate_lowexp_gaussians(truncate) { }
double mu=0.0; ///< some introspection
double lo=1.e-5;
double thresh=1.e-4;
OpType type=OT_UNDEFINED; ///< introspection
double hi=-1.0;
bool debug=false;
std::optional<bool> truncate_lowexp_gaussians; // if given, overrides the default for whether to truncate low-exponent gaussians
};


Expand Down

0 comments on commit 9ed6314

Please sign in to comment.