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

Discontinuous qpoints #106

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dgaines2
Copy link

Hello!

First of all, let me thank you for writing this fantastic package. It's been quite useful for me and seems very easily extensible and customizable.

Background:
For some crystal symmetries, some common softwares have conventions that construct a q-path that is discontinuous in the Brillouin zone.
E.g. BCC (Spacegroup #229) q-paths have X|R (SeekPath) or H|P (pymatgen)

Problem:
The current plotting joins phonon bands across this discontinuity, although it is mostly only visible if the (plot) linewdith of the band is thicker than the linewidth of the vlines at these q-points.

Solution:
These discontinuities can be found by checking for two adjacent x values in the q-path that have the same value. You can then fix this issue by splitting the x and frequency arrays across each discontinuity and making separate plotting calls for each "split". In the case where there are no q-points with discontinuities, this implementation results in the same plotting behavior as before.

Example:
BCC Iron (Fe) with spin polarization turned off displays imaginary modes. In Fe_229_nospin_original.pdf, note the band connection along H|P. In Fe_229_nospin_updated.pdf, the suggested fix is applied and the previous vertical line joining the bands is not present.
Fe_229_nospin_original.pdf
Fe_229_nospin_updated.pdf

Further comments:
I'd be very happy to address any feedback!

  • I only updated add_dispersion and add_alt_dispersion, but this fix also addresses this issue automatically for add_multi. There might be cases where this still occurs for some of the other phonon plotting functions if linestyle is used with scatter.
  • I'm not sure if I should have also changed ax.scatter() for add_alt_dispersion. If I'm completely honest, I'm not sure I understand the use cases for ax.scatter with linestyle vs ax.plot with markers.
  • I also acknowledge that the way I implemented label_ni is probably not optimal, although it let me leave the tile_properties() calls alone.
  • There's a difference in the ylimits (bottom) between these plots from another change I made, which is only relevant for cases where there are imaginary modes. I'm drafting another pull request for this.

For some crystal symmetries, conventions specify a q-path that
is discontinuous in the Brillouin zone.
E.g. BCC (Spacegroup #229) q-paths have X|R (SeekPath) or H|P
    (pymatgen)

The current plotting joins phonon bands across this discontinuity,
although it is mostly only visible if the linewdith of the band is
thicker than the linewidth of the vlines at these q-points.

These discontinuities can be found by checking for two adjacent x values
in the q-path that have the same value. You can then fix this issue by
splitting the x and frequency arrays across each discontinuity and making
separate ax.plot calls.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant