sponge.metrics.Metric
- class sponge.metrics.Metric[source]
Metric is fundamental tool used to assess the state and performance of a simulation system. Which provides a mechanism to track the changes in various physical quantities within the simulation system. The base class of Metrics defines a set of methods that are used to update the state information of the simulation system and to calculate the corresponding metrics.
- update(coordinate: Tensor, pbc_box: Tensor = None, energy: Tensor = None, force: Tensor = None, potentials: Tensor = None, total_bias: Tensor = None, biases: Tensor = None)[source]
update the state information of the simulation system.
- Parameters
coordinate (Tensor) – Tensor of shape (B, A, D). Data type is float. Position coordinate of atoms in system.
pbc_box (Tensor, optional) – Tensor of shape (B, D). Data type is float. Tensor of PBC box. Default:
None
.energy (Tensor, optional) – Tensor of shape (B, 1). Data type is float. Total energy of the simulation system. Default:
None
.force (Tensor, optional) – Tensor of shape (B, A, D). Data type is float. Force on each atoms of the simulation system. Default:
None
.potentials (Tensor, optional) – Tensor of shape (B, U). Data type is float. All potential energies. Default:
None
.total_bias (Tensor, optional) – Tensor of shape (B, 1). Data type is float. Total bias energy for reweighting. Default:
None
.biases (Tensor, optional) – Tensor of shape (B, V). Data type is float All bias potential energies. Default:
None
.
Note
B: Batchsize, i.e. number of walkers in simulation.
A: Number of atoms of the simulation system.
D: Dimension of the space of the simulation system. Usually is 3.
U: Number of potential energies.
V: Number of bias potential energies.
- Supported Platforms:
Ascend
GPU
Examples
>>> import numpy as np >>> from mindspore import Tensor >>> from sponge.metrics import Metric >>> net = Metric()