From 216e05fd34ffbaa3f13d16cefd46defd3a2d158a Mon Sep 17 00:00:00 2001
From: Michael Wimmer <wimmer@lorentz.leidenuniv.nl>
Date: Tue, 27 Aug 2013 15:05:35 +0200
Subject: [PATCH] bug fix: ldos would not work with precalculated leads

---
 kwant/solvers/common.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kwant/solvers/common.py b/kwant/solvers/common.py
index b628b5a..96b5f7d 100644
--- a/kwant/solvers/common.py
+++ b/kwant/solvers/common.py
@@ -458,10 +458,10 @@ class SparseSolver(object):
             Local density of states at each orbital of the system.
         """
         for lead in fsys.leads:
-            if not isinstance(lead, system.InfiniteSystem):
+            if not hasattr(lead, 'modes'):
                 # TODO: fix this
-                raise ValueError("ldos only works when all leads are "
-                                 "tight binding systems.")
+                raise ValueError("ldos for leads with only self-energy "
+                                 "is not implemented yet")
 
         linsys, lead_info = \
             self._make_linear_sys(fsys, xrange(len(fsys.leads)), energy, args)
-- 
GitLab