Closed jagot closed 4 years ago
Side note: I am unsure whether the time-step should be absorbed into the operator or not; for Krylov approximations to the exponential, one usually computes the subspace without the time-step, and applies it in the subspace exponential
That can be the choice of the solver. If the solver does a direct t*A
it absorbs. But it can write the algorithm other ways of course.
has_expmv
, has_expm
, has_mul
, has_ldiv
should be traits added to the interface that the methods can query for a given operator to throw errors or try something different.
where expmv!(tmp2, A, dt, tmp1) resolves through dispatch to a generic exponentiator (probably the user can set a flag in the DiffEqOperator that :CrankNicolson/:ImplicitEuler is to be used).
Hmm, I'm not so sure about this. I'll have to see what an implementation looks like.
Good reference on different exponential propagators (applied to QM, but written by a mathematician):
@Book{lubich2008from,
author = {Lubich, Christian},
title = {From quantum to classical molecular dynamics : reduced models and numerical analysis},
publisher = {European Mathematical Society},
year = {2008},
address = {Zürich, Switzerland},
isbn = {978-3-03719-067-8}
}
We now have a good linear solver interface.
In relation to #90, and through discussions on Gitter, there is an idea of creating a dual interface to the solvers for linear problems:
For standard methods such as implicit Euler and the trapezoidal rule (Crank–Nicolson), for each
DiffEqOperator
at least aA_mul_B!
should be provided, and optionally a\
.\
can be inferred, e.g. forTridiagonal
,lufact!
could be used. If the operator is not time-dependent (except for an overall scalar coefficient), thelufact!
can be performed ahead of time.Alternatively, the user might specify an optimized
expmv!
implementation.The solution manner should be inferred from the operator, i.e.
has_expmv
, and it should be possible to mix-and-match, i.e. foru' = F(u,t)u
withF = A + B
, the user should be able to provide aexpmv!
forB
and use a Crank–Nicolson propagator forA
:where
expmv!(tmp2, A, dt, tmp1)
resolves through dispatch to a generic exponentiator (probably the user can set a flag in theDiffEqOperator
that:CrankNicolson
/:ImplicitEuler
is to be used).Side note: I am unsure whether the time-step should be absorbed into the operator or not; for Krylov approximations to the exponential, one usually computes the subspace without the time-step, and applies it in the subspace exponential (notation the same as in http://epubs.siam.org/doi/10.1137/0729014):
where
H_m
is the approximation ofA
in them
th Krylov subspace spanned by the columns ofV_m
.