kwant.builder.
FiniteSystem
(builder)[source]¶Finalized Builder
with leads.
Usable as input for the solvers in kwant.solvers
.
sites[i]
is the Site
instance that corresponds
to the integer-labeled site i
of the low-level system. The sites
are ordered first by their family and then by their tag.
The inverse of sites
; maps high-level Site
instances to their integer label.
Satisfies id_by_site[sites[i]] == i
.
Methods
discrete_symmetry
(args=(), *, params=None)[source]¶Return the discrete symmetry of the system.
Providing positional arguments via ‘args’ is deprecated, instead, provide named parameters as a dictionary via ‘params’.
hamiltonian
(i, j, *args, params=None)[source]¶Return the hamiltonian matrix element for sites i
and j
.
If i == j
, return the on-site Hamiltonian of site i
.
if i != j
, return the hopping between site i
and j
.
Hamiltonians may depend (optionally) on positional and keyword arguments.
Providing positional arguments via ‘args’ is deprecated, instead, provide named parameters as a dictionary via ‘params’.
hamiltonian_submatrix
(self, args=(), to_sites=None, from_sites=None, sparse=False, return_norb=False, *, params=None)[source]¶Return a submatrix of the system Hamiltonian.
Positional arguments to pass to the hamiltonian
method. Mutually
exclusive with ‘params’.
Whether to return a sparse or a dense matrix. Defaults to False
.
Whether to return arrays of numbers of orbitals. Defaults to False
.
Dictionary of parameter names and their values. Mutually exclusive with ‘args’.
Submatrix of Hamiltonian of the system.
Numbers of orbitals on each site in to_sites. Only returned when
return_norb
is true.
Numbers of orbitals on each site in from_sites. Only returned when
return_norb
is true.
Notes
The returned submatrix contains all the Hamiltonian matrix elements
from from_sites
to to_sites
. The default for from_sites
and
to_sites
is None
which means to use all sites of the system in the
order in which they appear.
precalculate
(energy=0, args=(), leads=None, what='modes', *, params=None)[source]¶Precalculate modes or self-energies in the leads.
Construct a copy of the system, with the lead modes precalculated, which may significantly speed up calculations where only the system is changing.
Energy at which the modes or self-energies have to be evaluated.
Additional parameters required for calculating the Hamiltionians. Deprecated in favor of ‘params’ (and mutually exclusive with it).
Numbers of the leads to be precalculated. If None
, all are
precalculated.
The quantitity to precompute. ‘all’ will compute both modes and self-energies. Defaults to ‘modes’.
Dictionary of parameter names and their values. Mutually exclusive with ‘args’.
A copy of the original system with some leads precalculated.
Notes
If the leads are precalculated at certain energy or args values, they might give wrong results if used to solve the system with different parameter values. Use this function with caution.
validate_symmetries
(args=(), *, params=None)[source]¶Check that the Hamiltonian satisfies discrete symmetries.
Applies validate
to the
Hamiltonian, see its documentation for details on the return
format.
Providing positional arguments via ‘args’ is deprecated, instead, provide named parameters as a dictionary via ‘params’.