Printing E_DENSITY_CUBE at each SCF step

88 views
Skip to first unread message

Léon Luntadila Lufungula

unread,
Jan 27, 2025, 10:13:12 AM1/27/25
to cp2k
Dear all,

For teaching purposes I wanted to print the electron density at each SCF step to show to my students how the electron density varies going from the initial superposition of atomic densities to the final molecular density. However, even with the FORCE_EVAL/DFT/PRINT/E_DENSITY_CUBE/EACH/QS_SCF parameter set to 1 it does not print the cube files within a SCF loop, only those for each GEO_OPT step. 

I've tried setting the SECTION_PARAMETERS for E_DENSITY_CUBE to MEDIUM, HIGH and even DEBUG, but this even stopped printing them alltogether, while ON or SILENT prints only those of the GEO_OPT calculation. Therefore, I was wondering if there is a way to do this or if it is just impossible to do at present?

Kind regards,
Léon
H2.inp

Léon Luntadila Lufungula

unread,
Jan 27, 2025, 10:16:23 AM1/27/25
to cp2k
P.S. The input file I provided was the one with E_DENSITY_CUBE set to MEDIUM, so this will not give any cube files if someone were to try it out. In attachment you can find the input file with the MEDIUM keyword removed.
H2.inp

Krack Matthias

unread,
Jan 27, 2025, 10:37:40 AM1/27/25
to cp...@googlegroups.com

Dear Léon

 

The E_DENSITY_CUBE file data are only calculated in CP2K’s post-SCF routine and therefore the QS_SCF parameter does not have any impact. As a workaround, you can either try to hack the code or force a stop of the SCF iteration after different numbers of SCF steps using the MAX_SCF input parameter.

 

HTH

 

Matthias

 

--
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 cp2k+uns...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/cp2k/f409a3b0-df31-4f39-994a-c2560eea6d6dn%40googlegroups.com.

Message has been deleted

Léon Luntadila Lufungula

unread,
Jan 28, 2025, 4:29:16 AM1/28/25
to cp2k
Dear Matthias,

I have tried your suggestion and it seems to work, but I get the feeling that the electron density for MAX_SCF=1 is not a superposition of atomic densities but already a modified electron density after one SCF cycle (visualizing it for the H2 molecule shows an asymmetric density). Is it possible to print the initial guess density for SCF_GUESS=ATOMIC? Setting MAX_SCF=0 doesn't print the electron density at all...

Kind regards,
Léon

H2-1.inp

Krack Matthias

unread,
Jan 28, 2025, 5:06:00 AM1/28/25
to cp...@googlegroups.com

Dear Léon

 

I am afraid that printing the initial density guess as a cube file requires a code change.

 

Best

 

Matthias

 

--

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 cp2k+uns...@googlegroups.com.

Jürg Hutter

unread,
Jan 28, 2025, 5:21:44 AM1/28/25
to cp...@googlegroups.com
Hi

you can try with density mixing and alpha = 0.0 and stop after 1 iteration.
Not tested, but might work.

regards
JH

________________________________________
From: cp...@googlegroups.com <cp...@googlegroups.com> on behalf of Krack Matthias <matthia...@psi.ch>
Sent: Tuesday, January 28, 2025 11:05 AM
To: cp...@googlegroups.com
Subject: Re: [CP2K:21082] Re: Printing E_DENSITY_CUBE at each SCF step

Dear Léon

I am afraid that printing the initial density guess as a cube file requires a code change.

Best

Matthias

From: cp...@googlegroups.com <cp...@googlegroups.com> on behalf of Léon Luntadila Lufungula <Leon.luntad...@uantwerpen.be>
Date: Tuesday, 28 January 2025 at 10:29
To: cp2k <cp...@googlegroups.com>
Subject: Re: [CP2K:21081] Re: Printing E_DENSITY_CUBE at each SCF step
Dear Matthias,

I have tried your suggestion and it seems to work, but I get the feeling that the electron density for MAX_SCF=1 is not a superposition of atomic densities but already a modified electron density after one SCF cycle (visualizing it for the H2 molecule shows an asymmetric density). Is it possible to print the initial guess density for SCF_GUESS=ATOMIC? Setting MAX_SCF=0 doesn't print the electron density at all...

Kind regards,
Léon

--
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 cp2k+uns...@googlegroups.com<mailto:cp2k+uns...@googlegroups.com>.
To view this discussion visit https://groups.google.com/d/msgid/cp2k/ede712a3-5d34-439e-b756-7bbb8ac247b1n%40googlegroups.com<https://groups.google.com/d/msgid/cp2k/ede712a3-5d34-439e-b756-7bbb8ac247b1n%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
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 cp2k+uns...@googlegroups.com<mailto:cp2k+uns...@googlegroups.com>.
To view this discussion visit https://groups.google.com/d/msgid/cp2k/ZRAP278MB082727662F4F6C83F3FB0EAEF4EF2%40ZRAP278MB0827.CHEP278.PROD.OUTLOOK.COM<https://groups.google.com/d/msgid/cp2k/ZRAP278MB082727662F4F6C83F3FB0EAEF4EF2%40ZRAP278MB0827.CHEP278.PROD.OUTLOOK.COM?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages