Example input

1,381 views
Skip to first unread message

Ondrej Marsalek

unread,
Feb 27, 2009, 2:00:57 PM2/27/09
to cp...@googlegroups.com
Dear CP2K users,

I am interested in the method described in this paper:

Thomas D. Kuhne and Matthias Krack and Fawzi R. Mohamed and Michele
Parrinello: Efficient and Accurate Car-Parrinello-like Approach to
Born-Oppenheimer Molecular Dynamics
http://link.aps.org/abstract/PRL/v98/e066401

Unfortunately, I have trouble mapping the paper to a working
computational setup and CP2K input. Would anyone be willing to provide
an example?

Thank you,
Ondrej Marsalek

Matthias Krack

unread,
Mar 2, 2009, 3:51:39 AM3/2/09
to cp2k
Dear Ondrej,

you have to select the ENSEMBLE LANGEVIN together with the
EXTRAPOLATION ASPC (which is now the default). Activate the printing
of the RESTART_HISTORY to enable a smoother restart of consecutive
runs. Then you have to find the appropriate gamma values for your
system. Here is a CP2K input template showing the essential parts
needed for the setup:

&MOTION
&MD
ENSEMBLE LANGEVIN
&LANGEVIN
GAMMA [fs^-1] 1.0E-3 # "Langevin" gamma (adapt for your system)
NOISY_GAMMA [fs^-1] 3.0E-5 # dissipative gamma (adapt for your
system)
&END LANGEVIN
...
&END MD
&END MOTION

&FORCE_EVAL
METHOD Quickstep
...
&DFT
WFN_RESTART_FILE_NAME <project>-RESTART_HISTORY.wfn
&QS
EXTRAPOLATION ASPC
EXTRAPOLATION_ORDER 3 # find the best for your system
...
&END QS
&SCF
EPS_SCF 1.0E-7
EPS_SCF_HIST 1.0E-5
MAX_SCF 40
#MAX_SCF_HIST 2 # instead of EPS_SCF_HIST for a fixed number of SCF
steps
SCF_GUESS history_restart
...
&OT ON
MINIMIZER DIIS
PRECONDITIONER FULL_KINETIC # try the cheapest first
STEPSIZE 0.1
&END OT
&OUTER_SCF
EPS_SCF 1.0E-7
MAX_SCF 50
&END OUTER_SCF
&PRINT
&RESTART_HISTORY
ADD_LAST NUMERIC
BACKUP_COPIES 5 # ASPC order + 2
FILENAME =<project>-RESTART_HISTORY.wfn
&EACH
__ROOT__ 1
MD 1
QS_SCF 0
&END EACH
&END RESTART_HISTORY
&END PRINT
...
&END SCF

Note, the gamma values are only given to provide some reasonable
starting values w.r.t. their relative size and the order of magnitude.
You may select a fixed (very low) number of SCF iteration steps using
MAX_SCF_HIST or a less tight SCF convergence criterion using
EPS_SCF_HIST. Please, keep in mind that the procedure only pays back,
if you are planning long simulation runs, since setup, thermalization
and the adjustment of the gamma values requires already several ps of
simulation time.

Best regards,

Matthias


On Feb 27, 8:00 pm, Ondrej Marsalek <ondrej.marsa...@gmail.com> wrote:
> Dear CP2K users,
>
> I am interested in the method described in this paper:
>
> Thomas D. Kuhne and Matthias Krack and Fawzi R. Mohamed and Michele
> Parrinello: Efficient and Accurate Car-Parrinello-like Approach to
> Born-Oppenheimer Molecular Dynamicshttp://link.aps.org/abstract/PRL/v98/e066401

Ondrej Marsalek

unread,
Mar 4, 2009, 5:29:20 AM3/4/09
to cp...@googlegroups.com
Dear Matthias,

thank you for the detailed information. In the meantime I have found
and old post at the BerliOS forum, but it was much more brief, so this
is definitely useful. I have also managed to get the relevant cited
papers and will work on this as soon as I get back to my computer. I
may have more questions then, but at the moment I think I understand
it.

I do realize that this is only suitable for longer runs, but that is
exactly the reason I am interested in it.

By the way, the Ricci and Ciccotti paper (Langevin dynamics
propagator) is cited in your PRL paper and is also mentioned in the
source code, maybe it would be a good idea to include it in the
"official" CP2K references.

Best regards,
Ondrej

Ondrej Marsalek

unread,
Mar 19, 2009, 5:27:50 AM3/19/09
to cp...@googlegroups.com
Hi again,

so far, I have only tested a short run of a neat 32 water cluster and
it blew up after about 1.5 ps. I have used

&LANGEVIN
GAMMA [fs^-1] 1.0E-2
NOISY_GAMMA [fs^-1] 9.0E-5
&END LANGEVIN

I will try to use a better equilibrated initial condition and tweak
the setup. If I am not able to make it work, I'll post more details
and some specific questions.

I also have one question about the paper

Thomas D. Kuhne and Matthias Krack and Michele Parrinello:
Static and Dynamical Properties of Liquid Water from First Principles
by a Novel Car−Parrinello-like Approach

It says "... we perform a preliminary run in which we vary gamma_D on
the fly...". Is there a way to do that in CP2K or was it done "by
hand"?

Thanks,
Ondrej


On Mon, Mar 2, 2009 at 09:51, Matthias Krack <matthia...@psi.ch> wrote:
>

Matthias Krack

unread,
Mar 19, 2009, 6:03:04 AM3/19/09
to cp2k
Hi Ondrej,

it has to be done by hand, since there is no automatic procedure, yet.
You may start with a gamma like 0.001/fs and noisy_gamma=0.0/fs.
You will most likely observe a drift (drop) of the total energy.
The actual drift will mostly depend on your QS and SCF settings and
thus keep these settings fixed. Then you increase noisy_gamma until
the drift is compensated. Simultaneously, these runs may contribute
to the thermalisation of the sample. Note, this is just one possible
protocol and there might be alternative protocols to achieve the same
goal.

Matthias

On Mar 19, 10:27 am, Ondrej Marsalek <ondrej.marsa...@gmail.com>
wrote:
> Hi again,
>
> so far, I have only tested a short run of a neat 32 water cluster and
> it blew up after about 1.5 ps. I have used
>
> &LANGEVIN
> GAMMA [fs^-1] 1.0E-2
> NOISY_GAMMA [fs^-1] 9.0E-5
> &END LANGEVIN
>
> I will try to use a better equilibrated initial condition and tweak
> the setup. If I am not able to make it work, I'll post more details
> and some specific questions.
>
> I also have one question about the paper
>
> Thomas D. Kuhne and Matthias Krack and Michele Parrinello:
> Static and Dynamical Properties of Liquid Water from First Principles
> by a Novel Car-Parrinello-like Approach
>
> It says "... we perform a preliminary run in which we vary gamma_D on
> the fly...". Is there a way to do that in CP2K or was it done "by
> hand"?
>
> Thanks,
> Ondrej
>

Ondrej Marsalek

unread,
Mar 21, 2009, 12:29:34 PM3/21/09
to cp...@googlegroups.com
Hi again,

I am doing some test runs and hopefully making some progress. One thing
does not work as expected, though. I have the following SCF section:

&SCF
EPS_SCF 1.0E-7
MAX_SCF 30
EPS_SCF_HIST 1.0E-4
SCF_GUESS atomic
&OT
MINIMIZER DIIS
PRECONDITIONER FULL_KINETIC
STEPSIZE 0.1
&END OT
&OUTER_SCF T
MAX_SCF 50
EPS_SCF 1.0E-7
&END OUTER_SCF
&PRINT
&RESTART_HISTORY
ADD_LAST NUMERIC
BACKUP_COPIES 7
FILENAME =W32-neat-RESTART_HISTORY.wfn
&EACH
__ROOT__ 1
MD 1
QS_SCF 0
&END EACH
&END RESTART_HISTORY
&END PRINT
&END SCF

After collecting enough points for the extrapolation, the outer SCF loop
never converges. There is always just one inner SCF iteration (as it
stays below EPS_SCF_HIST all the time) and then the next outer SCF
interation, until the limit of 50 iteration is exceeded. It looks like
the outer SCF is trying to reach its EPS_SCF. When I exchange SCF /
EPS_SCF_HIST for SCF / MAX_SCF_HIST, it works fine.

Thanks for any help,
Ondrej

Ondrej Marsalek

unread,
Mar 21, 2009, 1:56:05 PM3/21/09
to cp...@googlegroups.com
Allow me to explore this further "aloud".

Looking at the code, it seems that the idea is to switch off the outer
SCF cycle if there is enough wfn history and either SCF/MAX_SCF_HIST or
SCF/EPS_SCF_HIST are set. There is a subroutine for doing that,
wfi_set_history_variables() in file qs_wf_history_methods.F. Then, there
is the following switch:

qs_wf_history_methods.F:832: SELECT CASE (actual_extrapolation_method_nr)

for each of its cases, the mentioned subroutine gets called, except for
cases wfi_linear_ps_method_nr and wfi_aspc_nr, where a similar thing is
done with explicit code instead of the call. The difference is that the
explicit code fails to disable the outer SCF loop (or rather decrease
its EPS_SCF) in the case that only SCF/EPS_SCF_HIST is set.

It seems that exchanging the explicit code for the call would resolve
the issue.

One more thought in this area. It could be useful to mention in the
input manual that setting MAX_SCF_HIST disables the outer SCF loop once
we are in the "history pipeline filled" regime.

Cheers,
Ondrej

PS: As a quick fix to the previous issue without recompilation, I have
set SCF/MAX_SCF_HIST to an arbitrary value that is high enough not to
influence the run.
Reply all
Reply to author
Forward
0 new messages