[CP2K-user] [CP2K:19562] Re: dRe: Ehrenfest + Field problem for version 2023.2
Natalia K
natalja.lipina at gmail.com
Fri Nov 24 08:55:00 UTC 2023
Dear Guillaume,
thank you for your suggestions. I installed the version 2022.2 and
performed the same test. I also tried velocity gauge with version 2023.2.
Contrary to your expectations, versions 9.1 and 2022.2 give me the same
results, different from 2023.2. As to velocity gauge, it doesn't make sense
either. Both velocity and length gauge calculations with v2023.2 make the
least sense of all when I compare to the reference. With velocity gauge,
the kinetic energy grows very fast. Also the calculation is very slow. If
with the length gauge, each EMD step takes about 3 iterations to converge,
with the velocity gauge, it takes 20 iterations. Usually, for small
systems, both velocity and Coulomb gauge should be equivalent, which they
are not here.
I attach two figures: 1) kinetic energy vs time comparing v2023.2 velocity
and length gauge; 2) N-N bond distance comparing all the versions I tried +
the reference result from Aikens paper.
Natalia
On Monday, November 20, 2023 at 3:16:07 PM UTC+1 Guillaume Le Breton wrote:
> Dear Natalia,
>
> This calculation is done without PBC and with the length gauge (position
> operator with the electric field). Another possibility would be to use the
> velocity gauge (momentum operator with the vector potential) instead. The
> velocity gauge should work with and without PBC, and thus is rather used in
> other codes instead of the length gauge (for instance OCTOPUS, I am not
> sure for Gaussian). I implemented the velocity gauge approach for Real-Time
> Propagation in February and very recently for Ehrenfest Dynamics. In the
> latest version of CP2K you have both methods available. To use the velocity
> gauge, set &REAL_TIME_PROPAGATION&VELOCITY_GAUGE to TRUE.
>
> CP2K uses an atomic-centered basis set to describe the electronic degree
> of freedom. With the Ehrenfest Molecular Dynamics (EMD), an extra term
> appears in the force applied to the nuclei due to this basis set choice.
> This force is slightly different for the length and velocity gauge. This
> should not be a problem with short wave-length, but may be in your case.
> Hence, I would recommend to:
>
> - Run with the latest version of the code EMD in the length and velocity
> gauge, REAL_TIME_PROPAGATION&VELOCITY_GAUGE set to False and True
> respectively
> - Run with version 2022.2 EMD in the length gauge.
>
> I hope that:
> - version 2022.2 and the latest one match in the length gauge.
> - length and velocity gauge do not lead to the same nuclei dynamics using
> the latest CP2K version. The velocity gauge being closer to the result
> observed in other codes.
>
> If you observe such things, it would mean that the difference between your
> calculation and the one from the literature comes from the choice of the
> gauge. In that case, you should use the velocity one.
> Yet, it would not explain the difference between version 9.1 and 2023.2.
>
> Best,
> Guillaume
>
>
>
>
> Le lundi 20 novembre 2023 à 13:57:43 UTC+1, Natalia K a écrit :
>
>> Dear Guillaume,
>>
>> thank you very much for your answer! As you suggested, I repeated the
>> calculations setting the temperature to 0K. The results are a bit
>> different, but the observations are the same. The temperature and the
>> kinetic energy are different from the two versions of the code (see
>> attached).
>>
>> The oscillations in the N-N bond distance may have two components. The
>> higher frequency oscillations corresponding to the external field (there is
>> a charge oscillation between Ag and N with the frequency of the external
>> field). The lower frequency oscillations may be the vibrational frequency
>> of N2. Yet, in none of the publications doing similar simulations, I see
>> the bond oscillating with two frequencies, always with only one, much
>> lower than the external field (results not only from the Gaussian code but
>> also from OCTOPUS).
>>
>> Are there any differences between the Ehrenfest implementations in the
>> two versions? I really need to know which version I can trust.
>>
>> Best regards,
>>
>> Natalia
>>
>> On Thursday, November 16, 2023 at 10:44:19 AM UTC+1 Guillaume Le Breton
>> wrote:
>>
>>> Dear Natalia,
>>>
>>> First of all, your threshold regarding the RTP seems reasonable and I do
>>> agree that using GGAs compared to Hybrids should not be a problem as long
>>> as you match the field frequency with the transition targetted.
>>>
>>> The dipole moment and the potential energy oscillate at the field
>>> frequency for both calculations as expected. The evolution of the kinetic
>>> energy and the NN bond for version 9.1 seems to match the one from the
>>> paper: the oscillation period is about 20 fs. Yet, this is a bit weird
>>> since it is not the same as the one of the field! In version 2022.2, the
>>> kinetic energy is quite different but the period of the oscillation seems
>>> to match the one of the field. I would assume that there is two time scale:
>>> one related to the ''instantaneous adaptation of the system'' and another
>>> one related to a slower evolution due to the excitation process. For
>>> instance, bottom right part of Figure 6: the electronic population evolved
>>> slowly toward a full excitation but with an oscillation at the field
>>> frequency. Hence, not observing a response of the nuclei at the field
>>> period is a bit concerning from my point of view. Yet, I am not sure
>>> whether or not this difference should be expected (for instance due to the
>>> implementation of Ehrenfest in the Gaussian code compared to CP2K).
>>>
>>> One potential problem could be the initial conditions: the temperature
>>> is non-zero in your input file. Could you try a run with a zero temperature
>>> to get rid of any potential problems due to the initial conditions for both
>>> versions?
>>>
>>> Best regards,
>>> Guillaume
>>>
>>> Le lundi 13 novembre 2023 à 10:28:49 UTC+1, Natalia K a écrit :
>>>
>>>> Dear Guillaume,
>>>>
>>>> thank you for your instructions. After applying the patch, and making
>>>> sure the test files are correct, I ran calculations comparing the latest
>>>> version 2023.2 (with the patch) with the version 9.1, that I was previously
>>>> using, for the system Ag6-N2. The results are different. Namely, the
>>>> kinetic energy is significantly different (and consequently the atomic
>>>> motion). This calculation is similar to the one from
>>>> https://dx.doi.org/10.1021/acs.jpcc.0c02979?ref=pdf, where on Fig.6
>>>> (middle left) they show the N-N bond change with time. Their result is
>>>> obtained with the Gaussian code. With all the parameters similar to theirs
>>>> (except the XC functional, they use hybrid and I use GGA, but I don't think
>>>> it is important), CP2K-v9.1 gives similar result, while v2023.2 does not. I
>>>> attach my results and the input file I used in both calculations below.
>>>>
>>>> Best regards,
>>>>
>>>> Natalia
>>>>
>>>> On Thursday, October 12, 2023 at 10:54:18 AM UTC+2 Guillaume Le Breton
>>>> wrote:
>>>>
>>>>> Dear CP2K community,
>>>>>
>>>>> On 24 February 2023 I made some changes in the Real-Time calculation
>>>>> part of the code which turned out to break one specific behavior: Ehrenfest
>>>>> Dynamics with a time-dependent field. This has been fixed the 9 October
>>>>> 2023.
>>>>>
>>>>> Thus, if you are using Ehrenfest Dynamics with a time-dependent field,
>>>>> you are NOT impacted if:
>>>>>
>>>>> - You are using a version before 24.02.2023. This includes V2023.1 and
>>>>> the previous ones.
>>>>> - The master branch from 09.10.2023.
>>>>>
>>>>> You ARE impacted if:
>>>>> - You are using a version between 24.02.2023 and 09.10.2023. This
>>>>> includes V2023.2.
>>>>>
>>>>> If you are impacted, I recommend you rerun your simulations (involving
>>>>> Ehrenfest + Field) with the newest version of the code as the issue is
>>>>> quite important. If you want to keep using version 2023.2, here is a patch
>>>>> to solve this problem.
>>>>>
>>>>> 1) Download the patch and untar it.
>>>>> 2) Apply the patch using the patch command in the shell:
>>>>>
>>>>> $> patch cp2k/src/qs_force.F qs_force.patch
>>>>> $> patch cp2k/tests/QS/regtest-rtp-2/TEST_FILES TEST_FILES.patch
>>>>>
>>>>> To check that the patch has been applied correctly, open the
>>>>> cp2k/tests/QS/regtest-rtp-2/TEST_FILES file. Line 11 should be:
>>>>>
>>>>> H2-emd-efield.inp 2 4e-11
>>>>> -0.894818188949
>>>>>
>>>>> 3) recompile the code and run regtests.
>>>>>
>>>>> I sincerely apologize for this problem.
>>>>>
>>>>> Guillaume Le Breton
>>>>
>>>>
--
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+unsubscribe at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cp2k/9289c56a-2802-4921-834a-30d8ebc2a126n%40googlegroups.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20231124/c9323372/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kin-energy.png
Type: image/png
Size: 53075 bytes
Desc: not available
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20231124/c9323372/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: N-N-distance-all-versions.png
Type: image/png
Size: 31170 bytes
Desc: not available
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20231124/c9323372/attachment-0003.png>
More information about the CP2K-user
mailing list