deepmd/npy/mixed format

Class: DeePMDMixedFormat

Mixed type numpy format for DeePMD-kit. Under this format, systems with the same number of atoms but different formula can be put together for a larger system, especially when the frame numbers in systems are sparse. This also helps to mixture the type information together for model training with type embedding network.

Examples

Dump a MultiSystems into a mixed type numpy directory:

>>> import dpdata
>>> dpdata.MultiSystems(*systems).to_deepmd_npy_mixed("mixed_dir")

Load a mixed type data into a MultiSystems:

>>> import dpdata
>>> dpdata.MultiSystems().load_systems_from_file("mixed_dir", fmt="deepmd/npy/mixed")

Conversions

Convert from System to this format

dpdata.System.to(fmt: Literal['deepmd/npy/mixed'], file_name, set_size: 'int' = 2000, prec=<class 'numpy.float64'>)
dpdata.System.to_deepmd_npy_mixed(file_name, set_size: 'int' = 2000, prec=<class 'numpy.float64'>)

Dump the system in deepmd mixed type format (numpy binary) to folder.

The frames were already split to different systems, so these frames can be dumped to one single subfolders

named as folder/set.000, containing less than set_size frames.

Parameters:
file_namestr

The output folder

set_sizeint, default=2000

set size

prec{numpy.float32, numpy.float64}

The floating point precision of the compressed data

Convert from LabeledSystem to this format

dpdata.LabeledSystem.to(fmt: Literal['deepmd/npy/mixed'], file_name, set_size: 'int' = 2000, prec=<class 'numpy.float64'>)
dpdata.LabeledSystem.to_deepmd_npy_mixed(file_name, set_size: 'int' = 2000, prec=<class 'numpy.float64'>)

Dump the system in deepmd mixed type format (numpy binary) to folder.

The frames were already split to different systems, so these frames can be dumped to one single subfolders

named as folder/set.000, containing less than set_size frames.

Parameters:
file_namestr

The output folder

set_sizeint, default=2000

set size

prec{numpy.float32, numpy.float64}

The floating point precision of the compressed data

Convert from this format to MultiSystems

dpdata.MultiSystems.from_deepmd_npy_mixed(directory) dpdata.system.MultiSystems

Convert this format to MultiSystems.

Parameters:
directorystr

directory of systems

Returns:
MultiSystems

converted system

Convert from MultiSystems to this format

dpdata.MultiSystems.to(fmt: Literal['deepmd/npy/mixed'], directory) dpdata.system.MultiSystems
dpdata.MultiSystems.to_deepmd_npy_mixed(directory) dpdata.system.MultiSystems

Convert MultiSystems to this format.

Parameters:
directorystr

directory to save systems

Returns:
MultiSystems

this system