pythtb.WFArray.position_expectation#

WFArray.position_expectation(pos_dir, mesh_idx=None, state_idx=None)[source]#

Position expectation value for a given k-point and set of states.

These elements \(X_{n n}\) can be interpreted as an average position of n-th Bloch state evec[n] along direction pos_dir.

This routine can be used to compute the position expectation value for a given k-point and set of states (which can be all states, or a specific subset).

Parameters:
pos_dir: int

Direction of the position operator. 0 corresponds to the first non-periodic direction, 1 to the second, and so on.

Changed in version 2.0.0: Renamed from dir to pos_dir to avoid conflict with built-in Python function dir().

mesh_idx: array-like of int, optional

Set of integers specifying the \((k, \lambda)\)-point of interest in the mesh. If not specified, position expectation values are computed for all mesh points.

state_idx: array-like, optional

List of states to be included. If not specified, all states are included.

Changed in version 2.0.0: Renamed from occ. The band indices are not required to be occupied bands only. The default behavior is to include all bands, and the "all" option has been removed.

Returns:
pos_expnp.ndarray

Diagonal elements of the position operator matrix \(X\). Length of this vector is determined by number of bands given in evec input array.

Notes

The only difference in pythtb.TBModel.position_expectation() is that, in addition to specifying pos_dir, one also has to specify mesh_idx (mesh-point of interest) and state_idx (list of states to be included).

Generally speaking these centers are _not_ hybrid Wannier function centers (which are instead returned by position_hwf()).