Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phonopy BORN files; handling of equivalent atoms #224

Open
ajjackson opened this issue Jun 15, 2022 · 0 comments
Open

Phonopy BORN files; handling of equivalent atoms #224

ajjackson opened this issue Jun 15, 2022 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@ajjackson
Copy link
Collaborator

When a phonopy.yaml file is accompanied by a BORN file (which provides dielectric tensor and atomic Born charges) Euphonic attempts to read the BORN file. (This data is needed for the non-analytic-correction (NAC).)

According to the Phonopy documentation, the atom entries in this row should correspond to the "independent" atoms of the primitive cell.
https://phonopy.github.io/phonopy/input-files.html#format

Currently Euphonic expects this to be a list of all the primitive cell atoms, so it fails in many high-symmetry cases.

To reproduce

Using Euphonic command-line tools with the resulting phonopy.yaml yields something like

ValueError: The shape of born (1, 3, 3) doesn’t match the expected shape(s) [(2, 3, 3)]

Workaround

@rebeccafair has quickly identified a useful workaround: if the --nac tag is included when calling Phonopy, it will open the BORN file to apply a NAC and write the relevant data into phonopy.yaml. Euphonic can use this succesfully without touching the BORN file

This is actually more convenient in the long run: you don't have to keep the BORN file to hand and can more easily rename files, move them into common directories etc.

Solution

Still, the existing behaviour is a fixable bug! We should use spglib to map the rows of a valid BORN file to the array needed by Euphonic.

@ajjackson ajjackson added the bug Something isn't working label Jun 15, 2022
@rebeccafair rebeccafair added the good first issue Good for newcomers label Oct 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants