Produce a propagator that, given a Hamiltonian operator that defines the problem and a wave function at some time t0, propagates the wave function to a later time t1.
One part is the design of the interface. The other part is the implementation of a propagator that uses Runge-Kutta and similar methods to solve the differential equation. At this point, it would be useful to make use of the GNU Scientific Library; it provides several special functions that we can also use later.
Propgator interface that takes wavefunction and propagates to a later time
implementation RungeKuttaPropagator using GSL
- Operator in Constructor; IllegalArgument if null
- solve differential equation with gsl_odeiv2_step_rk4 (Runge-Kutta 4th order)
- Problem: How to test? Wrapper around gsl and use/mock the wrapper? No testing for now; to be discussed next time.
Chat summary today:
We need three classes: a wrapper around the GSL, a wrapper around the differential equation, and a propagator to propagate a wave function.
Definition of the differential equation:
Definition of the wrapper
To test that the wrapper works correctly, there are two tests:
The first version of the propagator is ready. A wrapper around the GSL can be found in src/gsl. Both a propagator class and a wrapper around the differential equation are in src/ode subfolder.
Although some unit tests are already implemented and the propagator is functioning, there are a couple of points to catch up with:
The propagator uses arrays instead of tensors to solve a ode system. This is a temporary solution. For my convenience it was easier for me to handle with C-style arrays since the GNU GSL-library also do so. Nevertheless, the next step should be an adoption of the propagator to be able to work with tensor-arguments. That should not be a big deal. We'll see :)
The remaining test case have to be implemented. More precisely - the second test case, mentioned in the note from 2013-05-05: "Use an exponential function dy/dt = y to check for correct passing of errors. Three test cases: ..."
Last edit: Piotr Bienkiewicz 2013-06-17
During code review some shortcomings shows up regarding to the usage of GSL, particular by the fact that an GSL ode system can be treated only using double values.
The odeint V2-library(http://www.codeproject.com/Articles/268589/odeint-v2-Solving-ordinary-differential-equations) follows a different design approach. Since odeint V2 takes advantage of template metaprogramming there are no such limitations.
In the next step i would try out the odeint V2-library.