diff --git a/kwant/physics/dispersion.py b/kwant/physics/dispersion.py index 060c4dd139660d05a5966bec23ba71bd6650a1cb..57def6b6e466a3210202d8859dc136c20427e2e5 100644 --- a/kwant/physics/dispersion.py +++ b/kwant/physics/dispersion.py @@ -19,6 +19,14 @@ class Bands(object): (currently this must be a scalar as all infinite systems are quasi-1-d), it returns a NumPy array containing the eigenenergies of all modes at this momentum + + Examples + -------- + >>> bands = kwant.physics.Bands(some_sys) + >>> momenta = numpy.linspace(-numpy.pi, numpy.pi, 101) + >>> energies = [bands(k) for k in momenta] + >>> pyplot.plot(momenta, energies) + >>> pyplot.show() """ def __init__(self, sys): diff --git a/kwant/solvers/common.py b/kwant/solvers/common.py index b829edf7905850f60d3aaaac045e72952a06ec0d..47ff6fc985b5908b544859c3b069ca15ba7774d3 100644 --- a/kwant/solvers/common.py +++ b/kwant/solvers/common.py @@ -394,6 +394,11 @@ class SparseSolver(object): number, it returns a 2d NumPy array containing the wave function within the scattering region due to each mode of the given lead. Index 0 is the mode number, index 1 is the orbital number. + + Examples + -------- + >>> wf = kwant.solvers.default.wave_func(some_sys, some_energy) + >>> wfs_of_lead_2 = wf(2) """ return WaveFunc(self, sys, energy)