<div dir="ltr">Hi Alex,<br><br>I recently implented a tool to fit basis sets. So far it seems to work.<br>Have a look in the tests/QS/regtest-optbas<br>The idea is that you create a good reference basis set (uncontracted, expoenents from the ATOM code). With this reference basis you perform single point calculations on a set of training structures. Usually a good idea is molecules with different coordination number or the Element  with different charge states.<br>Afterwards you prepare a basis set with the desired basis set struture, e.g. DZVP-MOLOPT and run the input according to the example in the tests.<br>The optimization input contains as well some documentation to describe the different keywords in a bit more detail.<br><br>Two usuful things:<br>1) sometimes the atomic code creates almost degenerate exponents. This leads to a very bad condition number and this causes trouble in the optimization of the final basis.<br>2) currently I recommend to use the condition number as a fitting criterium as it becomes dominant at a given point and therefore the important criteria loose accuracy.<br><br>About the method:<br>The idea is a mixture of the MOLOPT idea and the ADMM method. <br>It is quite easy to get to the basis set limit with an uncontracted basis set (usually 6-7 exponents are suficient) and the electronic density derived with such a basis for different molecules should be optimal. Using the idea of the auxillary density matrix methods (ADMM) an analytical form exists to obtain the best match to that density using a different basis. Using an outer optimzation loop, this can be used to obtain the reduced basis which gives you the closest representaion of the density obtained at the basis set limit. Using a set of molecules to fit the densities should ensure transferability.<br>Technically the density difference is not the correct criterium to fit against as the energy should be optimized. Practically this is much faster and from what I did so far the results are good as well.  <br><br>Flo<br><br><br></div>