(Please read the contribution guidelines.)
(Describe the features and/or changes that are introduced by this merge request)
(If needed provide comments on what to consider during review, motivations for certain design choices, known shortcomings etc)
(Provide a summary of the key changes to files, preferably in the form of a list)
(List related issues)
Now the newest version is 1.1, I want to know what are the updates compared with version 0.7?
OK, I get it. Thanks.
Now the newest version is 1.1, I want to know what are the updates compared with version 0.7?
I think you could either train second and third-order at the same time, e.g. by using cutoffs [9.5, 5.0]
or you can train them in sequence e.g. first train a harmonic model with cutoffs [9.5]
, and then train a third-order using the residual forces (forces_dft-forces_fc2
) with cutoffs [0.0, 5.0]
.
You can see how the sequential fitting is done in practice here.
From our limited experience and testing it seems like the sequential approach might be better for thermal conductivity, but it is hard to say. Usually sequential and the standard method yield roughly the same thermal conductivity. I think the best thing to do is to try both and see if they agree or not.
If you want to obtain the effective phonon dispersion at a specific temperature, then you should not include any higher-order terms when training. There is maybe some useful info in this example.
I think its directly analogues to polynomial fitting, imagine f_true(x) = x^2 + x^4
, if you now fit a harmonic model (f_model = a x^2
, a
is unknown parameter) to some data points given by f_true(x)
you will end up with a value of a > 1
because of "renormalization" due to the x^4
term. However, if you include the x^4
term in your model (f_model = a x^2 + b x^4
), then you will simple get a=1.0
, as in f_true
, and no renormalization happens. Maybe not explained very well, but hopefully it makes some sense.
Dear developer:
I extracted displacements and forces from AIMD and then I would like to extract force constant with hiphive. When training the data, I can get FC2 with cutoff=[9.5], and it can give phonon dispersion without any imaginary freqency. I can also get FC2 with cutoff=[9.5,5]. The FC2 calculated from cutoff=[9.5,5] can give much more higher optical phonon energy. I think the higher optical phonon energy may result from fitting with cutoff=[9.5,5] make FC2 include anharmonic effect. Now, I have two question:
Which FC2 should I choose to calculate thermal conductvity?
If I would like to discuss about the temperature effect on harmonic phonon dispersion, which FC2 should I choose? I read many papers mentioned anharmonic phonon renormalization. Did that anharmonic phonon renormalization mean traing FC2 must include the anharmonic effect,such as training data with cutoff=[9.5,5,..]?
Looking forward to your reply.
Best regards;
Yongheng Li
Hi Jose!
I have fixed the issue with convs=None now, so if you pull the branch you should be able to run without it.
The interface of the convergence part is not optimal as of now. The last bit of code is not workings since self_consistent_harmonic_model expects convs to be a list (which is not optimal, I know). So if you change it to:
convergence = FreeEnergy(T= T, free_energy_difference= 0.01)
parameters_traj = self_consistent_harmonic_model(sc, calc, cs2, T, alpha, n_iterations,
n_structures, convs=[convergence], imag_freq_factor=10)
It should work.
Furthermore, the free energy is per atom so I think a smaller criteria can be used. Lastly, if you decide to use the unfinished convs part please validate that your model really is converged if you use this, since this is far from properly tested.
Petter Rosander (e1f43709) at 10 Jun 11:44
Fixed convs=None
Dear hiPhive developers,
I have followed your suggestions and I am using the branch that Petter is developing.
First, I think I have found a bug. If you use the default: convs=None
, you get an error here:
if convs:
_converged_ = []
for conv in convs:
_converged_.append(conv.check_condition(
fcs, phonon_rattled_structures))
converged = True if np.all(_converged_) else False
if converged:
print('Convergence criteria fulfilled')
break
Because converged is created inside convs. If cons=None, converged is not defined and you get an error message at "if converged"
I have been trying to use one of the two class you defined for convs (Free Energy) but I am doing something wrong because I get an erro saying that 'FreeEnergy' object is not iterable. My code looks like this:
from hiphive.self_consistent_phonons import FreeEnergy
convergence = FreeEnergy(T= T, free_energy_difference= 0.01)
parameters_traj = self_consistent_harmonic_model(sc, calc, cs2, T, alpha, n_iterations, n_structures, convs=convergence, imag_freq_factor=10)
Thanks in advance for your help,
Jose J. Plata
Thanks again for your fast answer. I was trying to follow the strategy I exposed in my last comments but I found It is not something straightforward (at least for me)
I have my 0K FCP (which contains 2nd, 3rd and 4th order contributions) and using SCPH I can get a FCP at XX K. However, It is not clear to me 1) how to combine both to create a FCP that contains 2nd order contributions from FCP XX K and high order contributions from 0K FCP. 2) Even if it is doable, after thinking about it, I am not sure if that is physically correct. Some anharmonic effects will be double counting with that "mixed" FCP.
Thanks in advances for your help,
Jose
@jjplata Yes I think your understanding is correct. It could definitely be a good idea to start the SCPH with parameters from a lower temperature.
Note that this error can also occur without imaginary frequencies due to high temperatures simply leading to large displacements.
Dear all,
Thank you for your fast answers. If I understood properly, the problem comes from the imaginary frequencies that the material presents at 0K. When I use the 0K FCP at high "high temperatures" for SCPH, the distortions could be too large and one of the routines that is mapping the atoms closer to their equilibrium positions is giving the error.
SCPH is working well for my system at low temperatures (100 and 200K) and most imaginary frequencies are gone at those temperatures. Do you think that it could be a good idea feed SCPH with a the FCP obtained from a previous SCPH calculation at lower temperature?
Petter Rosander (6d937147) at 08 Jun 08:10
small fix in scph and utilities fro find_permutations
Petter Rosander (c1149fc3) at 08 Jun 08:07
changed order of arguments in find_permutation
Yes, there is a branch, imaginary-frequency-treatment-factor. This branch also includes some other changes as well, as the name suggests. However, The default function values for these new parameters should produce the old behavior. The branch is, as of now, still untested though except from a few manual runs (which looks ok).
The branch should, however, give you an idea of how you can modify the code yourself to fix this issue (as suggested by Fredrik).
Petter Rosander (03967d82) at 08 Jun 07:52
scph updated to handle find_permutation issue and potential converg...