Skip to content

Move zeroing of hamiltonian outside of the matrix function #28

@ksunden

Description

@ksunden

//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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions