plot_spectral_density

Plot Spectral Density

Plots the generalized spectral density \(J_{\alpha\beta}(\omega)\) as a function of energy (eV) for user-selected emitter pairs or separations.

Reads spectral density data from the HDF5 file produced by mqed.analysis.spectral_density.

Usage:

python -m mqed.plotting.plot_spectral_density

Configuration via configs/plots/spectral_density.yaml.

mqed.plotting.plot_spectral_density._apply_font_config(cfg)[source]

Apply font configuration from config, following plot_pr.py conventions.

mqed.plotting.plot_spectral_density._format_scaled_label(base_label: str, scale_factor: float) str[source]

Append a multiplier annotation to the legend label when needed.

mqed.plotting.plot_spectral_density._is_nested_index_collection(value: Any) bool[source]

Return True when a selection entry is itself a collection of indices.

mqed.plotting.plot_spectral_density._load_spectral_density_h5(filepath: str) dict[source]

Load spectral density data from HDF5.

Returns:

J_eV, energy_eV, gf_layout, and either Rx_nm (separation layout) or emitter_positions_nm (pair layout).

Return type:

Dictionary with keys

mqed.plotting.plot_spectral_density._normalize_curve_scales(raw_scales: Any, count: int, setting_name: str) list[float][source]

Return one multiplicative scale factor per plotted curve.

mqed.plotting.plot_spectral_density._normalize_curve_styles(raw_styles: Any, count: int, setting_name: str) list[Any][source]

Return one optional style entry per plotted curve.

mqed.plotting.plot_spectral_density._normalize_pair_indices(raw_selection: Any) list[list[int]][source]

Return a validated list of [alpha, beta] pair indices.

mqed.plotting.plot_spectral_density._normalize_separation_indices(raw_selection: Any) list[int][source]

Return a validated list of separation indices.

mqed.plotting.plot_spectral_density._parse_index_selection(raw_selection: Any, default_value: Any, selection_name: str) Any[source]

Normalize Hydra index selection values into plain Python objects.

mqed.plotting.plot_spectral_density._plot_pair_layout(J_eV, energy_eV, cfg)[source]

Plot J_αβ(ω) for pair-indexed data.

Produces one curve per selected (α, β) pair.

mqed.plotting.plot_spectral_density._plot_separation_layout(J_eV, energy_eV, Rx_nm, cfg)[source]

Plot J(ω) for separation-indexed data.

Produces one curve per selected separation Rx.

mqed.plotting.plot_spectral_density._resolve_curve_multipliers(ps, primary_key: str, legacy_key: str, count: int) list[float][source]

Load curve multipliers with a backwards-compatible fallback key.

mqed.plotting.plot_spectral_density._resolve_curve_styles(ps, prefix: str, count: int) tuple[list[Any], list[Any]][source]

Load optional per-curve colors and linestyles for one plot layout.

mqed.plotting.plot_spectral_density._validate_curve_multiplier(scale_factor: float, yscale: str, setting_name: str) None[source]

Reject invalid multipliers for the active y-axis scale.

mqed.plotting.plot_spectral_density.plot_spectral_density(cfg=None) None

Plot spectral density from pre-computed HDF5 data.

This is the Hydra CLI entry point. Configuration is loaded from configs/plots/plt_spec_dens.yaml.