pythtb.WFArray.choose_states#

WFArray.choose_states(state_idx)[source]#

Keep only the specified states in the WFArray.

This method modifies the existing states in place to keep only those specified by state_idx.

Parameters:
state_idxint or array-like of int

Indices of states to keep.

Changed in version 2.0.0: Renamed from subset for consistency.

Notes

  • This modifies the shape of the wfs, energies, u_nk and psi_nk arrays.

  • The indices in state_idx refer to the current ordering of states. After removal, the remaining states are re-indexed accordingly.

Examples

Keep only states 3 and 5 from the WFArray

>>> wf.choose_states([3, 5])