kwant.system.
System
¶Bases: object
Abstract general low-level 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 real-space position of a site given its index.
Attributes
graph | (kwant.graph.CGraph) The system graph. |
Methods
hamiltonian
(i, j, *args)¶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
hamiltonian_submatrix
(self, args=(), to_sites=None, from_sites=None, sparse=False, return_norb=False)¶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
|
---|---|
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.