kwant.system.
FiniteSystem
[source]¶Bases: kwant.system.System
Abstract finite lowlevel system, possibly with leads.
Notes
The length of leads
must be equal to the length of lead_interfaces
and lead_paddings
.
For lead n
, the method leads[n].selfenergy must return a square matrix
whose size is sum(len(self.hamiltonian(site, site)) for site in
self.lead_interfaces[n])
. The output of leads[n].modes
has to be a
tuple of PropagatingModes
, StabilizedModes
.
Often, the elements of leads will be instances of InfiniteSystem
. If
this is the case for lead n
, the sites lead_interfaces[n]
match
the first len(lead_interfaces[n])
sites of the InfiniteSystem.
Attributes
leads  (sequence of leads) Each lead has to provide a method selfenergy that has the same signature as InfiniteSystem.selfenergy (without the self parameter), and must have property parameters : a collection of strings that name the system parameters ( though this requirement is provisional and may be removed in a future version of Kwant). It may also provide modes that has the same signature as InfiniteSystem.modes (without the self parameter). 
lead_interfaces  (sequence of sequences of integers) Each subsequence contains the indices of the system sites to which the lead is connected. 
lead_paddings  (sequence of sequences of integers) Each subsequence contains the indices of the system sites that belong to the lead, and therefore have the same onsite as the lead sites, and are connected by the same hoppings as the lead sites. 
parameters  (frozenset of strings) The names of the parameters on which the system depends. This does not include the parameters for any leads. This attribute is provisional and may be changed in a future version of Kwant 
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 onsite 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.
Parameters:  args : tuple, defaults to empty
to_sites : sequence of sites or None (default) from_sites : sequence of sites or None (default) sparse : bool
return_norb : bool
params : dict, optional


Returns:  hamiltonian_part : numpy.ndarray or scipy.sparse.coo_matrix
to_norb : array of integers
from_norb : array of integers

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 selfenergies 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.
Parameters:  energy : float
args : sequence
leads : sequence of integers or None
what : ‘modes’, ‘selfenergy’, ‘all’
params : dict, optional


Returns:  syst : FiniteSystem

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’.