SCF_GUESS: using restart with atomic guess for additional atoms

505 views
Skip to first unread message

Fabian Ducry

unread,
Feb 3, 2020, 5:12:03 AM2/3/20
to cp2k
Dear all,

I have a substrate (several 100 atoms) and want to iteratively add atoms onto its surface. Because the number of atoms changes every step, I have to minimize the charge density from the atomic guess each time. To speed-up the calculations I would like to re-use the previous restart wave function (the substrate is identical and the new atom rather far from the surface). Is there an option to mix the restart wave function with atomic orbitals to build the initial guess for the energy minimization?

If I set FORCE_EVAL%DFT%SCF%SCF_GUESS%RESTART
The following warning appears:

READ RESTART : WARNING : DIFFERENT natom, returning 331 330
Atomic guess: The first density matrix is obtained in terms of atomic orbitals
and electronic configurations assigned to each atomic kind

How can I tell CP2K to reuse the previous wave function for all except for the last atom?

Regards,
Fabian

Matt W

unread,
Feb 4, 2020, 2:09:06 PM2/4/20
to cp2k
This should be an enhancement request, it would be a very beneficial feature.

I have hacky code to add floating orbitals for STM. It  would also be good for BSSE and other applications.

Matt

Fabian Ducry

unread,
Feb 4, 2020, 3:34:05 PM2/4/20
to cp2k
Thanks for the answer! How can I file an enhancement request?

I could possibly hack something together to work for my specific case. But from looking at the source code I doubt I could implement this in a nice way.

Fabian

Sergey Chulkov

unread,
Feb 10, 2020, 7:04:51 AM2/10/20
to cp2k
Hi Fabian

You can find a basic implementation of this feature in cp2k 7.1 as a branch 'v7.1.0-atomic_restart' here. In order to use atomic guess together with a previously written restart file, please append new atoms to the end of your &COORD section or xyz file, and then enable this feature as 'SCF_GUESS atomic_restart'.

Many features available for the regular restart guess have not been ported yet for the hybrid atomic/restart guess. Among them are RTP wave-functions, k-points, the ability to reduce the size of the basis set and to change the number of spin-components of the wave-function. For a complete implementation there should be a way to recompute the electron density on a 3D grid by using MOs from the restart file. In order to do so, original atomic positions and the basis set need to be known. One option could be to save this information into the wave-function restart file along with MO coefficients. In addition to the generic atomic/restart guess, it will also allow to reorder atoms in &COORD section. The problem is that it will break backward compatibility.

Sergey


On Monday, February 3, 2020 at 10:12:03 AM UTC, Fabian Ducry wrote:

Fabian Ducry

unread,
Feb 10, 2020, 1:07:56 PM2/10/20
to cp2k
Hi Sergey,

Thanks a lot, this is perfect! I will give it a go.

Best,
Fabian

Fabian Ducry

unread,
Mar 31, 2020, 11:23:32 AM3/31/20
to cp2k
Hi Sergey,

The code works well and can indeed reduce the number of required SCF iterations considerably. There is one caveat though, I had to add the following lines to qs_initial_guess.F before the call to

CALL calculate_atomic_orbitals(atomic_kind, qs_kind, iunit=ounit, &
                                        pmat=pmat(ikind)%mat, nocc=nocc)

in SUBROUTINE calculate_atomic_block_dm

         write(*,*) ikind, nkind
         write(*,*) nocc
         write(*,*) TRIM(atomic_kind%name)

Without them I always got an undefined reference error and cp2k crashed, with them everything works as intended. This happens only with the ATOMIC_RESTART. Using the ATOMIC guess cp2k runs without the print statements.

To compile cp2k I use the toolchain with gfortran both on Piz Daint and a local cluster.

Thanks again for the feature,
Fabian
Reply all
Reply to author
Forward
0 new messages