PAOFLOW.projection.do_projectability#

Functions#

build_Pn(nawf, nbnds, nkpnts, nspin, U)

Compute the k-averaged projectability for each DFT band.

do_projectability(data_controller)

Determine the number of well-projected bands and the optimal energy shift.

Module Contents#

PAOFLOW.projection.do_projectability.build_Pn(nawf, nbnds, nkpnts, nspin, U)[source]#

Compute the k-averaged projectability for each DFT band.

Parameters:
  • nawf (int) – Number of atomic wave-function projectors.

  • nbnds (int) – Total number of DFT bands.

  • nkpnts (int) – Number of k-points.

  • nspin (int) – Number of spin channels.

  • U (np.ndarray, shape (nawf, nbnds, nkpnts, nspin)) – Overlap matrix between PAO projectors and DFT eigenstates.

Returns:

Projectability vector \(P_n\); values close to 1 indicate that band n is well represented in the PAO subspace.

Return type:

np.ndarray, shape (nbnds,), float

Notes

The projectability is defined as the average squared norm of the projection coefficients:

\[P_n = \frac{1}{N_k N_\sigma} \sum_{\mathbf{k}, \sigma} \sum_i |U_{i n \mathbf{k} \sigma}|^2\]
PAOFLOW.projection.do_projectability.do_projectability(data_controller)[source]#

Determine the number of well-projected bands and the optimal energy shift.

Parameters:

data_controller (DataController) – Object providing data_arrays and data_attributes. Required arrays: U (shape (nawf, nbnds, nkpnts, nspin)), my_eigsmat (shape (nbnds, nkpnts, nspin)). Required attributes: nawf, nbnds, nkpnts, nspin, pthr, shift, verbose.

Returns:

Updates the following attributes in data_controller.data_attributes and broadcasts them to all MPI ranks:

  • bnd : int — number of bands whose projectability exceeds pthr.

  • shift : float — the energy shift \(\eta\) to apply to states outside the PAO subspace (set from the minimum eigenvalue at the band edge when shift == 'auto').

Return type:

None

Notes

Only rank 0 calls build_Pn() and determines bnd and shift. Both values are then broadcast via DataController.broadcast_attribute(). A warning is printed if all bands meet the threshold, indicating that the number of DFT bands may be too small.