pythtb.WFArray.position_matrix#
- WFArray.position_matrix(pos_dir, mesh_idx, state_idx=None)[source]#
Position matrix for a given k-point and set of states.
Position operator is defined in reduced coordinates. The returned object \(X\) is
\[X_{m n {\bf k}}^{\alpha} = \langle u_{m {\bf k}} \vert r^{\alpha} \vert u_{n {\bf k}} \rangle\]Here \(r^{\alpha}\) is the position operator along direction \(\alpha\) that is selected by pos_dir.
This routine can be used to compute the position matrix 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
Set of integers specifying the \((k, \lambda)\)-point of interest in the mesh.
- 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_matnp.ndarray
Position operator matrix \(X_{m n}\) as defined above. This is a square matrix with size determined by number of bands given in evec input array. First index of pos_mat corresponds to bra vector (\(m\)) and second index to ket (\(n\)).
See also
Notes
The only difference in
pythtb.TBModel.position_matrix()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, which can optionally be ‘all’).