sponge.function.get_energy

View Source On Gitee
sponge.function.get_energy(energy: Union[Energy, float], unit: Union[str, Units] = None)[source]

Get the tensor of energy in specific unit

Parameters
  • energy (Union[Energy, float]) – Energy value.

  • unit (Union[str, Units], optional) – Energy unit. Default: None.

Returns

Float, a tensor of energy in specific unit.

Examples

>>> from sponge.function import get_energy
>>> get_energy(ene)
4.184
>>> get_energy(ene, 'kcal/mol')
1.0