1
General Questions and Answers / evaluate() is really slow for Effective Potential
« on: August 20, 2015, 06:18 »
Hi,
I found this weird issue with using evaluate() on an Effective Potential grid object using ATK 14.2.
This line takes around 100 milliseconds on an object that has 242x223x363 grid points. I have a script that outputs these grid objects to an XYZ format, and it would take days to do this. For some reason this is only happening with Veff objects and not, say, Electron Density. The work around I've found is using the toArray() function, which takes around ~5 seconds to convert to an array and then takes only 50 µs for an access. However, this is annoying because I have to map physical coordinates to array indices, and annoyingly there is no function that does that (gridCoordinate() does the opposite).
I thought you might look into why this is happening.
I found this weird issue with using evaluate() on an Effective Potential grid object using ATK 14.2.
Code
voltage = effective_potential_obj.evaluate (x_coord, y_coord, z_coord, Spin.Sum)
This line takes around 100 milliseconds on an object that has 242x223x363 grid points. I have a script that outputs these grid objects to an XYZ format, and it would take days to do this. For some reason this is only happening with Veff objects and not, say, Electron Density. The work around I've found is using the toArray() function, which takes around ~5 seconds to convert to an array and then takes only 50 µs for an access. However, this is annoying because I have to map physical coordinates to array indices, and annoyingly there is no function that does that (gridCoordinate() does the opposite).
I thought you might look into why this is happening.