plotTB code

class plotTB.plotTB(sys, colors=[])[source]

Bases: object

Plot the results of class eigTB.

Parameters:
  • sys – class instance eigTB.
  • colors – Default value []. Color plot.
plt_lattice(ms=30, lw=5, fs=20, c=3.0, plt_hop=False, plt_index=None, figsize=None)[source]

Plot lattice.

Parameters:
  • hop – Default value []. Hoppings given by the class eigTB. If not empty, plot the hoppings.
  • ms – Default value 30. Markersize.
  • c – Default value 3. Coefficient. Bond linewidths given by c*hop.
  • fs – Default value 20. Fontsize.
  • plt_index – Default value False. Plot site labels.
  • figsize – Default value None. Figsize.
Returns:

  • fig – Figure.

plt_spec(en_lims=[], pola_tag='', ms=10, fs=20)[source]

Plot spectrum (eigenenergies real part (blue circles), and sublattice polarization if pola not empty (red circles).

Parameters:
  • en – np.array. Eigenenergies.
  • en_lims – Default value []. Energy limits (size 2).
  • pola_tag – Default value []. Byte type. Tag of the sublattice.
  • ms – Default value 10. Markersize.
  • fs – Default value 20. Fontsize.
Returns:

  • fig – Figure.

plt_intensity1d(intensity, ms=20, lw=2, fs=20, title='Intensity')[source]

Plot intensity.

Parameters:
  • intensity – np.array. Field intensity.
  • ms – Default value 20. Markersize.
  • lw – Default value 2. Linewith, connect sublattice sites.
  • fs – Default value 20. Font size.
  • title – Default value ‘Intensity’. Figure title.
plt_intensity(intensity, s=200, fs=20, title='$|\\psi_{ij}|^2$', lims=[])[source]

Plot the intensity. Colormap with identical disk shape.

Parameters:
  • intensity – np.array.Field intensity.
  • s – Default value 300. Disk size.
  • fs – Default value 20. Font size.
  • title – Default value ‘$|psi_n|^2$’. Title.
  • lims – Colormap limits.
Returns:

  • fig – Figure.

plt_intensity_disk(intensity, hop=[], s=1000.0, lw=1, fs=20, title='$|\\psi_{ij}|^2$')[source]

Plot the intensity. Intensity propotional to disk shape.

Parameters:
  • intensity – np.array. Intensity.
  • hop – Default value []. Hoppings.
  • s – Default value 1000. Circle size given by s * intensity.
  • lw – Default value 1. Bond Line widths.
  • fs – Default value 20. Fontsize.
  • title – Default value ‘$|psi_{ij}|^2$’. Figure title.
Returns:

  • fig – Figure.

class plotTB.saveFigTB(sys, dir_name, params={}, ext='png')[source]

Bases: object

Create folder and save figures / animations obtained via latticeTB , plotTB or propagationTB.

dir_name(dir_name)[source]

Set the name of the directory in which the figures are stored.

Parameters:dir_name – String. First part of the directory name.
check_dir()[source]

Create the directory to store the figures exists.

file_name()[source]

Create the file name.

Returns:
  • file_name – File name.
save_fig(fig, name='')[source]

Save the figure in the directory defined by the method dir_name().

Parameters:
  • fig – Matplotlib fig.
  • name – String. Fist part of the file name.
save_fig_lat(fig, name='')[source]

Save the figure in the directory defined by the method dir_name().

Parameters:
  • fig – Matplotlib fig.
  • name – String. First part of the file name.
save_ani(ani, name='', fps=10)[source]