Superposition wave function object
lkwagner opened this issue · 0 comments
This is a good first issue -- essentially implement the multiply object but with a sum with arbitary coefficients. Would be useful for creating samples for DMD.
The only trick is that you don't want to ever evaluate the total wave function. So for example, suppose that you want to evaluate the sum of two wave functions. They return s1=sign(psi), alpha1=ln(|psi|), s2, alpha2. We'd like to evaluate ln(s1e^alpha1+s2e^alpha2). But evaluating e^alpha1 or e^alpha2 may cause an overflow/underflow. Instead, we can evaluate it as ln(s1e^(alpha1-alpha2)+s2) + alpha2. If we choose things such that alpha2 is the larger of the two (or multiple), then the errors due to floating point, will be minimized, I think.
Similar formulae should be developed for the derivatives.