mdsuite.calculators package¶
Submodules¶
- mdsuite.calculators.angular_distribution_function module
- License
- Contact Information
- Citation
- Summary
AngularDistributionFunction
AngularDistributionFunction.batch_size
AngularDistributionFunction.n_minibatches
AngularDistributionFunction.n_confs
AngularDistributionFunction.r_cut
AngularDistributionFunction.start
AngularDistributionFunction.stop
AngularDistributionFunction.bins
AngularDistributionFunction.use_tf_function
AngularDistributionFunction.check_input()
AngularDistributionFunction.plot_data()
AngularDistributionFunction.prepare_computation()
AngularDistributionFunction.run_calculator()
Args
- mdsuite.calculators.calculator module
- License
- Contact Information
- Citation
- Summary
Calculator
Calculator.experiment
Calculator.experiments
Calculator.plot
Calculator.system_property
Calculator.experimental
Calculator.selected_species
Calculator.analysis_name
Calculator.time
Calculator.plotter
Calculator.result_keys
Calculator.result_series_keys
Calculator.prefactor
Calculator.x_label
Calculator.y_label
Calculator._dtype
Calculator.plot_array
Calculator.dtype
Calculator.plot_data()
Calculator.run_analysis()
Calculator.run_calculator()
Calculator.run_visualization()
call()
- mdsuite.calculators.coordination_number_calculation module
- License
- Contact Information
- Citation
- Summary
Args
CoordinationNumbers
CoordinationNumbers.experiment
CoordinationNumbers.data_range
CoordinationNumbers.x_label
CoordinationNumbers.y_label
CoordinationNumbers.analysis_name
CoordinationNumbers.file_to_study
CoordinationNumbers.integral_data
CoordinationNumbers.species_tuple
CoordinationNumbers.indices
CoordinationNumbers.rdf_data
CoordinationNumbers.db_computation
CoordinationNumbers.experiment
CoordinationNumbers.experiments
CoordinationNumbers.plot_data()
CoordinationNumbers.rdf_data
CoordinationNumbers.run_calculator()
- mdsuite.calculators.einstein_diffusion_coefficients module
- mdsuite.calculators.einstein_distinct_diffusion_coefficients module
- License
- Contact Information
- Citation
- Summary
Args
EinsteinDistinctDiffusionCoefficients
EinsteinDistinctDiffusionCoefficients.experiment
EinsteinDistinctDiffusionCoefficients.species
EinsteinDistinctDiffusionCoefficients.x_label
EinsteinDistinctDiffusionCoefficients.y_label
EinsteinDistinctDiffusionCoefficients.analysis_name
EinsteinDistinctDiffusionCoefficients.loaded_property
EinsteinDistinctDiffusionCoefficients.check_input()
EinsteinDistinctDiffusionCoefficients.run_calculator()
- mdsuite.calculators.einstein_helfand_ionic_conductivity module
- mdsuite.calculators.einstein_helfand_thermal_conductivity module
- License
- Contact Information
- Citation
- Summary
Args
EinsteinHelfandThermalConductivity
EinsteinHelfandThermalConductivity.experiment
EinsteinHelfandThermalConductivity.x_label
EinsteinHelfandThermalConductivity.y_label
EinsteinHelfandThermalConductivity.analysis_name
EinsteinHelfandThermalConductivity.loaded_property
EinsteinHelfandThermalConductivity.check_input()
EinsteinHelfandThermalConductivity.ensemble_operation()
EinsteinHelfandThermalConductivity.run_calculator()
- mdsuite.calculators.einstein_helfand_thermal_kinaci module
- License
- Contact Information
- Citation
- Summary
Args
EinsteinHelfandThermalKinaci
EinsteinHelfandThermalKinaci.experiment
EinsteinHelfandThermalKinaci.x_label
EinsteinHelfandThermalKinaci.y_label
EinsteinHelfandThermalKinaci.analysis_name
EinsteinHelfandThermalKinaci.loaded_property
EinsteinHelfandThermalKinaci.check_input()
EinsteinHelfandThermalKinaci.ensemble_operation()
EinsteinHelfandThermalKinaci.run_calculator()
- mdsuite.calculators.green_kubo_distinct_diffusion_coefficients module
- License
- Contact Information
- Citation
- Summary
Args
GreenKuboDistinctDiffusionCoefficients
GreenKuboDistinctDiffusionCoefficients.x_label
GreenKuboDistinctDiffusionCoefficients.y_label
GreenKuboDistinctDiffusionCoefficients.analysis_name
GreenKuboDistinctDiffusionCoefficients.loaded_property
GreenKuboDistinctDiffusionCoefficients.check_input()
GreenKuboDistinctDiffusionCoefficients.ensemble_operation()
GreenKuboDistinctDiffusionCoefficients.plot_data()
GreenKuboDistinctDiffusionCoefficients.run_calculator()
- mdsuite.calculators.green_kubo_ionic_conductivity module
- License
- Contact Information
- Citation
- Summary
Args
GreenKuboIonicConductivity
GreenKuboIonicConductivity.experiment
GreenKuboIonicConductivity.x_label
GreenKuboIonicConductivity.y_label
GreenKuboIonicConductivity.analysis_name
GreenKuboIonicConductivity.loaded_property
GreenKuboIonicConductivity.check_input()
GreenKuboIonicConductivity.ensemble_operation()
GreenKuboIonicConductivity.plot_data()
GreenKuboIonicConductivity.run_calculator()
- mdsuite.calculators.green_kubo_self_diffusion_coefficients module
- License
- Contact Information
- Citation
- Summary
Args
GreenKuboDiffusionCoefficients
GreenKuboDiffusionCoefficients.species
GreenKuboDiffusionCoefficients.x_label
GreenKuboDiffusionCoefficients.y_label
GreenKuboDiffusionCoefficients.analysis_name
GreenKuboDiffusionCoefficients.loaded_property
GreenKuboDiffusionCoefficients.check_input()
GreenKuboDiffusionCoefficients.ensemble_operation()
GreenKuboDiffusionCoefficients.plot_data()
GreenKuboDiffusionCoefficients.postprocessing()
GreenKuboDiffusionCoefficients.run_calculator()
- mdsuite.calculators.green_kubo_thermal_conductivity module
- mdsuite.calculators.green_kubo_viscosity module
- mdsuite.calculators.green_kubo_viscosity_flux module
- mdsuite.calculators.kirkwood_buff_integrals module
- License
- Contact Information
- Citation
- Summary
Args
KirkwoodBuffIntegral
KirkwoodBuffIntegral.experiment
KirkwoodBuffIntegral.data_range
KirkwoodBuffIntegral.x_label
KirkwoodBuffIntegral.y_label
KirkwoodBuffIntegral.analysis_name
KirkwoodBuffIntegral.file_to_study
KirkwoodBuffIntegral.data_files
KirkwoodBuffIntegral.species_tuple
KirkwoodBuffIntegral.plot_data()
KirkwoodBuffIntegral.run_calculator()
- mdsuite.calculators.nernst_einstein_ionic_conductivity module
- mdsuite.calculators.potential_of_mean_force module
- License
- Contact Information
- Citation
- Summary
Args
PotentialOfMeanForce
PotentialOfMeanForce.experiment
PotentialOfMeanForce.data_range
PotentialOfMeanForce.x_label
PotentialOfMeanForce.y_label
PotentialOfMeanForce.analysis_name
PotentialOfMeanForce.file_to_study
PotentialOfMeanForce.data_files
PotentialOfMeanForce.selected_species
PotentialOfMeanForce.get_pomf_peaks()
PotentialOfMeanForce.plot_data()
PotentialOfMeanForce.run_calculator()
- mdsuite.calculators.radial_distribution_function module
- License
- Contact Information
- Citation
- Summary
Args
RadialDistributionFunction
RadialDistributionFunction.experiment
RadialDistributionFunction.data_range
RadialDistributionFunction.x_label
RadialDistributionFunction.y_label
RadialDistributionFunction.analysis_name
RadialDistributionFunction.loaded_property
RadialDistributionFunction.minibatch
RadialDistributionFunction.bin_minibatch()
RadialDistributionFunction.check_input()
RadialDistributionFunction.combine_dictionaries()
RadialDistributionFunction.compute_species_values()
RadialDistributionFunction.get_dij()
RadialDistributionFunction.ideal_correction
RadialDistributionFunction.particles_list
RadialDistributionFunction.plot_data()
RadialDistributionFunction.prepare_computation()
RadialDistributionFunction.run_calculator()
RadialDistributionFunction.run_minibatch_loop()
- mdsuite.calculators.spatial_distribution_function module
- mdsuite.calculators.structure_factor module
- mdsuite.calculators.trajectory_calculator module
- License
- Contact Information
- Citation
- Summary
TrajectoryCalculator
TrajectoryCalculator.data_resolution
TrajectoryCalculator.loaded_property
TrajectoryCalculator.dependency
TrajectoryCalculator.scale_function
TrajectoryCalculator.batch_size
TrajectoryCalculator.n_batches
TrajectoryCalculator.remainder
TrajectoryCalculator.minibatch
TrajectoryCalculator.memory_manager
TrajectoryCalculator.data_manager
TrajectoryCalculator._database
TrajectoryCalculator.database
TrajectoryCalculator.get_batch_dataset()
TrajectoryCalculator.get_ensemble_dataset()
- mdsuite.calculators.transformations_reference module
Module contents¶
MDSuite: A Zincwarecode package.
License¶
This program and the accompanying materials are made available under the terms of the Eclipse Public License v2.0 which accompanies this distribution, and is available at https://www.eclipse.org/legal/epl-v20.html
SPDX-License-Identifier: EPL-2.0
Copyright Contributors to the Zincwarecode Project.
Contact Information¶
email: zincwarecode@gmail.com github: https://github.com/zincware web: https://zincwarecode.com/
Citation¶
If you use this module please cite us with:
Summary¶
- class mdsuite.calculators.AngularDistributionFunction(**kwargs)[source]¶
Bases:
TrajectoryCalculator
,ABC
Compute the Angular Distribution Function for all species combinations.
- use_tf_function¶
activate the tf.function decorator for the minibatches. Can speed up the calculation significantly, but may lead to excessive use of memory! During the first batch, this function will be traced. Tracing is slow, so this might only be useful for a larger number of batches.
- Type:
bool, default False
Examples
- experiment.run_computation.AngularDistributionFunction(n_confs = 100,
r_cut = 3.2, batch_size = 10, n_minibatches = 50, start = 0, stop = 200, bins = 100, use_tf_function = False)
- class mdsuite.calculators.Calculator(experiment: Experiment = None, experiments: List[Experiment] = None)[source]¶
Bases:
CalculatorDatabase
Parent class for analysis modules.
- experiment¶
Experiment for which the calculator will be run.
- Type:
- experiments¶
List of experiments on which to run the calculator.
- Type:
List[Experiment]
- system_property¶
If the calculator returns a value for the whole system such as ionic conductivity or viscosity as opposed to a species-specific number.
- Type:
bool (default = False)
- experimental¶
If true, a warning is raised upon calling this calculator with more information about why it is experimental.
- Type:
bool (default = False)
- time¶
Time array over which to integrate and plot.
- Type:
np.ndarray
- plotter¶
Data visualizer class for use in the plotting.
- Type:
- result_keys¶
keys to use when storing the results. e.g. [“diffusion_coefficient”, “uncertainty”]
- Type:
- _dtype¶
dtype required by the analysis.
- Type:
object = tf.float64
- property dtype¶
Get the dtype used for the calculator.
- plot_data(data)[source]¶
Plot the data coming from the database.
- Parameters:
data (db.Compution.data_dict) – associated with the current project
- run_visualization(x_data: ndarray, y_data: ndarray, title: str, layouts: Optional[object] = None)[source]¶
Run a visualization session on the data.
- Parameters:
layouts (object) – Additional plot features that may be added. See https://docs.bokeh.org/en/latest/docs/reference/models.html for more information.
x_data (np.ndarray) – Data to be plotted along the x axis
y_data (np.ndarray) – Data to be plotted along the y-axis
title (str) – Title of the analysis.
- Return type:
Updates the plot array with a Bokeh plot object.
- class mdsuite.calculators.CoordinationNumbers(**kwargs)[source]¶
Bases:
Calculator
Class for the calculation of coordination numbers.
- experiment¶
Class object of the experiment.
- Type:
class object
- data_range¶
Range over which the property should be evaluated. This is not applicable to the current analysis as the full rdf will be calculated.
- Type:
int (default=500)
- rdf_data¶
RDF data from the user to use in the computation.
- Type:
Examples
experiment.run.CoordinationNumbers( savgol_order = 2, savgol_window_length = 17 )
- rdf_data: Computation¶
- class mdsuite.calculators.EinsteinDiffusionCoefficients(**kwargs)[source]¶
Bases:
TrajectoryCalculator
,ABC
Class for the Einstein diffusion coefficient implementation.
- msd_array¶
MSd data updated during each ensemble computation.
- Type:
np.ndarray
Examples
- project.experiment.run.EinsteinDiffusionCoefficients(data_range=500,
plot=True, correlation_time=10)
- ensemble_operation(ensemble)[source]¶
Calculate and return the msd.
- Parameters:
ensemble (tf.Tensor) – An ensemble of data to be operated on.
- Return type:
MSD of the tensor_values.
- class mdsuite.calculators.EinsteinDistinctDiffusionCoefficients(**kwargs)[source]¶
Bases:
TrajectoryCalculator
Class for the Green-Kubo diffusion coefficient implementation.
Examples
- experiment.run_computation.EinsteinDistinctDiffusionCoefficients(data_range=500,
plot=True, correlation_time=10)
- class mdsuite.calculators.EinsteinHelfandIonicConductivity(**kwargs)[source]¶
Bases:
TrajectoryCalculator
,ABC
Class for the Einstein-Helfand Ionic Conductivity.
Examples
- experiment.run_computation.EinsteinHelfandTIonicConductivity(data_range=500,
plot=True, correlation_time=10)
- class mdsuite.calculators.EinsteinHelfandThermalConductivity(**kwargs)[source]¶
Bases:
TrajectoryCalculator
,ABC
Class for the Einstein-Helfand Ionic Conductivity.
Examples
- experiment.run.EinsteinHelfandTThermalConductivity(data_range=500,
plot=True, correlation_time=10)
- class mdsuite.calculators.EinsteinHelfandThermalKinaci(**kwargs)[source]¶
Bases:
TrajectoryCalculator
,ABC
Class for the Einstein-Helfand Ionic Conductivity.
Examples
- experiment.run_computation.EinsteinHelfandThermalKinaci(data_range=500,
plot=True, correlation_time=10)
- class mdsuite.calculators.GreenKuboDiffusionCoefficients(**kwargs)[source]¶
Bases:
TrajectoryCalculator
,ABC
Class for the Green-Kubo diffusion coefficient implementation .. attribute:: experiment
Experiment class to call from
- type:
object
Examples
- experiment.run_computation.GreenKuboSelfDiffusionCoefficients(data_range=500,
plot=True, correlation_time=10)
- ensemble_operation(ensemble)[source]¶
Calculate and return the msd.
- Parameters:
ensemble –
- Return type:
MSD of the tensor_values.
- plot_data(data: dict)[source]¶
Plot the data.
- Parameters:
data (dict) – Data loaded from the sql database to be plotted.
- class mdsuite.calculators.GreenKuboDistinctDiffusionCoefficients(**kwargs)[source]¶
Bases:
TrajectoryCalculator
,ABC
Class for the Green-Kubo diffusion coefficient implementation .. attribute:: experiment
Experiment class to call from
- type:
object
Examples
experiment.run_computation.GreenKuboDistinctDiffusionCoefficients(data_range=500, plot=True, correlation_time=10)
- class mdsuite.calculators.GreenKuboIonicConductivity(**kwargs)[source]¶
Bases:
TrajectoryCalculator
,ABC
Class for the Green-Kubo ionic conductivity implementation.
Examples
experiment.run_computation.GreenKuboIonicConductivity(data_range=500, plot=True, correlation_time=10)
- class mdsuite.calculators.GreenKuboThermalConductivity(**kwargs)[source]¶
Bases:
TrajectoryCalculator
,ABC
Class for the Green-Kubo Thermal conductivity implementation.
Examples
experiment.run_computation.GreenKuboThermalConductivity(data_range=500, plot=True, correlation_time=10)
- class mdsuite.calculators.GreenKuboViscosity(**kwargs)[source]¶
Bases:
TrajectoryCalculator
,ABC
Class for the Green-Kubo ionic conductivity implementation.
Examples
experiment.run_computation.GreenKuboViscosity(data_range=500, plot=True, correlation_time=10)
- class mdsuite.calculators.GreenKuboViscosityFlux(**kwargs)[source]¶
Bases:
TrajectoryCalculator
,ABC
Class for the Green Kubo viscosity from flux implementation.
Examples
- experiment.run_computation.GreenKuboViscosityFlux(data_range=500,
plot=True, correlation_time=10)
- class mdsuite.calculators.KirkwoodBuffIntegral(**kwargs)[source]¶
Bases:
Calculator
Class for the calculation of the Kirkwood-Buff integrals.
- experiment¶
Class object of the experiment.
- Type:
class object
- data_range¶
Range over which the property should be evaluated. This is not applicable to the current analysis as the full rdf will be calculated.
- Type:
int (default=500)
- rdf = None
rdf tensor_values being studied.
- Type:
- radii = None
radii tensor_values corresponding to the rdf.
- Type:
Examples
experiment.run.KirkwoodBuffIntegral()
- class mdsuite.calculators.NernstEinsteinIonicConductivity(**kwargs)[source]¶
Bases:
Calculator
Class for the calculation of the Nernst-Einstein ionic conductivity.
Examples
experiment.run_computation.NernstEinsteinIonicConductivity()
- class mdsuite.calculators.PotentialOfMeanForce(**kwargs)[source]¶
Bases:
Calculator
Class for the calculation of the potential of mean-force.
The potential of mean-force is a measure of the binding strength between atomic species in a experiment.
- experiment¶
Class object of the experiment.
- Type:
class object
- data_range¶
Range over which the property should be evaluated. This is not applicable to the current analysis as the full rdf will be calculated.
- Type:
int (default=500)
- rdf = None
rdf tensor_values being studied.
- Type:
- radii = None
radii tensor_values corresponding to the rdf.
- Type:
Examples
- experiment.run_computation.PotentialOfMeanForce(savgol_order = 2,
savgol_window_length = 17)
- get_pomf_peaks(pomf_data: ndarray) ndarray [source]¶
Calculate the maximums of the rdf.
- Parameters:
pomf_data (np.ndarray) – POMF data to use in the peak detection.
- Returns:
peaks – Peaks to be used in the calculation.
- Return type:
np.ndarray
- Raises:
ValueError – Raised if the number of peaks required for the analysis are not met.
- class mdsuite.calculators.RadialDistributionFunction(**kwargs)[source]¶
Bases:
TrajectoryCalculator
,ABC
Class for the calculation of the radial distribution function.
- data_range¶
Number of configurations to use in each ensemble
- minibatch¶
Size of an individual minibatch, if set. By default mini-batching is not applied
- Type:
int, default None
Examples
project = mdsuite.Project() project.run.RadialDistributionFunction(number_of_configurations=500)
- static bin_minibatch(start, stop, indices, d_ij, bin_range, number_of_bins, cutoff) tf.Tensor [source]¶
Compute the minibatch histogram.
- check_input()[source]¶
Check the input of the call method and store defaults if needed.
- Return type:
Updates class attributes if required.
- static combine_dictionaries(dict_a: dict, dict_b: dict)[source]¶
Combine two dictionaries in a tf.function call.
- compute_species_values(indices: Tensor, start_batch, d_ij: Tensor) dict [source]¶
Compute species-wise histograms.
- Parameters:
indices (tf.Tensor) – indices of the d_ij distances in the shape (x, 2)
start_batch (int) – starts from 0 and increments by atoms_per_batch every batch
d_ij (tf.Tensor) – d_ij matrix in the shape (x, batches) where x comes from the triu computation
start_batch – Atom index within a single configuration from to start the computation based on the current minibatch that is being computed.
- Returns:
rdf – Dict of rdf values for each combination of species, e.g.: {‘H-O’: tf.Tensor(…), ‘H-H’: …, ‘O-O’: …}
- Return type:
- static get_dij(indices, positions_tensor, atoms, box_array)[source]¶
Compute the distance matrix for the minibatch.
- Parameters:
indices (tf.Tensor) –
positions_tensor (tf.Tensor) –
atoms (tf.Tensor) –
box_array (tf.Tensor) –
- property ideal_correction: float¶
Get the correct ideal gas term.
In the case of a cutoff value greater than half of the box size, the ideal gas term of the experiment must be corrected due to the lack of spherical symmetry in the experiment.
- Returns:
correction – Correct ideal gas term for the RDF prefactor
- Return type:
- property particles_list¶
List of number of atoms of each species being studied.
- Return type:
——-.
- prepare_computation()[source]¶
Run the steps necessary to prepare for the RDF computation.
- Returns:
dict_keys (list) – dict keys to use when selecting data from the output.
split_arr (np.ndarray) – Array of indices to load from the database split into sub-arrays which fulfill the necessary batch size.
batch_tqdm (bool) – If true, the main tqdm loop over batches is disabled and only the mini-batch loop will be displayed.