phonopy / phonopy

Phonon code
http://phonopy.github.io/phonopy/
BSD 3-Clause "New" or "Revised" License
347 stars 215 forks source link

Isotope mass is replaced by default mass when creating supercells #415

Closed pablogila closed 3 weeks ago

pablogila commented 3 weeks ago

Hello there,

I am creating supercells for a fully deuterated material in Quantum ESPRESSO. The scf.in input file to create the supercells contains the following ATOMIC_SPECIES. Note that H has been provided with the deuterium mass (2 amu) in order to perform a deuterium calculation:

ATOMIC_SPECIES
   H    2.01410   H.upf
   C   12.01060   C.upf
   I  126.90400   I.upf
   N   14.00650   N.upf
  Pb  207.20000  Pb.upf

The bug occurs when creating supercells with

phonopy --qe -d --dim="2 2 2" -c scf.in

This creates supercells with the default mass of hydrogen instead of deuterium.
See the ATOMIC_SPECIES in all the new supercell files:

ATOMIC_SPECIES
 Pb  207.20000   Pb.upf
  I  126.90447   I.upf
  N   14.00670   N.upf
  C   12.01070   C.upf
  H    1.00794   H.upf

Of course, the expected behaviour would be to preserve the atomic mass introduced in the input, instead of the default one.

This behaviour was not observed when the atomic species symbol was unknown to Phonopy and was replaced by a random one, as mentioned in issue #412, where the atomic mass remained as originally introduced, although the atomic symbol was changed.

atztogo commented 3 weeks ago

Phonopy doesn't read masses from scf.in. You have to specify them with mass tag, https://phonopy.github.io/phonopy/setting-tags.html#mass. If you want to support reading masses from scf.in, you have to modify https://github.com/phonopy/phonopy/blob/develop/phonopy/interface/qe.py. However, this is also related to crystal symmetry. When your input is not a primitive cell, then you have to carefully check the relationship between crystal symmetry and a list of masses of your input file. To avoid this complexity, phonopy accepts masses of primitive cell.

pablogila commented 3 weeks ago

Sorry for the confusion, and thanks for the clarification. Moved the relevant discussion to #412.