Page 1 of 1

Phonon: Linear Response, Force constants, Hessian Elements not written

Posted: Mon Jan 13, 2025 12:45 pm
by bolariso

Dear Team,

I'm trying to use linear response in VASP to compute force constants in real space. However, there are associated errors. The hessian elements and linear response are not written to the vaspout.h5 and vasprun.xml files.

Below is my INCAR file:

ISTART = 0
ICHARG = 2
PREC = Accurate
ENCUT = 500
ISMEAR = 0
SIGMA = 0.05
EDIFF = 1E-08
IALGO = 38
NSW = 0
IBRION = 8
IVDW = 11
LWAVE = .FALSE.
LCHARG = .FALSE.
ADDGRID = .TRUE
NCORE = 24
LPHON_DISPERSION = True
#LPHON_READ_FORCE_CONSTANTS = True

For the first calculation i used a KPOINT, after which I uncomment the LPHON_READ_FORCE_CONSTANTS and used a QPOINT file with line mode.

Looking forward to your help


Re: Phonon: Linear Response, Force constants, Hessian Elements not written

Posted: Mon Jan 13, 2025 1:24 pm
by alex

Hi Bolariso,

linear response (IBRION = 7 or 8) does not allow vdW correction, so your calculation should terminate with an error.
Use IBRION = 5 or 6 instead if you must use vdW correction.

Cheers,

alex


Re: Phonon: Linear Response, Force constants, Hessian Elements not written

Posted: Mon Jan 13, 2025 1:42 pm
by ahampel

Hi Bolariso,

thank you for posting your question on the Forum, and thanks Alex for figuring the problem out and helping here.

If there is still a problem Bolariso please remember to post all input files (INCAR, POSCAR, KPOINTS, and POTCAR) and post your error message / output. This helps to address the issue.

Regarding your question of output. The second derivatives should be stored in the xml and h5 archive (if HDF5 support was enabled while compiling).

See also tutorial: https://vasp.at/tutorials/latest/phonon/part1/ where py4vasp is used to analyze results and hence results are present in the hdf5 archive.

Let us know if your calculations work now.

Best,
Alex H.


Re: Phonon: Linear Response, Force constants, Hessian Elements not written

Posted: Mon Jan 13, 2025 2:22 pm
by bolariso

Dear Team,

Thank you for your swift response.I have tried the calculation with the vdW commented out, however, the situation persists.

What I am trying to do:
To perform phonon calculation using DFPT method and using phonopy for post processing. Alternatively I do not mind using LPHON_READ_FORCE_CONSTANTS since I am using VASP6.4.2

The Error Message:
After running the calculation, the job gets done after only one ionic iteration. (see std.out file). When I proceed to post-process with phonopy, I get the error message:

'vasprun.xml' dones not contain necessary information.

I believe this error message is associated to the fact that the hessian element is not written in the vasprun.xml file which implies an there is an issue with the linear response.

Kindly find the INCAR, POSCAR, KPOINTS, POTCAR, OUTCAR, std.out, and vasprun.xml file in the attached folder named vasp_forum_phonon.zip

Looking forward to your help.


Re: Phonon: Linear Response, Force constants, Hessian Elements not written

Posted: Mon Jan 13, 2025 3:19 pm
by ahampel

Dear Bolariso,

I checked your input files and output files. You can see that VASP actually does not calculate the phonon properties. You did set IBRION=8, but you also set NSW=0, which prevents VASP from performing the necessary ionic steps. Please try to remove the NSW=0 line and rerun the calculation and check again. Let me know how this goes.

Best,
Alex H.


Re: Phonon: Linear Response, Force constants, Hessian Elements not written

Posted: Tue Jan 14, 2025 11:53 am
by bolariso

Dear Alex,

Thanks for noting that. I removed the NSW=0 and the linear response calculation was added. Sadly, I ended up with an error after the first iteration cycle. The error reads as below:

VASP internal routines have requested a change of the k-point set. |
| Unfortunately, this is only possible if NPAR=number of nodes. |
| Please remove the tag NPAR from the INCAR file and restart the |
| calculation.

However, there is no NPAR set in my INCAR, I only have NCORE=24 which is optimized for VASP on my HPC (Preliminary tests shows that NPAR is not favourable for our architecture). I tried switching off the calculation became super slow. I tried NCORE = 12 and 48, I ended up with the same error. I switched off the ADDGRID tag and I ended up with the same error.

Kindly find attached the std.out file


Re: Phonon: Linear Response, Force constants, Hessian Elements not written

Posted: Tue Jan 14, 2025 12:52 pm
by ahampel

Hi Bolariso,

unfortunately parallelization of NCORE / NPAR together with IBRION=8 is not implemented. NPAR and NCORE do the same thing just interfaced differently to the user, hence you have to remove it from the input tags. What you can do is to use KPAR . If the system is not too large try avoid inter-node communication (run on one node only) and then set KPAR=4 or even 6 or 8. This parallelizes the calculation over k points. The other tags are not related to the problem.

Another thing that does work in OpenMP threading. If you compile VASP with -D_OPENMP you can use multiple threads per mpi rank instead of NCORE. See wiki/index.php/Combining_MPI_and_OpenMP for more details. With that I could get a good performance running your calculation.

Best regards,
Alex H.


Re: Phonon: Linear Response, Force constants, Hessian Elements not written

Posted: Thu Jan 16, 2025 1:54 pm
by bolariso

Hi Alex,

Thank you very much. This now works like a charm. The Linear response calculation is also included and the hessian elements are written to the vaspout.h5 as expected.

To proceed to get the phonon dispersions, since I am using VASP6.4.2, I wanted to try using VASP without phonopy code for the post processing.

For that, I performed the calculation as before using KPOINTS file. Then:
I provided a QPOINTS file (in line mode)
I copied vaspout.h5 to vaspin.h5
I set LPHON_READ_FORCE_CONSTANTS and LPHON_DISPERSION to True

The std.out file (see attached) reads as below:

LDA part: xc-table for Pade appr. of Perdew
Start phonon computation
Finished phonon computation
Job Done

I can see the phonons written in the OUTCAR file (file attached)

I am however unclear how to proceed to plot the phonon dispersion from here without using py4vasp. I was expecting say a new file output that will contain the phonon dispersions where I can then plot using whatever software that is convenient for me. to put this in a question format,
1. Is the procedure above correct? If not, how do I proceed? If so...
2. where do I find the phonon dispersion data (x,y data format) after this run?


Re: Phonon: Linear Response, Force constants, Hessian Elements not written

Posted: Fri Jan 17, 2025 8:50 am
by ahampel

The phonon dispersion is only written to the OUTCAR file and the vaspout.h5 file if VASP is compiled with HDF5 support. Did you do this?

Is there a specific reason why you do not like to use py4vasp for post-processing? You do not have to plot the data using py4vasp but you can store the phonon dispersion in a csv formatted file as you requested easily via py4vasp: https://www.vasp.at/py4vasp/latest/calc ... onon_band/ using the function calculation.phonon_band.to_csv(filename='file.dat') . Then you can plot and process the file.dat the way you like. Is that a viable way forward?

The amount of information in the OUTCAR for the phonon dispersion can be set via: https://www.vasp.at/wiki/index.php/PHON_NWRITE .

Best,
Alex H.


Re: Phonon: Linear Response, Force constants, Hessian Elements not written

Posted: Fri Jan 17, 2025 2:26 pm
by bolariso

Thank you Alex,

Yes, my VASP is compiled with HDF5. I will check out the py4vasp and proceed appropriately. Thank you once again, you have been a great support in getting this right.

Cheers,