kwant.system.
VectorizedSystem
[source]¶Bases: kwant.system.System
Abstract general low-level system with support for vectorization.
site_arrays
[source]¶The sites of the system. The family of each site array must have
norbs
specified.
sequence of SiteArray
site_ranges
[source]¶Has 1 row per site array, plus one extra row. Each row consists
of (first_site, norbs, orb_offset)
: the index of the first
site in the site array, the number of orbitals on each site in
the site array, and the offset of the first orbital of the first
site in the site array. In addition, the final row has the form
(len(graph.num_nodes), 0, tot_norbs)
where tot_norbs
is the
total number of orbitals in the system. Note site_ranges
is directly computable from site_arrays
.
Nx3 integer array
subgraphs
[source]¶Each subgraph has the form ((idx1, idx2), (offsets1, offsets2))
where offsets1
and offsets2
index sites within the site arrays
indexed by idx1
and idx2
.
sequence of tuples
terms
[source]¶Each tuple has the following structure: (subgraph: int, symmetry_element: tuple, hermitian: bool,
parameters: List(str))
subgraph
indexes subgraphs
and supplies the to/from sites of this
term. symmetry_element
is the symmetry group element that should be
applied to the to-sites of this term.
hermitian
is True
if the term needs its Hermitian
conjugate to be added when evaluating the Hamiltonian, and parameters
contains a list of parameter names used when evaluating this term.
sequence of tuples
parameters
[source]¶The names of the parameters on which the system depends. This attribute is provisional and may be changed in a future version of Kwant
frozenset of strings
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.
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
(args=(), sparse=False, return_norb=False, *, params=None)[source]¶Return The system Hamiltonian.
args (tuple, defaults to empty) – Positional arguments to pass to hamiltonian_term
. Mutually
exclusive with ‘params’.
sparse (bool) – Whether to return a sparse or a dense matrix. Defaults to False
.
return_norb (bool) – Whether to return arrays of numbers of orbitals. Defaults to False
.
params (dict, optional) – Dictionary of parameter names and their values. Mutually exclusive with ‘args’.
hamiltonian_part (numpy.ndarray or scipy.sparse.coo_matrix) – The Hamiltonian of the system.
norb (array of integers) – Numbers of orbitals on each site. Only returned when return_norb
is true.
Notes
Providing positional arguments via ‘args’ is deprecated, instead, provide named parameters as a dictionary via ‘params’.
hamiltonian_term
(index, selector=slice(None, None, None), args=(), params=None)[source]¶Return the Hamiltonians for hamiltonian term number k.
index (int) – The index of the term to evaluate.
selector (slice or sequence of int, default: slice(None)) – The elements of the term to evaluate.
args (tuple) – Positional arguments to the term. (Deprecated)
params (dict) – Keyword parameters to the term
hamiltonian (3d complex array) – Has shape (N, P, Q)
where N
is the number of matrix
elements in this term (or the number selected by ‘selector’
if provided), P
and Q
are the number of orbitals in the
‘to’ and ‘from’ site arrays associated with this term.
Providing positional arguments via ‘args’ is deprecated,
instead, provide named parameters as a dictionary via ‘params’.
Attributes