tkwant.onebody.kernels.PerturbationInterpolator

class tkwant.onebody.kernels.PerturbationInterpolator(syst, time_name, time_start, params=None, dt=1)

A class to extract and interpolate W(t).

This class can be used like tkwant.onebody.kernel.PerturbationExtractor, to calculate W(t) and the matrix-vector product W(t) * ket. Interpolation is done only for performance reasons, as W(t) from Kwant is slow to evaluate.

Parameters
  • syst (kwant.builder.FiniteSystem) – The system from which to extract the time-dependent 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.

  • dt (float) – Discretization timestep for the Spline. Must be => 0. For dt = 0, no interpolation is performed, but the result is identical to tkwant.onebody.kernel.PerturbationExtractor.

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, const double complex[:] ket, out=None)

Evaluate the matrix-vector 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 in-place.

Returns

out – The product W(t) @ ket. If an out argument is given, the operation is performed in-place and the routine returns None.

Return type

numpy.ndarray or None

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 in-place.

Returns

out – The matrix W(t). The size of the W(t) matrix is size x size, containing nnz complex entries. If an out argument is given, the operation is performed in-place and the routine returns None.

Return type

coo_matrix or None

Attributes

nnz

The total number of time-dependent matrix elements.

Returns

nnz – The total number of time-dependent matrix elements, equal to len(W(t).data).

Return type

int

size

The size of the W(t) matrix.

Returns

size – The size of the W(t) matrix is size x size.

Return type

int