Skip to content
Snippets Groups Projects
Commit cb197375 authored by Christoph Groth's avatar Christoph Groth
Browse files

add examples for functions returning functions

parent bb13c24e
No related branches found
No related tags found
No related merge requests found
......@@ -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):
......
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment