pythtb.TBModel.position_expectation#

TBModel.position_expectation(evecs, pos_dir)[source]#

Returns diagonal matrix elements of the position operator.

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

Parameters:
evecsnp.ndarray

Eigenvectors for which we are computing matrix elements of the position operator. The shape of this array is evecs[band, orbital] if spinful=True and evecs[band, orbital, spin] if spinful=False.

Changed in version 2.0.0: Parameter `evec renamed to evecs to clarify that multiple eigenvectors can be passed at once.

pos_dirint

Direction along which we are computing matrix elements. This integer must not be one of the periodic directions since position operator matrix element in that case is not well defined.

Changed in version 2.0.0: Parameter dir renamed to pos_dir to avoid conflict with built-in function dir().

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

Hybrid Wannier centers in the Haldane model

For an example.

position_matrix

For definition of matrix \(X\).

Notes

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

Examples

Diagonalizes Hamiltonian at some k-points

>>> (evals, evecs) = my_model.solve_ham(k_vec, return_eigvecs=True)

Computes average position for 3-rd kpoint and bottom five bands along first coordinate

>>> pos_exp = my_model.position_expectation(evecs[2, :5], 0)