Closed PanPalitta closed 9 years ago
In general, a structure of arrays gives you better performance than an array of structures. Given that the complex doubles extensively feature in the speed-critical part of the code, this change would improve execution time.
This is now mainly done. The only place where the complex type remains is the phase_loss_opt function.
The remaining complex variables in phase_loss_opt never appear in templated functions and they are never broadcast via MPI either. I believe it is a good idea to keep them, as they simplify mathematical operations. If you agree, we can close this issue.
I agree. The complex variables in phase_loss_opt is just for generating a quantum state, so it's only relevant for the calculation of the fitness value and nothing else in the optimization process.
There are many problems in making the code support both double and complex number data type, mainly because complex number data consisted of two data and manipulating them are not compatible with other standard numerical types.