Skip to content

Commit

Permalink
Autogenerated protonic basis
Browse files Browse the repository at this point in the history
  • Loading branch information
susilehtola committed Feb 4, 2024
1 parent bae06dc commit 586a2cb
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion src/contrib/hneoci.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,34 @@ int main_guarded(int argc, char **argv) {
BasisSetLibrary baslib;
baslib.load_basis(settings.get_string("Basis"));
BasisSetLibrary pbaslib;
pbaslib.load_basis(settings.get_string("ProtonBasis"));
if(settings.get_string("ProtonBasis").size())
pbaslib.load_basis(settings.get_string("ProtonBasis"));
else {
// Automatic basis. Get element
ElementBasisSet orbbas(baslib.get_element("H"));
orbbas.decontract();

// New basis
ElementBasisSet pbas("H", 0);
// Loop over angular momentum
for(int am=0;am<=orbbas.get_max_am();am++) {
arma::vec exps;
arma::mat coeffs;
orbbas.get_primitives(exps,coeffs,am);

// Scale exponents
exps *= sqrt(proton_mass);

for(auto expn: exps) {
FunctionShell fn(am);
fn.add_exponent(1.0,expn);
pbas.add_function(fn);
}
}
pbaslib.add_element(pbas);

printf("Autogenerated protonic basis by scaling exponents by %e\n",sqrt(proton_mass));
}

std::vector<atom_t> atoms(1);
atoms[0].el="H";
Expand Down

0 comments on commit 586a2cb

Please sign in to comment.