kwant.system.
System
[source]¶Bases: object
Abstract general lowlevel system.
Notes
The sites of the system are indexed by integers ranging from 0 to
self.graph.num_nodes  1
.
Optionally, a class derived from System
can provide a method pos
which
is assumed to return the realspace position of a site given its index.
Due to the ordering semantics of sequences, and the fact that a given
first_site
can only appear at most once in site_ranges
,
site_ranges
is ordered according to first_site
.
Consecutive elements in site_ranges
are not required to have different
numbers of orbitals.
Attributes
graph  (kwant.graph.CGraph) The system graph. 
site_ranges  (None or sorted sequence of triples of integers) If provided, encodes ranges of sites that have the same number of orbitals. Each triple consists of (first_site, norbs, orb_offset) : the first site in the range, the number of orbitals on each site in the range, and the offset of the first orbital of the first site in the range. In addition, the final triple should have the form (len(graph.num_nodes), 0, tot_norbs) where tot_norbs is the total number of orbitals in the system. 
parameters  (frozenset of strings) The names of the parameters on which the system depends. 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.