Tight binding approximation in Python