mdsuite.calculators package¶
Submodules¶
- mdsuite.calculators.angular_distribution_function module
- License
- Contact Information
- Citation
- Summary
AngularDistributionFunctionAngularDistributionFunction.batch_sizeAngularDistributionFunction.n_minibatchesAngularDistributionFunction.n_confsAngularDistributionFunction.r_cutAngularDistributionFunction.startAngularDistributionFunction.stopAngularDistributionFunction.binsAngularDistributionFunction.use_tf_functionAngularDistributionFunction.check_input()AngularDistributionFunction.plot_data()AngularDistributionFunction.prepare_computation()AngularDistributionFunction.run_calculator()
Args
- mdsuite.calculators.calculator module
- License
- Contact Information
- Citation
- Summary
CalculatorCalculator.experimentCalculator.experimentsCalculator.plotCalculator.system_propertyCalculator.experimentalCalculator.selected_speciesCalculator.analysis_nameCalculator.timeCalculator.plotterCalculator.result_keysCalculator.result_series_keysCalculator.prefactorCalculator.x_labelCalculator.y_labelCalculator._dtypeCalculator.plot_arrayCalculator.dtypeCalculator.plot_data()Calculator.run_analysis()Calculator.run_calculator()Calculator.run_visualization()
call()
- mdsuite.calculators.coordination_number_calculation module
- License
- Contact Information
- Citation
- Summary
ArgsCoordinationNumbersCoordinationNumbers.experimentCoordinationNumbers.data_rangeCoordinationNumbers.x_labelCoordinationNumbers.y_labelCoordinationNumbers.analysis_nameCoordinationNumbers.file_to_studyCoordinationNumbers.integral_dataCoordinationNumbers.species_tupleCoordinationNumbers.indicesCoordinationNumbers.rdf_dataCoordinationNumbers.db_computationCoordinationNumbers.experimentCoordinationNumbers.experimentsCoordinationNumbers.plot_data()CoordinationNumbers.rdf_dataCoordinationNumbers.run_calculator()
- mdsuite.calculators.einstein_diffusion_coefficients module
- mdsuite.calculators.einstein_distinct_diffusion_coefficients module
- License
- Contact Information
- Citation
- Summary
ArgsEinsteinDistinctDiffusionCoefficientsEinsteinDistinctDiffusionCoefficients.experimentEinsteinDistinctDiffusionCoefficients.speciesEinsteinDistinctDiffusionCoefficients.x_labelEinsteinDistinctDiffusionCoefficients.y_labelEinsteinDistinctDiffusionCoefficients.analysis_nameEinsteinDistinctDiffusionCoefficients.loaded_propertyEinsteinDistinctDiffusionCoefficients.check_input()EinsteinDistinctDiffusionCoefficients.run_calculator()
- mdsuite.calculators.einstein_helfand_ionic_conductivity module
- mdsuite.calculators.einstein_helfand_thermal_conductivity module
- License
- Contact Information
- Citation
- Summary
ArgsEinsteinHelfandThermalConductivityEinsteinHelfandThermalConductivity.experimentEinsteinHelfandThermalConductivity.x_labelEinsteinHelfandThermalConductivity.y_labelEinsteinHelfandThermalConductivity.analysis_nameEinsteinHelfandThermalConductivity.loaded_propertyEinsteinHelfandThermalConductivity.check_input()EinsteinHelfandThermalConductivity.ensemble_operation()EinsteinHelfandThermalConductivity.run_calculator()
- mdsuite.calculators.einstein_helfand_thermal_kinaci module
- License
- Contact Information
- Citation
- Summary
ArgsEinsteinHelfandThermalKinaciEinsteinHelfandThermalKinaci.experimentEinsteinHelfandThermalKinaci.x_labelEinsteinHelfandThermalKinaci.y_labelEinsteinHelfandThermalKinaci.analysis_nameEinsteinHelfandThermalKinaci.loaded_propertyEinsteinHelfandThermalKinaci.check_input()EinsteinHelfandThermalKinaci.ensemble_operation()EinsteinHelfandThermalKinaci.run_calculator()
- mdsuite.calculators.green_kubo_distinct_diffusion_coefficients module
- License
- Contact Information
- Citation
- Summary
ArgsGreenKuboDistinctDiffusionCoefficientsGreenKuboDistinctDiffusionCoefficients.x_labelGreenKuboDistinctDiffusionCoefficients.y_labelGreenKuboDistinctDiffusionCoefficients.analysis_nameGreenKuboDistinctDiffusionCoefficients.loaded_propertyGreenKuboDistinctDiffusionCoefficients.check_input()GreenKuboDistinctDiffusionCoefficients.ensemble_operation()GreenKuboDistinctDiffusionCoefficients.plot_data()GreenKuboDistinctDiffusionCoefficients.run_calculator()
- mdsuite.calculators.green_kubo_ionic_conductivity module
- License
- Contact Information
- Citation
- Summary
ArgsGreenKuboIonicConductivityGreenKuboIonicConductivity.experimentGreenKuboIonicConductivity.x_labelGreenKuboIonicConductivity.y_labelGreenKuboIonicConductivity.analysis_nameGreenKuboIonicConductivity.loaded_propertyGreenKuboIonicConductivity.check_input()GreenKuboIonicConductivity.ensemble_operation()GreenKuboIonicConductivity.plot_data()GreenKuboIonicConductivity.run_calculator()
- mdsuite.calculators.green_kubo_self_diffusion_coefficients module
- License
- Contact Information
- Citation
- Summary
ArgsGreenKuboDiffusionCoefficientsGreenKuboDiffusionCoefficients.speciesGreenKuboDiffusionCoefficients.x_labelGreenKuboDiffusionCoefficients.y_labelGreenKuboDiffusionCoefficients.analysis_nameGreenKuboDiffusionCoefficients.loaded_propertyGreenKuboDiffusionCoefficients.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
ArgsKirkwoodBuffIntegralKirkwoodBuffIntegral.experimentKirkwoodBuffIntegral.data_rangeKirkwoodBuffIntegral.x_labelKirkwoodBuffIntegral.y_labelKirkwoodBuffIntegral.analysis_nameKirkwoodBuffIntegral.file_to_studyKirkwoodBuffIntegral.data_filesKirkwoodBuffIntegral.species_tupleKirkwoodBuffIntegral.plot_data()KirkwoodBuffIntegral.run_calculator()
- mdsuite.calculators.nernst_einstein_ionic_conductivity module
- mdsuite.calculators.potential_of_mean_force module
- License
- Contact Information
- Citation
- Summary
ArgsPotentialOfMeanForcePotentialOfMeanForce.experimentPotentialOfMeanForce.data_rangePotentialOfMeanForce.x_labelPotentialOfMeanForce.y_labelPotentialOfMeanForce.analysis_namePotentialOfMeanForce.file_to_studyPotentialOfMeanForce.data_filesPotentialOfMeanForce.selected_speciesPotentialOfMeanForce.get_pomf_peaks()PotentialOfMeanForce.plot_data()PotentialOfMeanForce.run_calculator()
- mdsuite.calculators.radial_distribution_function module
- License
- Contact Information
- Citation
- Summary
ArgsRadialDistributionFunctionRadialDistributionFunction.experimentRadialDistributionFunction.data_rangeRadialDistributionFunction.x_labelRadialDistributionFunction.y_labelRadialDistributionFunction.analysis_nameRadialDistributionFunction.loaded_propertyRadialDistributionFunction.minibatchRadialDistributionFunction.bin_minibatch()RadialDistributionFunction.check_input()RadialDistributionFunction.combine_dictionaries()RadialDistributionFunction.compute_species_values()RadialDistributionFunction.get_dij()RadialDistributionFunction.ideal_correctionRadialDistributionFunction.particles_listRadialDistributionFunction.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
TrajectoryCalculatorTrajectoryCalculator.data_resolutionTrajectoryCalculator.loaded_propertyTrajectoryCalculator.dependencyTrajectoryCalculator.scale_functionTrajectoryCalculator.batch_sizeTrajectoryCalculator.n_batchesTrajectoryCalculator.remainderTrajectoryCalculator.minibatchTrajectoryCalculator.memory_managerTrajectoryCalculator.data_managerTrajectoryCalculator._databaseTrajectoryCalculator.databaseTrajectoryCalculator.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,ABCCompute 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:
CalculatorDatabaseParent 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:
CalculatorClass 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,ABCClass 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:
TrajectoryCalculatorClass 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,ABCClass 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,ABCClass 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,ABCClass 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,ABCClass 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,ABCClass 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,ABCClass 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,ABCClass 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,ABCClass 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,ABCClass 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:
CalculatorClass 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:
CalculatorClass for the calculation of the Nernst-Einstein ionic conductivity.
Examples
experiment.run_computation.NernstEinsteinIonicConductivity()
- class mdsuite.calculators.PotentialOfMeanForce(**kwargs)[source]¶
Bases:
CalculatorClass 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,ABCClass 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.