qit.utils.expv¶
- qit.utils.expv(t, A, v, tol=1e-07, m=30, iteration='arnoldi')¶
Multiply a vector by an exponentiated matrix.
Approximates
using a Krylov subspace technique. Efficient for large sparse matrices. The basis for the Krylov subspace is constructed using either Arnoldi or Lanczos iteration.- Parameters
t (array[float]) – vector of nondecreasing time instances >= 0,
len(t) == s
A (array[complex]) – n*n matrix (usually sparse)
v (array[complex]) – n-dimensional vector
tol (float) – tolerance
m (int) – Krylov subspace dimension,
m <= n
iteration (str) – iteration type, in (‘arnoldi’, ‘lanczos’). Lanczos is faster but requires a Hermitian
A
.
- Returns
result vectors as a (s, n) array, total truncation error estimate, hump size
- Return type
array[complex], float, float
The result is
. The hump size isUses the sparse algorithm from [28].