Mercurial > repos > public > sbplib
view +time/+expint/Magnus_mp.m @ 511:57f3493f851b feature/quantumTriangles
Added sqrt of Ji in the right places, not sure about the interfaces, will not test it properly now
author | Ylva Rydin <ylva.rydin@telia.com> |
---|---|
date | Thu, 08 Jun 2017 10:33:36 +0200 |
parents | 566304a5733e |
children | 4ef2d2a493f1 |
line wrap: on
line source
% Takes one time step of size k using the magnus midpoinr % starting from v_0 and where the function F(v,t) gives the % time derivatives. function v = Magnus_mp(v,D, t , k) if isa(D,'function_handle') % v = krylov(k*D(t +k/2*t),v); v = expm(k*D(t +k/2))*v; else %v = krylov(k*D,v); v = expm(k*D)*v; end end