substitutions should be used also when hamiltonian is not a string
substitutions
are used by kwant.continuum.lambdify
only when hamiltonian
is not sympy expression. This leads to inconsistent interface because two following piece of codes are not equivalent:
hamiltonian = 'k_x**2 + V'
substitutions = {'V': kwant.continuum.sympify('V + V_0')}
h = kwant.continuum.lambdify(hamiltonian, substitutions=substitutions)
hamiltonian = kwant.continuum.sympify('k_x**2 + V')
substitutions = {'V': kwant.continuum.sympify('V + V_0')}
h = kwant.continuum.lambdify(hamiltonian, substitutions=substitutions)
edit:
I decided go generalize the issue a bit. I think it would make much more sense if substitutions
were also used when provided input is a sympy expression.
Initially they were playing a role of locals
passed to sympy.sympify
but if they are just named substitutions
they role should be extended.