Commit d7a22b4a authored by Gonzalez, Miguel's avatar Gonzalez, Miguel Committed by Remi Perenon

Correct Q vectors in CurrentCorrelationFunction and avoid unnecessary conversion in DCSF (issue 24)

parent e1965474
...@@ -129,10 +129,6 @@ class CurrentCorrelationFunction(IJob): ...@@ -129,10 +129,6 @@ class CurrentCorrelationFunction(IJob):
qVectors = self.configuration["q_vectors"]["value"][shell]["q_vectors"] qVectors = self.configuration["q_vectors"]["value"][shell]["q_vectors"]
qVectors = traj.universe._boxToRealPointArray(qVectors.T)
qVectors = qVectors.T
nQVectors = qVectors.shape[1] nQVectors = qVectors.shape[1]
rho = {} rho = {}
......
...@@ -128,10 +128,6 @@ class DynamicCoherentStructureFactor(IJob): ...@@ -128,10 +128,6 @@ class DynamicCoherentStructureFactor(IJob):
qVectors = self.configuration["q_vectors"]["value"][shell]["q_vectors"] qVectors = self.configuration["q_vectors"]["value"][shell]["q_vectors"]
qVectors = traj.universe._boxToRealPointArray(qVectors.T)
qVectors = qVectors.T
rho = {} rho = {}
for element in self.configuration['atom_selection']['unique_names']: for element in self.configuration['atom_selection']['unique_names']:
rho[element] = numpy.zeros((self._nFrames, qVectors.shape[1]), dtype = numpy.complex64) rho[element] = numpy.zeros((self._nFrames, qVectors.shape[1]), dtype = numpy.complex64)
...@@ -141,8 +137,6 @@ class DynamicCoherentStructureFactor(IJob): ...@@ -141,8 +137,6 @@ class DynamicCoherentStructureFactor(IJob):
conf = traj.configuration[frame] conf = traj.configuration[frame]
conf.convertToBoxCoordinates()
for element,idxs in self._indexesPerElement.items(): for element,idxs in self._indexesPerElement.items():
selectedCoordinates = numpy.take(conf.array, idxs, axis=0) selectedCoordinates = numpy.take(conf.array, idxs, axis=0)
rho[element][i,:] = numpy.sum(numpy.exp(1j*numpy.dot(selectedCoordinates, qVectors)),axis=0) rho[element][i,:] = numpy.sum(numpy.exp(1j*numpy.dot(selectedCoordinates, qVectors)),axis=0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment