Skip to content

Commit

Permalink
Update green_kubo_self_diffusion_coefficients.py
Browse files Browse the repository at this point in the history
  • Loading branch information
SamTov authored Nov 8, 2024
1 parent 505e8b0 commit 066ab83
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mdsuite/calculators/green_kubo_self_diffusion_coefficients.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from bokeh.models import HoverTool, LinearAxis, Span
from bokeh.models.ranges import Range1d
from bokeh.plotting import figure
from scipy.integrate import cumtrapz
from scipy.integrate import cumulative_trapezoid
from tqdm import tqdm

from mdsuite import utils
Expand Down Expand Up @@ -198,7 +198,7 @@ def ensemble_operation(self, ensemble):
# average particles, sum dimensions
return_vacf = tf.reduce_sum(tf.reduce_sum(vacf, axis=0), -1)
self.sigmas.append(
cumtrapz(tf.reduce_sum(tf.reduce_mean(vacf, axis=0), -1), x=self.time)
cumulative_trapezoid(tf.reduce_sum(tf.reduce_mean(vacf, axis=0), -1), x=self.time)
)

return np.array(return_vacf)
Expand Down Expand Up @@ -280,7 +280,7 @@ def postprocessing(self, species: str):
"""
self.acf_array = self.acf_array / self.count
self.sigmas = np.array(self.sigmas)
sigma = cumtrapz(self.acf_array, x=self.time)
sigma = cumulative_trapezoid(self.acf_array, x=self.time)
sigma_SEM = np.std(self.sigmas, axis=0) / np.sqrt(len(self.sigmas))

diff_coeff = 1 / 3 * sigma[self.args.integration_range - 1]
Expand Down

0 comments on commit 066ab83

Please sign in to comment.