|
//TODO: zero once, take this loop out of the inner most loop |
|
for (int i=0; i<ham.nStates * ham.nStates; i++) out[i] = pycuda::complex<double>(); |
While nice to not need to remember, the zeroing does nothing for any call other than the first. Elements which already have a value will be overwritten. Elements which are zero don't need to be.
This only needs to be done once, not at every time step.
Either move this loop to the calling function (runge-kutta for now), or add a boolean argument to the function, and hide this behind an if statement.
WrightSim/WrightSim/hamiltonian/default.py
Lines 288 to 289 in 8c23c24
While nice to not need to remember, the zeroing does nothing for any call other than the first. Elements which already have a value will be overwritten. Elements which are zero don't need to be.
This only needs to be done once, not at every time step.
Either move this loop to the calling function (runge-kutta for now), or add a boolean argument to the function, and hide this behind an if statement.