File tree 1 file changed +28
-1
lines changed
1 file changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -106,7 +106,34 @@ int main_guarded(int argc, char **argv) {
106
106
BasisSetLibrary baslib;
107
107
baslib.load_basis (settings.get_string (" Basis" ));
108
108
BasisSetLibrary pbaslib;
109
- pbaslib.load_basis (settings.get_string (" ProtonBasis" ));
109
+ if (settings.get_string (" ProtonBasis" ).size ())
110
+ pbaslib.load_basis (settings.get_string (" ProtonBasis" ));
111
+ else {
112
+ // Automatic basis. Get element
113
+ ElementBasisSet orbbas (baslib.get_element (" H" ));
114
+ orbbas.decontract ();
115
+
116
+ // New basis
117
+ ElementBasisSet pbas (" H" , 0 );
118
+ // Loop over angular momentum
119
+ for (int am=0 ;am<=orbbas.get_max_am ();am++) {
120
+ arma::vec exps;
121
+ arma::mat coeffs;
122
+ orbbas.get_primitives (exps,coeffs,am);
123
+
124
+ // Scale exponents
125
+ exps *= sqrt (proton_mass);
126
+
127
+ for (auto expn: exps) {
128
+ FunctionShell fn (am);
129
+ fn.add_exponent (1.0 ,expn);
130
+ pbas.add_function (fn);
131
+ }
132
+ }
133
+ pbaslib.add_element (pbas);
134
+
135
+ printf (" Autogenerated protonic basis by scaling exponents by %e\n " ,sqrt (proton_mass));
136
+ }
110
137
111
138
std::vector<atom_t > atoms (1 );
112
139
atoms[0 ].el =" H" ;
You can’t perform that action at this time.
0 commit comments