mdsuite.calculators.trajectory_calculator module

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

A parent class for calculators that operate on the trajectory.

class mdsuite.calculators.trajectory_calculator.TrajectoryCalculator(experiment: Experiment = None, experiments: List = None)[source]

Bases: Calculator, ABC

Parent class for calculators operating on the trajectory.

data_resolution

Resolution of the data to be plotted. This is necessary because if someone wants a data_range of 500 they may not want

Type:

int

loaded_property

The property being loaded from the simulation database.

Type:

tuple

dependency

A dependency required for the analysis to run.

Type:

tuple

scale_function

The scaling behaviour of the computer. e.g. {“linear”: {“scale_factor”: 150}}. See mdsuite.utils.scale_functions.py for the list of possible functions.

Type:

dict

batch_size

Batch size to use. This is the number of configurations that can be loaded given the complexity and data requirements of the operation.

Type:

int

n_batches

Number of batches that can be looped over given the batch size.

Type:

int

remainder

The remainder of configurations after the batch process.

Type:

int

minibatch

If true, atom-wise mini-batching will be used.

Type:

bool

memory_manager

Memory manager object to handle computation of batch sizes.

Type:

MemoryManager

data_manager

Data manager parent to handle preparation of data generators.

Type:

DataManager

_database

Simulation database from which data should be loaded.

Type:

Database

property database

Get the database based on the experiment database path.

get_batch_dataset(subject_list: Optional[list] = None, loop_array: Optional[ndarray] = None, correct: bool = False) DatasetV2[source]

Collect the batch loop dataset.

Parameters:
  • correct (bool) – If true, a calculator specific method is called to correct some of the batching properties. For example, the RDF code will over-ride the data range in favour of number of configurations as it does not require dynamic properties.

  • subject_list (list (default = None)) –

    A str of subjects to collect data for in case this is necessary. e.g. subject = [‘Na’]

    subject = [‘Na’, ‘Cl’, ‘K’] subject = [‘Ionic_Current’]

  • loop_array (np.ndarray (default = None)) –

    If this is not None, elements of this array will be looped over in in the batches which load data at their indices. For example,

    loop_array = [[1, 4, 7], [10, 13, 16], [19, 21, 24]]

    In this case, in the fist batch, configurations 1, 4, and 7 will be loaded for the analysis. This is particularly important in the structural properties.

Returns:

dataset – A TensorFlow dataset for the batch loop to be iterated over.

Return type:

tf.data.Dataset

get_ensemble_dataset(batch: dict, subject: Union[str, list])[source]

Collect the ensemble loop dataset.

Parameters:
  • subject (str) – What object to loop over.

  • batch (tf.Tensor) – A batch of data to be looped over in ensembles.

Returns:

dataset – A TensorFlow dataset object for the ensemble loop to be iterated over.

Return type:

tf.data.Dataset