diff --git a/doc/source/reference/kwant.physics.rst b/doc/source/reference/kwant.physics.rst index e1c6f9019ea64b05153c1f2febf7bb4139e2a571..6d7d734c84236cdb3b767eb417e0f45a12352f7b 100644 --- a/doc/source/reference/kwant.physics.rst +++ b/doc/source/reference/kwant.physics.rst @@ -11,5 +11,6 @@ Leads Bands modes selfenergy + two_terminal_shotnoise PropagatingModes StabilizedModes diff --git a/kwant/physics/__init__.py b/kwant/physics/__init__.py index 5ae8693c1ff318ccaa75487840676fadabc8e7f4..f438c9425b5c03acda16d984d38e5f21f6bfdd1a 100644 --- a/kwant/physics/__init__.py +++ b/kwant/physics/__init__.py @@ -10,7 +10,7 @@ # Merge the public interface of all submodules. __all__ = [] -for module in ['leads', 'dispersion']: +for module in ['leads', 'dispersion', 'noise']: exec 'from . import {0}'.format(module) exec 'from .{0} import *'.format(module) exec '__all__.extend({0}.__all__)'.format(module) diff --git a/kwant/physics/noise.py b/kwant/physics/noise.py index 847e2910d2e1265492d19b809cf29f7cf087e4db..4dc960002597874e1dc4e11231ad8e835e1a43d5 100644 --- a/kwant/physics/noise.py +++ b/kwant/physics/noise.py @@ -7,6 +7,10 @@ # http://kwant-project.org/authors. import numpy as np +from ..solvers.common import SMatrix + +__all__ = ['two_terminal_shotnoise'] + def two_terminal_shotnoise(smatrix): """Compute the shot-noise in a two-terminal setup. @@ -25,7 +29,7 @@ def two_terminal_shotnoise(smatrix): Shot noise measured in noise quanta `2 e^3 |V| / pi hbar`. """ - if hasattr(smatrix.lead_info[0], 'shape'): + if not isinstance(smatrix, SMatrix): raise NotImplementedError("Noise expressions in terms of Green's " "functions are not implemented.") @@ -41,5 +45,5 @@ def two_terminal_shotnoise(smatrix): # voltages at various leads as input. (See # http://arxiv.org/abs/cond-mat/9910158) It could still be based on # smatrix._a_ttdagger_a_inv, i.e. be also valid also for self-energy leads, -# provided that only true transmission blocks are used As long as nobody needs +# provided that only true transmission blocks are used. As long as nobody needs # it though, it does make little sense to make such a routine. diff --git a/kwant/physics/tests/test_noise.py b/kwant/physics/tests/test_noise.py index 18b2c3aedf99b169fb824a3d87c01fc6d9ab1ef5..bdeb7063c4e55b82d98926f679c1a9306cd5276d 100644 --- a/kwant/physics/tests/test_noise.py +++ b/kwant/physics/tests/test_noise.py @@ -10,7 +10,7 @@ import numpy as np from nose.tools import assert_raises from numpy.testing import assert_almost_equal import kwant -from kwant.physics.noise import two_terminal_shotnoise +from kwant.physics import two_terminal_shotnoise n = 5 chain = kwant.lattice.chain()