.. _plotting: ================== Plotting ================== Py4mulas enables two types of plotting. Plotting band stractures ------------------------ We start with some model such as defined in :ref:`transport` To plot the band structure along a path .. code-block:: python from py4mulas.plotters import plot_bands import numpy as np path = [(0, 0), (np.pi, 0)] labels = [r'$\Gamma$', r'$X$'] plot_bands(kmodel, path=path, path_labels=labels) One might want to plot the bands with some operator expectation values. For instance spin density .. code-block:: python from py4mulas.operators import SpinDensity operator = SpinDensity(kmodel, pauli=sigma_z) plot_bands(kmodel, path=path, path_labels=labels, operator=operator, cmap='siesmic') It is important to note that when band structures are to be plotted the model should be provided in the cartesian momentum representaton. See ``py4mulas/examples/kagomeAFM.py`` Plotting k-resolved quantities ------------------------------ One can plot the transport response of any Py4mulas formula .. code-block:: python from py4mulas.plotters import kplot quantity = some_formula(mu=0, temperature=0, eta=0, k_resolved=True) kplot(kmodel, quantity, cmap='siesmic') Generally operators are matrices, so they cannot be plotted directly. However, one can plot them when band resolved. .. code-block:: python quantity = operator.band_resolved(n=0) kplot(kmodel, quantity, cmap='siesmic') The band resolved feature is only impemented for spin operators. See. :class:`~py4mulas.operators.SpinOperator`. This should be generalized for all operators.