pythtb.TBModel.visualize#
- TBModel.visualize(proj_plane=None, eig_dr=None, draw_hoppings=True, annotate_onsite=False, ph_color='black')[source]#
Visualizes the tight-binding model geometry.
Plots the tight-binding orbitals, hopping between tight-binding orbitals, and optionally the electron eigenstates.
If eigenvector is not drawn, then orbitals in home cell are drawn as red circles, and those in neighboring cells are drawn with a lighter shade of red. Hopping term directions are drawn with green lines connecting two orbitals. Origin of unit cell is indicated with blue dot, while real space unit vectors are drawn with blue lines.
If eigenvector is drawn, then electron eigenstate on each orbital is drawn with a circle whose size is proportional to wavefunction amplitude while its color depends on the phase. There are various coloring schemes for the phase factor; see more details under ph_color parameter. If eigenvector is drawn and coloring scheme is “red-blue” or “wheel”, all other elements of the picture are drawn in gray or black.
Changed in version 2.0.0: Visualization appearance has been updated.
- Parameters:
- proj_planetuple or list of two integers
Cartesian coordinates to be used for plotting. For example, if
proj_plane=(0,1)then x-y projection of the model is drawn. This only should be specified if dim_r > 2.Changed in version 2.0.0: Replaced previous parameters
dir_firstanddir_second.- eig_drOptional parameter specifying eigenstate to
plot. If specified, this should be one-dimensional array of complex numbers specifying wavefunction at each orbital in the tight-binding basis. If not specified, eigenstate is not drawn.
- draw_hoppingsOptional parameter specifying whether to
draw all allowed hopping terms in the tight-binding model. Default value is True.
- ph_color{“black”, “red-blue”, “wheel”}, optional
Determines the way the eigenvector phase factors are translated into color. Default value is “black”.
- “black” – phase of eigenvectors are ignored and wavefunction
is always colored in black.
- “red-blue” – zero phase is drawn red, while phases or \(\pi\) or
\(-\pi\) are drawn blue. Phases in between are interpolated between red and blue. Some phase information is lost in this coloring because phase of \(\pm \pi\) have the same color.
- “wheel” – each phase is given unique color. In steps of \(\pi/3\)
starting from 0, colors are assigned (in increasing hue) as: red, yellow, green, cyan, blue, magenta, red.
- Returns:
- figmatplotlib.figure.Figure
Figure object from matplotlib.pyplot module
- axmatplotlib.axes.Axes
Axes object from matplotlib.pyplot module
Notes
- This function is intended for visualizing tight-binding models
in two dimensions. For three-dimensional visualizations, consider using the
visualize_3d()method.
- Convention of the wavefunction phase is as
in convention 1 in section 3.1 of
notes on tight-binding formalism. In other words, these wavefunction phases are in correspondence with cell-periodic functions \(u_{n {\bf k}} ({\bf r})\) not \(\Psi_{n {\bf k}} ({\bf r})\).
Examples
Draws x-y projection of tight-binding model tweaks figure and saves it as a PDF.
>>> fig, ax = tb.visualize(0, 1) >>> plt.show()