PAOFLOW.spectrum.do_site_projected_bands#

Functions#

site_projeted_bands(data_controller)

Write site-projected band weights to a data file.

Module Contents#

PAOFLOW.spectrum.do_site_projected_bands.site_projeted_bands(data_controller)[source]#

Write site-projected band weights to a data file.

Parameters:

data_controller (DataController) – Object providing data_arrays and data_attributes. Required arrays: v_k (shape (nkpi, nawf, bnd, nspin)), E_k (shape (nkpi, bnd, nspin)), site_proj (1-D int array of site indices to project onto), naw (number of atomic orbitals per atom). Required attributes: nawf, do_spin_orbit. Attribute opath is used for output.

Returns:

Writes one text file per spin channel to {opath}/site-projected-bands_{ispin}.dat. Each line contains three whitespace-separated values: k-point index (int), band energy (float, eV), and the site-projected spectral weight (float).

Return type:

None

Notes

For each selected site in site_proj, the orbital indices \([\text{idx}, \text{fdx})\) belonging to that site are identified using the cumulative sum of naw. A complex mask is applied to the eigenvector array v_k to retain only those orbital components, and the spectral weight is computed as \(\sum_\mu |v^\mu_{nk}|^2\).

When do_spin_orbit is enabled, the spin-orbit-doubled basis is accounted for by also including the upper spin sector \([\text{idx}+s, \text{fdx}+s)\) where \(s = N_{\text{wf}}/2\).