# [CP2K-user] [CP2K:12891] How to determine number of ADDED_MOS?

Tiziano Müller tiziano... at chem.uzh.ch
Mon Feb 17 15:56:28 UTC 2020

```Hi Stacey,

pretty sure others can give a better explanation/motivation, but for my
high-throughput calculations it has proven fruitful to take a value of
30% of the total number of (non-primitive) basis functions for ADDED_MOS.
In fact I'm using the following Python-snippet to calculate that number
prior to running a calculation:

>         if 'smear' in scf.keys() and 'added_mos' not in scf.keys():
>             n_mos = 0
>             # when calculating the number of MOs on the other hand, we only want the default (for CP2K the "ORB")
>             # type of basis sets since we don't want to count the AUX/RI/.. sets as well
>             for _, _, element, _, basis in [b for b in basis_sets if b[0] == 'default']:
>                 basis_lines = basis.split('\n')
>                 nsets = int(basis_lines[0])
>                 lineno = 1  # start at the first set
>                 for _ in range(nsets):
>                     # the number of MOs depends on the basis set
>                     econfig_string = basis_lines[lineno]
>                     econfig = [int(n) for n in econfig_string.split()]
>                     # sum over (the number of m's per l quantum number times
>                     # the number of functions per m) times the number of atoms of this kind:
>                     n_mos += syms.count(element)*np.dot([2*l+1 for l in range(econfig[1], econfig[2]+1)], econfig[4:])
>                     lineno += int(econfig[3]) + 1  # skip the block of coefficients and go to the next set
>
>             scf['added_mos'] = max(int(0.3*n_mos), 1)  # at least one MO must be added

Best,
Tiziano

On 15.02.20 18:28, MD Simulation wrote:
> Hello,
>
> How can I determine the best number of ADDED_MOS?
>
> Thanks
> Stacey
>
> --
> You received this message because you are subscribed to the Google
> Groups "cp2k" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to cp... at googlegroups.com
> <mailto:cp... at googlegroups.com>.
> To view this discussion on the web visit

--
Tiziano Müller
University of Zurich
Department of Chemistry
Winterthurerstrasse 190
CH-8057 Zürich

Tel: +41 44 63 54234
www.chem.uzh.ch
tiziano... at chem.uzh.ch

```