kwant.continuum.discretize_symbolic

kwant.continuum.discretize_symbolic(hamiltonian, coords=None, *, locals=None)[source]

Discretize a continuous Hamiltonian into a tight-binding representation.

If necessary, the given Hamiltonian is sympified using kwant.continuum.sympify. It is then discretized symbolically.

The two return values may be used directly as the first two arguments for build_discretized.

Warning

This function uses eval (because it calls sympy.sympify), and thus should not be used on unsanitized input.

Parameters
hamiltonianstr or SymPy expression

Symbolic representation of a continuous Hamiltonian. It is converted to a SymPy expression using kwant.continuum.sympify.

coordssequence of strings, optional

The coordinates for which momentum operators will be treated as differential operators. May contain only “x”, “y” and “z” and must be sorted. If not provided, coords will be obtained from the input Hamiltonian by reading the present coordinates and momentum operators.

localsdict, optional

Additional namespace entries for sympify. May be used to simplify input of matrices or modify input before proceeding further. For example: locals={'k': 'k_x + I * k_y'} or locals={'sigma_plus': [[0, 2], [0, 0]]}.

Returns
tb_hamiltoniandict

Keys are tuples of integers; the offsets of the hoppings ((0, 0, 0) for the onsite). Values are symbolic expressions for the hoppings/onsite.

coordslist of strings

The coordinates that have been discretized.

Previous topic

kwant.continuum.discretize

Next topic

kwant.continuum.build_discretized

This Page