Skip to content

Commit

Permalink
Update green_kubo_ionic_conductivity.py
Browse files Browse the repository at this point in the history
  • Loading branch information
SamTov authored Nov 8, 2024
1 parent 8ac9c31 commit 505e8b0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mdsuite/calculators/green_kubo_ionic_conductivity.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,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.calculators.calculator import call
Expand Down Expand Up @@ -201,7 +201,7 @@ def ensemble_operation(self, ensemble: tf.Tensor):
ensemble = tf.gather(ensemble, self.args.tau_values, axis=1)
jacf = tfp.stats.auto_correlation(ensemble, normalize=False, axis=1, center=False)
jacf = tf.squeeze(tf.reduce_sum(jacf, axis=-1), axis=0)
self.sigmas.append(cumtrapz(jacf, x=self.time))
self.sigmas.append(cumulative_trapezoid(jacf, x=self.time))

return np.array(jacf)

Expand All @@ -213,7 +213,7 @@ def _post_operation_processes(self):
"""
self.acf_array /= self.count
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))
ionic_conductivity = self.prefactor * sigma[self.args.integration_range - 1]
ionic_conductivity_SEM = (
Expand Down

0 comments on commit 505e8b0

Please sign in to comment.