ttadano / alamode

Ab initio simulator for thermal transport and lattice anharmonicity
http://sourceforge.net/projects/alamode
MIT License
143 stars 54 forks source link

Huge difference between Phonopy and Alamode for slab #176

Closed m-a-saleh closed 8 months ago

m-a-saleh commented 8 months ago

Dear developers,

I have a Si slab "structure attached" for which I need to calculate second-order force constants. For finite difference displacements and supercell size of 2x4x1, Phonopy produces 40 supercell displacements, while alamode produces 50 supercell displacements (input file attached).

Phonopy gives what seems to be the correct dispersion: phonopy-dispersion

I did not calculate the dispersion using the 50 displacements of alamode. However, when I use alamode to generate DFSET from the 40 displacements produced by Phonopy and calculate the dispersion, I obtain the following:

alamode-dispersion

For both Phonopy and alamode, I dont specify cut-off pair.

Attachments: slabPOSCAR.txt Alm_harm.in.txt

ttadano commented 8 months ago

One possible reason for this is inconsistency in the atomic orders in &position and DFSET converted from the phonopy data.

m-a-saleh commented 8 months ago

One possible reason for this is inconsistency in the atomic orders in &position and DFSET converted from the phonopy data.

This was actually the reason. Thanks, Dr. Tadano.

However, after calculating the dispersion with the 50 displacements suggested by alamode, I got the following dispersion with a 26% fitting error: alamode-dispersion-3

Another point: for me, it is counter-intuitive that alamode needs more displacements than Phonopy since it is based on fitting.

ttadano commented 8 months ago

Hi. The new result looks more consistent with phonopy. I would suggest that you use the primitive cell lattice parameters for the &cell field of anphon, if you didn't.

The smaller number of displacements suggested by phonopy is probably because their algorithm is more sophisticated and uses more information about the space group symmetries than the ALAMODE implementation.

m-a-saleh commented 8 months ago

Thanks, Dr. Tadano Now it is perfect alamode-dispersion4

However, I still do not know why the fitting error is big (26%) despite the OK dispersion.

Another point regarding the number of displacements, for a 1x2x1 supercell to calculate the third order force constants, the situation is reversed: Phonon3py generates ~8000 displacements, while alamode generates ~4000 displacements (&cutoff *-* None None /). Is this OK?

ttadano commented 8 months ago

The large fitting error is probably due to the residual atomic forces in the perfect supercell (no displacements). This can be easily tested by removing the residual forces following https://alamode.readthedocs.io/en/latest/faq.html.

Even if there are non-zero residual forces, the accuracy of the harmonic IFCs is not affected by this. However, the non-zero residual forces influence the accuracy of higher-order force constants, so I recommend that you subtract the offset force components from the training data following the instruction in the webpage above.

About the number of displacements for the cubic term, I'm not sure what makes that difference between phonopy and alamode. Anyways, I recommend that you use the compressive sensing approach instead of the systematic displacement method for extracting 3- and higher-order force constants.

m-a-saleh commented 8 months ago

The large fitting error is probably due to the residual atomic forces in the perfect supercell (no displacements). This can be easily tested by removing the residual forces following https://alamode.readthedocs.io/en/latest/faq.html.

This reduced the error to 10%. Thanks Dr. Tadano