# tkwant.onebody.WaveFunction¶

class tkwant.onebody.WaveFunction(H0, W, psi_init, energy=None, params=None, time_start=0, time_name='time', kernel_type=<class 'tkwant.onebody.kernels.Simple'>, solver_type=<class 'tkwant.onebody.solvers.Scipy'>, work=None, inplace=False, tmax=None)[source]

A class to solve the time-dependent single-particle wavefunction.

The time-dependent single-particle Schrödinger equation is

$$i \partial_t \psi = (H_0 + W(t)) \psi$$,

where the total Hamiltonian $$H(t) = H_0 + W(t)$$ has been splitted into a static part $$H_0$$ and a time-dependent perturbation $$W(t)$$. Moreover, the initial condition is $$\psi(t_0)$$ and $$W(t)$$ is expected to be absent before the initial time $$t_0$$:

$$W(t) = 0 \,\, \text{for} \,\, t \leq t_0$$.

If an energy $$E$$ is provided, this routine expects that the initial condition represents the scattering state $$\psi_{st}$$ that solves the time-independent Schrödinger equation

$$H_0 \psi_{st} = E \psi_{st}, \, \psi_{st} = \psi(t_0)$$.

For numerical reasons, the evolution is then performed in the variable

$$i \partial_t \bar{\psi} = (H_0 + W(t) - E) \bar{\psi} + W(t) \psi_{st}$$,

where

$$\psi = (\bar{\psi} - \psi_{st}) e^{-i E (t - t_0)}$$.

Parameters
• H0 (array-like) – The static part of the Hamiltonian matrix, $$H_0$$.

• W (callable or None) – Time-dependent part of the Hamiltonian matrix, $$W(t)$$. Typically the object returned by tkwant.system.extract_perturbation.

• psi_init (array of complex) – The state $$\psi(t_0)$$ from which to start, defined over the central region.

• energy (float, optional) – If provided, then psi_init is assumed to be an eigenstate of energy $$E$$. If the Hamiltonian represents an open quantum system with leads, then psi_init is assumed to be the projection of a scattering state at energy $$E$$ on to the central part of the system.

• params (dict, optional) – Extra arguments to pass to the time-dependent Hamiltonian function $$W(t)$$, excluding time.

• time_start (float, optional) – The initial time $$t_0$$. Default value is zero.

• time_name (str, optional) – The name of the time argument $$t$$. Default name: time.

• kernel_type (tkwant.onebody.solvers.default, optional) – The kernel to calculate the right-hand-site of the Schrödinger equation.

• solver_type (tkwant.onebody.solvers.default, optional) – The solver used to evolve the wavefunction forward in time.

• work (ndarray of complex, optional) – Workarray of size H0.shape[0] for performance and memory optimization.

• inplace (bool, optional) – If true and energy is not None, the term H0 - E is calculated inplace in order to save memory. If energy is None, inplace has no effect.

• tmax (float, optional) – Optional maximal time until when the boundary is valid.

Methods

add_perturbation(qt)[source]

Add a time-dependent perturbation to the Hamiltonian

H(t) = H_0 + W(t)

it is modified to

H(t) = H_0 + W(t) + Q(t)

evaluate(observable)[source]

Evaluate the expectation value of an operator at the current time t.

For an operator $$\hat{O}$$ the expectation value is $$O(t) = \langle \psi(t) | \hat{O} |\psi(t) \rangle$$.

Parameters

observable (callable or kwant.operator) – An operator $$\hat{O}$$ to evaluate the expectation value. Must have the calling signature of kwant.operator.

Returns

result – The expectation value $$O(t)$$ of observable.

Return type

numpy array

evolve(time)[source]

Evolve the wavefunction $$\psi(t)$$ foreward in time up to $$t =$$ time.

Parameters

time (int or float) – time argument up to which the solver should be evolved

classmethod from_kwant(syst, psi_init, boundaries=None, energy=None, params=None, time_start=0, time_name='time', kernel_type=<class 'tkwant.onebody.kernels.Simple'>, solver_type=<class 'tkwant.onebody.solvers.Scipy'>, perturbation_type=<class 'tkwant.onebody.kernels.PerturbationInterpolator'>)[source]

Set up a time-dependent onebody wavefunction from a kwant system.

Parameters
• syst (kwant.builder.FiniteSystem) – The low level system for which the wave functions are to be calculated.

• psi_init (array of complex) – The state from which to start, defined over the central region.

• boundaries (sequence of BoundaryBase, optional) – The boundary conditions for each lead attached to syst. Must be provided for a system with leads.

• energy (float, optional) – If provided, then psi_init is assumed to be an eigenstate of energy E. If syst has leads, then psi_init is assumed to be the projection of a scattering state at energy E on to the central part of the system.

• params (dict, optional) – Extra arguments to pass to the Hamiltonian of syst, excluding time.

• time_start (float, optional) – The initial time $$t_0$$. Default value is zero.

• time_name (str, optional) – The name of the time argument $$t$$. Default name: time.

• kernel_type (tkwant.onebody.solvers.default, optional) – The kernel to calculate the right-hand-site of the Schrödinger equation.

• solver_type (tkwant.onebody.solvers.default, optional) – The solver used to evolve the wavefunction forward in time.

• perturbation_type (tkwant.onebody.kernels.ExtractPerturbation, optional) – Class to extract the time dependent perturbation $$W(t)$$ out of syst.

Returns

wave_function – A time-dependent onebody wavefunction at the initial time.

Return type

tkwant.onebody.WaveFunction

psi()[source]

Return the wavefunction $$\psi(t)$$ at the current time t.

psindarray

The wavefunction at time. If this wavefunction is for a system with leads, then the wavefunction projected onto the central region is returned.