pythtb.WFArray.states#

WFArray.states(state_idx=None, flatten_spin_axis=False, return_psi=False)[source]#

Return states stored in the WFArray object.

The states are returned in the same ordering as stored internally, with mesh axes leading, followed by band, orbital, and (if present) spin indices. By default, all states are returned. The user can specify a subset of states to return using the state_idx argument.

Added in version 2.0.0.

Parameters:
state_idxint or array-like of int, optional

Index or indices of the states to return. If not provided or None, all states are returned.

flatten_spin_axisbool, optional

If True, the spin and orbital indices are flattened into a single index. Default is False.

return_psibool, optional

If True, the function also returns the full Bloch wavefunctions. This should only be requested when k-axes are present in the mesh and dim_k > 0, otherwise an error is raised. Default is False.

Returns:
unp.ndarray

The states stored in the WFArray object. By default, these are the cell-periodic states when dim_k > 0. The shape is

(nk1, nk2,..., nl1, nl2,..., nstate, norb[,nspin])

If flatten_spin_axis=True, the last two axes are replaced by a single axis of size norb*nspin.

psinp.ndarray, optional

Bloch states with the same shape conventions as wfs. These states are related to the cell-periodic states by plane-wave phase factors. Only returned if return_psi=True.

See also

Formalism