abelcarreras / DynaPhoPy

Phonon anharmonicity analysis from molecular dynamics
http://abelcarreras.github.io/DynaPhoPy/
MIT License
113 stars 51 forks source link

Atomic order in POSCAR and the data file #19

Closed ZhangMin-qq closed 1 year ago

ZhangMin-qq commented 1 year ago

Hi, I'm sorry to bother you again. I want to use phonolammps to calculate the force constants, and then use dynaphopy to further calculate the renormalized force constants. According to my understanding, the order of atoms in POSCAR for calculating force constants in phonolammps should be consistent with that in data file for calculating atomic trajectory and POSCAR file for calculating renormalized force constants in dynaphopy (I adopted amorphous SiO2 structure of 648 atoms without cell expansion). However, when I use phonolammps to calculate the force constants, the generated POSCAR file is shown in POSCAR.txt. I used this POSCAR as one of the input files of dynaphopy. When I used -cposcar (or -c lammps) to generate a new vasp_poscar (data.file) file, it seemed that the type of atoms could not be completely recognized correctly. When using lammps to calculate the atomic trajectory, I can manually change the atomic type in data.file through some simple post-processing to make it consistent with the POSCAR file generated by phonolammps. Can I directly use this POSCAR generated by phonolammps as the input file when calculating the renormalized force constants and linewidth by dynaphopy? Because dynaphopy's -c_lammps and -c_poscar commands don't correctly identify this POSCAR file, I'm not sure whether it can correctly identify this POSCAR file when calculating the renormalized force constants. I wish I had made my question clear. Thank you very much for your help. POSCAR.txt data.file.txt vasp_posacr.txt

abelcarreras commented 1 year ago

I see, I think the issue is related to the fact that in the unit cell that you define in phonolammps probably the atoms of the same element type are not correlative. Am I right?. The standard in POSCAR format is that, in your case, first you write all Si atoms and then all O atoms. If not then it generates this unconventional POSCAR file that probably Dynaphopy cannot read correctly.

ZhangMin-qq commented 1 year ago

I see, I think the issue is related to the fact that in the unit cell that you define in phonolammps probably the atoms of the same element type are not correlative. Am I right?. The standard in POSCAR format is that, in your case, first you write all Si atoms and then all O atoms. If not then it generates this unconventional POSCAR file that probably Dynaphopy cannot read correctly.

Sorry for the late reply. Inspired by you, I think I have found a solution. I can modify the atomic order in POSCAR and Force Constants output by phonolammps through post-processing, so that dynaphopy can recognize it normally.

Besides, I have two other questions to ask.

  1. Can dybnaphopy be calculated in parallel? It takes a long time to read the atomic trajectory when calculating the line width and the renormalized force constant. When I calculated the amorphous sio2 with 624 atoms, the atomic trajectories were output in the last 40W steps, once every 10 steps, that is, 4W atomic trajectories were output, which needed to run for 15h. I'm running on a supercomputer with a single core, and I don't know if dynaphopy can run on multiple cores.

  2. I'm also a little uncertain about the setting of the time step. I use the' -ts' command to set the time step. The time step set in the process of track output is 0.0005 ps, which is output once every 10 steps. A total of 40W steps are run and 4W tracks are output. According to the instructions of dynaphopy, I set "-ts 0.0005". I'm not sure if my settings are correct, because I see "Using 40000 steps" in Dynappy's output log. Will Dynappy automatically consider that I output every ten steps (I use lammps to output only the velocity of atoms, Is there anything else I need to pay attention to)?

I really appreciate your help.

abelcarreras commented 1 year ago
  1. Yes, but depends on the algorithm. Using psm you can choose the algorithm to compute the power spectra. https://abelcarreras.github.io/DynaPhoPy/description.html

    • ME method is implemented in parallel (OpenMP).
    • Usual FFT method uses Numpy (usually not parallel but I think that it is possible to compile numpy with MKL to get some parallelization).
    • FFTW via pyfftw (which is parallel).
    • You can use GPU using CUDA version (this requires: https://github.com/abelcarreras/cuda_functions and a NVIDIA GPU)
  2. Dynaphopy reads the information in ITEM: TIMESTEP to know the dumping ratio. The number in -ts should be the "real" time step you set in the LAMMPS input.

ZhangMin-qq commented 1 year ago
  1. Yes, but depends on the algorithm. Using psm you can choose the algorithm to compute the power spectra. https://abelcarreras.github.io/DynaPhoPy/description.html
  • ME method is implemented in parallel (OpenMP).
  • Usual FFT method uses Numpy (usually not parallel but I think that it is possible to compile numpy with MKL to get some parallelization).
  • FFTW via pyfftw (which is parallel).
  • You can use GPU using CUDA version (this requires: https://github.com/abelcarreras/cuda_functions and a NVIDIA GPU)
  1. Dynaphopy reads the information in ITEM: TIMESTEP to know the dumping ratio. The number in -ts should be the "real" time step you set in the LAMMPS input.

Thank you very much for your patient help. I have made it clear. Now I can run in parallel. Thank you again.