Commit 00f4c0d7 authored by eric pellegrini's avatar eric pellegrini
Browse files

Fixed bug when using q vectors under NPT conditions

parent e56a01f5
Pipeline #4328 failed with stages
in 9 minutes and 53 seconds
......@@ -124,20 +124,24 @@ class DynamicCoherentStructureFactor(IJob):
return index, None
traj = self.configuration['trajectory']['instance']
qVectors = self.configuration["q_vectors"]["value"][shell]["q_vectors"]
nQVectors = self.configuration["q_vectors"]["value"][shell]["q_vectors"].shape[1]
rho = {}
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, nQVectors), dtype = numpy.complex64)
# loop over the trajectory time steps
for i, frame in enumerate(self.configuration['frames']['value']):
qVectors = self.configuration["q_vectors"]["value"][shell]["q_vectors"]
conf = traj.configuration[frame]
for element,idxs in self._indexesPerElement.items():
selectedCoordinates = numpy.take(conf.array, idxs, axis=0)
rho[element][i,:] = numpy.sum(numpy.exp(1j*, qVectors)),axis=0)
......@@ -183,4 +187,4 @@ class DynamicCoherentStructureFactor(IJob):
REGISTRY['dcsf'] = DynamicCoherentStructureFactor
\ No newline at end of file
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