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 directionpos_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.
0corresponds to the first non-periodic direction,1to the second, and so on.Changed in version 2.0.0: Renamed from
dirtopos_dirto 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.
See also
pythtb.TBModel.position_expectation()- Hybrid Wannier centers in the Haldane model
For an example.
position_matrixFor definition of matrix \(X\).
Notes
The only difference in
pythtb.TBModel.position_expectation()is that, in addition to specifyingpos_dir, one also has to specifymesh_idx(mesh-point of interest) andstate_idx(list of states to be included).Generally speaking these centers are _not_ hybrid Wannier function centers (which are instead returned by
position_hwf()).