Re: [Phonopy-users] Working with phonopy API
Brought to you by:
atztogo
|
From: MUKESH S. <gkp...@gm...> - 2023-06-25 18:50:45
|
Thanks a lot Eugene for realising the question and suggesting the methods.
Also, thanks to Prof. Togo for including the reading and writing methods in
the documentary. Also, Using reading and writing structure, one can use
phonopy as input file converter for several DFT code eg. qe to vasp and
vice-versa.
My purpose of using the API is to use phonopy with other python code in
script. Specifically, I am using hiphive for quadratic correction near the
gamma point. I have to find the correction ~20-24 times. So I want to
write a script that directly reads the force constant from disp_fc2-{00001
..0000N}/vasprun.xml which is collected after running VASP code.
>From the above suggestions, I have generated displaced supercells.
So I would appreciate your comments on the following:
1- While using phonopy API, I am getting phonopy_param.yaml, while using
commands like write phonopy_disp.yaml. Are both files same and what is the
purpose of the different names?
2- From the command line, I can generate FORCE_CONTANTS and load it in the
phonopy API. Can I directly read force_constant from
disp_fc2-{00001..0000N}/vasprun.xml
using phonopy API?
Sorry to pointing out, there is small typos at
https://phonopy.github.io/phonopy/phonopy-module.html#phonopy-read-write-structure
in line [4]. In place of
optional_info it should be optional_structure_info
Thanks
Mukesh Singh
On Sun, Jun 25, 2023 at 2:23 PM Eugene <rog...@ho...> wrote:
> Very nice update Togo, thank you!
>
> Eugene
>
> On 6/25/23 10:15, Atsushi Togo wrote:
> > Thanks Eugene,
> >
> > I could not realize it from Mukesh's question. This should be written
> > in documentation, so I made some
> >
> > https://phonopy.github.io/phonopy/phonopy-module.html#pre-process
> >
> https://phonopy.github.io/phonopy/phonopy-module.html#phonopy-read-write-structure
> >
> > Togo
> >
> >
> > On Sun, Jun 25, 2023 at 2:07 PM Eugene <rog...@ho...> wrote:
> >> Hi,
> >>
> >> check this out
> >>
> >> from phonopy.interface.vasp import write_vasp
> >> for i, s in enumerate(supercells):
> >> fn = "SPOSCAR-%03d" % i
> >> write_vasp(fn, s)
> >>
> >> Best,
> >> Eugene
> >>
> >> On 6/25/23 06:45, MUKESH SINGH wrote:
> >>
> >> Dear Phonopy users and Prof. Togo,
> >>
> >> I am trying to calculate force constants and plot phonon-spectrum using
> phonopy api. So First I want to generate displaced structures from api.
> >>
> >> I have used the following lines in my jupyter notebook, but it is not
> generating displaced structure and showing no errors.
> >>
> >> [1]
> >>
> >> from phonopy import Phonopy
> >>
> >> [2]
> >> from phonopy.interface.calculator import read_crystal_structure
> >> unitcell, _ = read_crystal_structure("POSCAR-unitcell",
> interface_mode='vasp')
> >>
> >> [3]
> >>
> >> phonon = Phonopy(unitcell,
> >> supercell_matrix=[[2, 0, 0], [0, 2, 0], [0, 0, 2]])
> >>
> >> [4]
> >> phonon.generate_displacements(distance=0.03)
> >> supercells = phonon.supercells_with_displacements
> >>
> >>
> >> Q1. Where am I making mistakes? Can you provide any examples or
> references where this has been done?
> >> Q2. I am using phonopy 2.15.1, will upgrading the phonopy version
> resolve the issue?
> >>
> >> Thanks and regards
> >> Mukesh Singh
> >> Research Scholar
> >> Department of Physics,
> >> IIT BOMBAY(400076)
> >>
> >>
> >> _______________________________________________
> >> Phonopy-users mailing list
> >> Pho...@li...
> >> https://lists.sourceforge.net/lists/listinfo/phonopy-users
> >>
> >> _______________________________________________
> >> Phonopy-users mailing list
> >> Pho...@li...
> >> https://lists.sourceforge.net/lists/listinfo/phonopy-users
> >
> >
> > --
> > Atsushi Togo
> >
> >
> > _______________________________________________
> > Phonopy-users mailing list
> > Pho...@li...
> > https://lists.sourceforge.net/lists/listinfo/phonopy-users
>
>
> _______________________________________________
> Phonopy-users mailing list
> Pho...@li...
> https://lists.sourceforge.net/lists/listinfo/phonopy-users
>
--
Research Scholar
Department of Physics,
IIT BOMBAY(400076)
|