# The Schrodinger equation for time-dependent Hamiltonian after one timestep, taking exponential or use ode solver?

The Schrodinger equation for time-dependent Hamiltonian is

$$i\hbar\frac{d}{dt}\psi(t) = H(t)\psi(t) \, .$$

Assuming I knew $\psi(t)$, I want to know $\psi(t+\Delta t)$.

Should I take exponential or use ode solver?

I know that the mathematical solution after one timestep should be (or not?)

$$\psi(t+\Delta t) = e^{-\frac{i}{\hbar}H(t)\Delta t}\psi(t) \, .$$

It gives a different result from using ode solver unfortunately. Which is the most correct one?

• When taking an exponential of a matrix, that's usually much harder than doing a single timestep of an ODE solver. Any time you solve a linear time-independent ODE, that's computing a matrix exponential using an ODE solver instead of using some other method (you seem to be freezing the $H$ during the timestep to convert your problem to this). Also, what do you mean it gives a different result? Have you ruled out bugs in your own code, and can you post an MCVE to show the error and the details? More details about what you're trying to do would really help. – Kirill Oct 16 '16 at 1:45
• Your "mathematical solution" is not correct; you have frozen H over the whole timestep. – David Ketcheson Oct 16 '16 at 12:22
• yes i know but that is the only way i can input numerically and take the timestep to very small – diff Oct 17 '16 at 5:12
• How are you going to compute the matrix/operator exponential? If you approximate it using just the first two Taylor terms, then you end up with exactly one time step of the forward Euler method. – Wolfgang Bangerth Oct 17 '16 at 17:49
• @Wolfgang Bangerth expm function in matlab is what I used. I think it should be pretty accurate in that it keeps a lot of terms. – diff Oct 17 '16 at 22:03