tkwant.onebody.kernels.PerturbationExtractor¶

class
tkwant.onebody.kernels.
PerturbationExtractor
(syst, time_name, time_start, params=None)¶ Extract the timedependent perturbation to the Hamiltonian.
The total Hamiltonian can be split into two parts: the stationary part and the timedependent perturbation, i.e. H(t) = H_0 + W(t). This routine extracts the W(t) part from the Kwant system that specifies the H(t).
 Parameters
syst (
kwant.builder.FiniteSystem
) – The system from which to extract the timedependent perturbation.time_name (str) – The name of the time argument. Only sites with Hamiltonian value functions with the argument name time_name are extracted into W(t).
time_start (float) – The initial time.
params (dict, optional) – Extra arguments to pass to the Hamiltonian of
syst
, excluding time.
Notes
By definition the perturbation is defined with respect to the initial time. The perturbation should be therefore zero for times t < time_start. This is not inforced by this routine however, but W(t) is always evaluated with the time argument it gets.
Methods

apply
(self, double time, ket, out=None)¶ Evaluate the matrixvector product W(t) @ ket for the given time.
 Parameters
time (int or float) – Time argument, must be equal or larger than time_start.
out (
numpy.ndarray
, optional) – Sparse matrix with to perform the operation inplace. If provided, array must be zero on input.
 Returns
out – The product W(t) @ ket. If an
out
argument is given, the operation is performed inplace and the routine returns None. Return type
numpy.ndarray
or None

data
(self, double time, out=None)¶ Return the timedependent matrix elements.
 Parameters
time (int or float) – Time argument, must be equal or larger than time_start.
out (
numpy.ndarray
, optional) – Data array of the W(t) matrix for operation inplace.
 Returns
out – Data array of the W(t) matrix (W(t).data). If an
out
argument is given, the operation is performed inplace and the routine returns None. Return type
numpy.ndarray
or None

empty
(self)¶ Return an empty W(t) matrix with correct shape and indices.
 Returns
out – An “empty” W(t) matrix filled with zeros.
 Return type

evaluate
(self, double time, out=None)¶ Evaluate the W(t) matrix for the given time t.
 Parameters
time (int or float) – Time argument, must be equal or larger than time_start.
out (
coo_matrix
, optional) – Sparse matrix with to perform the operation inplace.
 Returns
out – The matrix W(t). The size of the W(t) matrix is
size
xsize
, containingnnz
complex entries. If anout
argument is given, the operation is performed inplace and the routine returns None. Return type
coo_matrix
or None

row_col
(self)¶ Return the row and column vectors of the W(t) matrix.
 Returns
row (
np.ndarray
) – Row vector of the W(t) matrix in coo format.col (
np.ndarray
) – Column vector of the W(t) matrix in coo format.
Attributes

nnz
¶ The total number of timedependent matrix elements.
 Returns
nnz – The total number of timedependent matrix elements, equal to len(W(t).data).
 Return type