PAOFLOW.spectrum.do_bands#

Attributes#

Functions#

bands_calc(data_controller)

Compute band eigenvalues and eigenvectors scattered over MPI pools.

band_loop_H(data_controller, kq_aux)

Evaluate the Bloch Hamiltonian \(H(\mathbf{k})\) on a set of k-points.

do_bands(data_controller)

Compute the electronic band structure along a k-path via Fourier interpolation.

Module Contents#

PAOFLOW.spectrum.do_bands.comm[source]#
PAOFLOW.spectrum.do_bands.rank[source]#
PAOFLOW.spectrum.do_bands.size[source]#
PAOFLOW.spectrum.do_bands.bands_calc(data_controller)[source]#

Compute band eigenvalues and eigenvectors scattered over MPI pools.

Parameters:

data_controller (DataController) – Object providing data_arrays and data_attributes. Required arrays: HRs (shape (nawf, nawf, nk1, nk2, nk3, nspin)), kq (shape (3, nkpi)), R (shape (nrtot, 3)). Required attribute: npool.

Returns:

  • E_kp_aux (np.ndarray, shape (nkpi_local, nawf, nspin)) – Eigenvalues on the local k-point subset. Complex if kq is complex (e.g. for complex band structures), float otherwise.

  • v_kp_aux (np.ndarray, shape (nkpi_local, nawf, nawf, nspin), complex) – Eigenvectors on the local k-point subset.

Notes

Each MPI rank operates on a local slice of the k-path obtained via scatter_full(). Eigenvalues are computed with scipy.linalg.eigh (real k) or scipy.linalg.eig (complex k).

PAOFLOW.spectrum.do_bands.band_loop_H(data_controller, kq_aux)[source]#

Evaluate the Bloch Hamiltonian \(H(\mathbf{k})\) on a set of k-points.

Parameters:
  • data_controller (DataController) – Object providing data_arrays. Required arrays: HRs (shape (nawf, nawf, nk1, nk2, nk3, nspin)), R (shape (nrtot, 3)).

  • kq_aux (np.ndarray, shape (3, nksize)) – Local k-points (Cartesian, units of \(2\pi/a\)) for which \(H(\mathbf{k})\) is evaluated.

Returns:

\(H(\mathbf{k})\) evaluated at each k-point in kq_aux.

Return type:

np.ndarray, shape (nawf, nawf, nksize, nspin), complex

Notes

Uses the Fourier sum

\[H(\mathbf{k}) = \sum_{\mathbf{R}} H(\mathbf{R})\, e^{2\pi i \mathbf{k} \cdot \mathbf{R}}\]

implemented as a tensor contraction between the flattened HRs and the phase factors \(e^{2\pi i \mathbf{k}\cdot\mathbf{R}}\).

PAOFLOW.spectrum.do_bands.do_bands(data_controller)[source]#

Compute the electronic band structure along a k-path via Fourier interpolation.

Parameters:

data_controller (DataController) – Object providing data_arrays and data_attributes. Required arrays: HRs (shape (nawf, nawf, nk1, nk2, nk3, nspin)), b_vectors (shape (3, 3)). Required attributes: alat, npool. Either ibrav or a pre-loaded kq array must be present.

Returns:

Adds or updates the following entries in data_controller.data_arrays:

  • E_k : np.ndarray, shape (nkpi, nawf, nspin) — band eigenvalues (in eV) along the requested k-path.

  • v_k : np.ndarray, shape (nkpi, nawf, nawf, nspin), complex — corresponding eigenvectors.

Return type:

None

Notes

The real-space grid R is built by get_R_grid_fft() if not already present, and the k-path is generated by kpnts_interpolation_mesh() when ibrav is provided. k-vectors supplied in reduced crystal coordinates are rotated to Cartesian by multiplication with b_vectors before the Fourier sum. If kq is complex (e.g. for complex band structures), eigenvalues are sorted in ascending order of the real part.