diff --git a/kwant/builder.py b/kwant/builder.py index c594f7202322e492abfddd78f22f6d85ce09e341..b43b5547d1d5212fdcd46b8d64fef46ef6d5382b 100644 --- a/kwant/builder.py +++ b/kwant/builder.py @@ -1070,6 +1070,9 @@ class Builder(object): The lead numbering starts from zero and increments from there, i.e. the leads are numbered in the order in which they are attached. """ + if self.symmetry.num_directions: + raise ValueError("Can only attach leads to finite systems") + if add_cells < 0 or int(add_cells) != add_cells: raise ValueError('add_cells must be an integer >= 0.')