Skip to content

Element-projected phonon DOS and bandstructure #222

@janosh

Description

@janosh

the phonon_dos and phonon_bands functions should be upgraded to handle element-projected DOS and band structures

def phonon_dos(
doses: PhononDos | dict[str, PhononDos],
*,
stack: bool = False,
sigma: float = 0,
units: Literal["THz", "eV", "meV", "Ha", "cm-1"] = "THz",
normalize: Literal["max", "sum", "integral"] | None = None,
last_peak_anno: str | None = None,
**kwargs: Any,
) -> go.Figure:
"""Plot phonon DOS using Plotly.
Args:
doses (PhononDos | dict[str, PhononDos]): PhononDos or dict of multiple.
stack (bool): Whether to plot the DOS as a stacked area graph. Defaults to
False.
sigma (float): Standard deviation for Gaussian smearing. Defaults to None.
units (str): Units for the frequencies. Defaults to "THz".

def phonon_bands(
band_structs: PhononBands | dict[str, PhononBands],
line_kwargs: dict[str, Any] | None = None,
branches: Sequence[str] = (),
branch_mode: BranchMode = "union",
shaded_ys: dict[tuple[YMin | YMax, YMin | YMax], dict[str, Any]]
| bool
| None = None,
**kwargs: Any,
) -> go.Figure:
"""Plot single or multiple pymatgen band structures using Plotly, focusing on the
minimum set of overlapping branches.
Warning: Only tested with phonon band structures so far but plan is to extend to
electronic band structures.
Args:

example of what this could look like from abipy:

sphx_glr_plot_phonon_pjdos_001

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementImprovement to existing features/functionalityphononsPhonon bands and DOS plotsplotlyConcerning plotly-powered functions

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions