Welcome to dpdata’s documentation!

Try dpdata online

Command line interface

dpdata: Manipulating multiple atomic simulation data formats

usage: dpdata [-h] [--to_file TO_FILE] [--from_format FROM_FORMAT]
              [--to_format TO_FORMAT] [--no-labeled] [--multi]
              [--type-map TYPE_MAP [TYPE_MAP ...]] [--version]
              from_file

Positional Arguments

from_file

read data from a file

Named Arguments

--to_file, -O

dump data to a file

--from_format, -i

the format of from_file

Default: “auto”

--to_format, -o

the format of to_file

--no-labeled, -n

labels aren’t provided

Default: False

--multi, -m

the system contains multiple directories

Default: False

--type-map, -t

type map

--version

show program’s version number and exit

Supported Formats

dpdata supports the following formats:

Supported Formats

Format

Alias

Supported Conversions

psi4/out format

psi4/out

LabeledSystem()

psi4/inp format

psi4/inp

System.to() LabeledSystem.to()

cp2k/aimd_output format

cp2k/aimd_output

LabeledSystem()

cp2k/output format

cp2k/output

LabeledSystem()

orca/spout format

orca/spout

LabeledSystem()

stru format

stru abacus/stru

System() System.to() LabeledSystem.to()

abacus/lcao/scf format

abacus/lcao/scf abacus/pw/scf abacus/scf

LabeledSystem()

abacus/lcao/md format

abacus/lcao/md abacus/pw/md abacus/md

LabeledSystem()

abacus/lcao/relax format

abacus/lcao/relax abacus/pw/relax abacus/relax

LabeledSystem()

vasp/contcar format

vasp/contcar vasp/poscar contcar poscar

System() System.to() LabeledSystem.to()

vasp/string format

vasp/string

System.to() LabeledSystem.to()

vasp/outcar format

vasp/outcar outcar

LabeledSystem()

vasp/xml format

vasp/xml xml

LabeledSystem()

deepmd/raw format

deepmd/raw deepmd

System() System.to() LabeledSystem.to() LabeledSystem() MultiSystems.load_systems_from_file() MultiSystems.to()

deepmd/comp format

deepmd/comp deepmd/npy

System() System.to() LabeledSystem.to() LabeledSystem() MultiSystems.load_systems_from_file() MultiSystems.to()

deepmd/npy/mixed format

deepmd/npy/mixed

System.to() LabeledSystem.to() MultiSystems.load_systems_from_file() MultiSystems.to()

deepmd/hdf5 format

deepmd/hdf5

System() System.to() LabeledSystem.to() LabeledSystem() MultiSystems.load_systems_from_file() MultiSystems.to()

siesta/output format

siesta/output

System() LabeledSystem()

siesta/aimd_output format

siesta/aimd_output

System() LabeledSystem()

pymatgen/structure format

pymatgen/structure

System() System.to() LabeledSystem.to()

pymatgen/molecule format

pymatgen/molecule

System() System.to() LabeledSystem.to()

pymatgen/computedstructureentry format

pymatgen/computedstructureentry

LabeledSystem.to()

list format

list

System.to() LabeledSystem.to()

mol_file format

mol_file mol

BondOrderSystem() BondOrderSystem.to()

sdf_file format

sdf_file sdf

BondOrderSystem() BondOrderSystem.to()

lammps/lmp format

lammps/lmp lmp

System() System.to() LabeledSystem.to()

lammps/dump format

lammps/dump dump

System()

pwmat/output format

pwmat/output pwmat/mlmd pwmat/movement mlmd movement

LabeledSystem()

pwmat/final.config format

pwmat/final.config pwmat/atom.config final.config atom.config

System() System.to() LabeledSystem.to()

ase/structure format

ase/structure

System() System.to() LabeledSystem.to() LabeledSystem() MultiSystems.load_systems_from_file()

ase/traj format

ase/traj

System() LabeledSystem()

gaussian/log format

gaussian/log

LabeledSystem()

gaussian/md format

gaussian/md

LabeledSystem()

gaussian/gjf format

gaussian/gjf

System() System.to() LabeledSystem.to()

fhi_aims/output format

fhi_aims/output fhi_aims/md

LabeledSystem()

fhi_aims/scf format

fhi_aims/scf

LabeledSystem()

qe/cp/traj format

qe/cp/traj

System() LabeledSystem()

qe/pw/scf format

qe/pw/scf

LabeledSystem()

3dmol format

3dmol

System.to() LabeledSystem.to()

xyz format

xyz

System() System.to() LabeledSystem.to()

quip/gap/xyz_file format

quip/gap/xyz_file quip/gap/xyz

LabeledSystem() MultiSystems.load_systems_from_file()

gromacs/gro format

gromacs/gro gro

System() System.to() LabeledSystem.to()

n2p2 format

n2p2

LabeledSystem() LabeledSystem.to()

dftbplus format

dftbplus

LabeledSystem()

amber/md format

amber/md

System() LabeledSystem()

sqm/out format

sqm/out

System() LabeledSystem()

sqm/in format

sqm/in

System.to() LabeledSystem.to()

openmx/md format

openmx/md

System() LabeledSystem()

ase/structure format

Class: ASEStructureFormat

Format for the Atomic Simulation Environment (ase).

ASE supports parsing a few dozen of data formats. As described in i the documentation, many of these formats can be determined automatically. Use the ase_fmt keyword argument to supply the format if automatic detection fails.

Conversions

Convert from this format to System
dpdata.System(atoms: 'ase.Atoms', fmt: Literal['ase/structure'] = None) dpdata.system.System
dpdata.System.from_ase_structure(atoms: 'ase.Atoms') dpdata.system.System

Convert ase.Atoms to a System.

Parameters:
atomsase.Atoms

an ASE Atoms, containing a structure

Returns:
System

converted system

Convert from System to this format
dpdata.System.to(fmt: Literal['ase/structure'])
dpdata.System.to_ase_structure()

Convert System to ASE Atom obj.

Convert from LabeledSystem to this format
dpdata.LabeledSystem.to(fmt: Literal['ase/structure'])
dpdata.LabeledSystem.to_ase_structure()

Convert System to ASE Atoms object.

Convert from this format to LabeledSystem
dpdata.LabeledSystem(atoms: 'ase.Atoms', fmt: Literal['ase/structure'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_ase_structure(atoms: 'ase.Atoms') dpdata.system.LabeledSystem

Convert ase.Atoms to a LabeledSystem. Energies and forces are calculated by the calculator.

Parameters:
atomsase.Atoms

an ASE Atoms, containing a structure

Returns:
LabeledSystem

converted system

Raises:
RuntimeError

ASE will raise RuntimeError if the atoms does not have a calculator

Convert from this format to MultiSystems
dpdata.MultiSystems.from_ase_structure(file_name: str, begin: int | None = None, end: int | None = None, step: int | None = None, ase_fmt: str | None = None) dpdata.system.MultiSystems

Convert a ASE supported file to ASE Atoms.

It will finally be converted to MultiSystems.

Parameters:
file_namestr

path to file

beginint, optional

begin frame index

endint, optional

end frame index

stepint, optional

frame index step

ase_fmtstr, optional

ASE format. See the ASE documentation about supported formats

Returns:
MultiSystems

converted system

ase/traj format

Class: ASETrajFormat

Format for the ASE’s trajectory format <https://wiki.fysik.dtu.dk/ase/ase/io/trajectory.html#module-ase.io.trajectory>`_ (ase).’ a `traj’ contains a sequence of frames, each of which is an `Atoms’ object.

Conversions

Convert from this format to System
dpdata.System(file_name: str, begin: int | None = 0, end: int | None = None, step: int | None = 1, fmt: Literal['ase/traj'] = None) dpdata.system.System
dpdata.System.from_ase_traj(file_name: str, begin: int | None = 0, end: int | None = None, step: int | None = 1) dpdata.system.System

Read ASE’s trajectory file to System of multiple frames.

Parameters:
file_namestr

ASE’s trajectory file

beginint, optional

begin frame index

endint, optional

end frame index

stepint, optional

frame index step

Returns:
System

converted system

Convert from this format to LabeledSystem
dpdata.LabeledSystem(file_name: str, begin: int | None = 0, end: int | None = None, step: int | None = 1, fmt: Literal['ase/traj'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_ase_traj(file_name: str, begin: int | None = 0, end: int | None = None, step: int | None = 1) dpdata.system.LabeledSystem

Read ASE’s trajectory file to System of multiple frames.

Parameters:
file_namestr

ASE’s trajectory file

beginint, optional

begin frame index

endint, optional

end frame index

stepint, optional

frame index step

Returns:
LabeledSystem

converted system

abacus/lcao/md format

abacus/pw/md format

abacus/md format

Class: AbacusMDFormat

Conversions

Convert from this format to LabeledSystem
dpdata.LabeledSystem(file_name, fmt: Literal['abacus/lcao/md'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem(file_name, fmt: Literal['abacus/pw/md'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem(file_name, fmt: Literal['abacus/md'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_abacus_lcao_md(file_name) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_abacus_pw_md(file_name) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_abacus_md(file_name) dpdata.system.LabeledSystem

Convert this format to LabeledSystem.

Returns:
LabeledSystem

converted system

abacus/lcao/relax format

abacus/pw/relax format

abacus/relax format

Class: AbacusRelaxFormat

Conversions

Convert from this format to LabeledSystem
dpdata.LabeledSystem(file_name, fmt: Literal['abacus/lcao/relax'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem(file_name, fmt: Literal['abacus/pw/relax'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem(file_name, fmt: Literal['abacus/relax'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_abacus_lcao_relax(file_name) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_abacus_pw_relax(file_name) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_abacus_relax(file_name) dpdata.system.LabeledSystem

Convert this format to LabeledSystem.

Returns:
LabeledSystem

converted system

abacus/lcao/scf format

abacus/pw/scf format

abacus/scf format

Class: AbacusSCFFormat

Conversions

Convert from this format to LabeledSystem
dpdata.LabeledSystem(file_name, fmt: Literal['abacus/lcao/scf'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem(file_name, fmt: Literal['abacus/pw/scf'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem(file_name, fmt: Literal['abacus/scf'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_abacus_lcao_scf(file_name) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_abacus_pw_scf(file_name) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_abacus_scf(file_name) dpdata.system.LabeledSystem

Convert this format to LabeledSystem.

Returns:
LabeledSystem

converted system

stru format

abacus/stru format

Class: AbacusSTRUFormat

Conversions

Convert from this format to System
dpdata.System(file_name, fmt: Literal['stru'] = None) dpdata.system.System
dpdata.System(file_name, fmt: Literal['abacus/stru'] = None) dpdata.system.System
dpdata.System.from_stru(file_name) dpdata.system.System
dpdata.System.from_abacus_stru(file_name) dpdata.system.System

Convert this format to System.

Returns:
System

converted system

Convert from System to this format
dpdata.System.to(fmt: Literal['stru'], file_name, frame_idx=0)
dpdata.System.to(fmt: Literal['stru'], file_name, frame_idx=0)
dpdata.System.to_stru(file_name, frame_idx=0)
dpdata.System.to_abacus_stru(file_name, frame_idx=0)

Dump the system into ABACUS STRU format file.

Parameters:
file_namestr

The output file name

frame_idxint

The index of the frame to dump

pp_filelist of string, optional

List of pseudo potential files

numerical_orbitallist of string, optional

List of orbital files

masslist of float, optional

List of atomic masses

numerical_descriptorstr, optional

numerical descriptor file

Convert from LabeledSystem to this format
dpdata.LabeledSystem.to(fmt: Literal['stru'], file_name, frame_idx=0)
dpdata.LabeledSystem.to(fmt: Literal['stru'], file_name, frame_idx=0)
dpdata.LabeledSystem.to_stru(file_name, frame_idx=0)
dpdata.LabeledSystem.to_abacus_stru(file_name, frame_idx=0)

Dump the system into ABACUS STRU format file.

Parameters:
file_namestr

The output file name

frame_idxint

The index of the frame to dump

pp_filelist of string, optional

List of pseudo potential files

numerical_orbitallist of string, optional

List of orbital files

masslist of float, optional

List of atomic masses

numerical_descriptorstr, optional

numerical descriptor file

amber/md format

Class: AmberMDFormat

Conversions

Convert from this format to System
dpdata.System(file_name=None, parm7_file=None, nc_file=None, use_element_symbols=None, fmt: Literal['amber/md'] = None) dpdata.system.System
dpdata.System.from_amber_md(file_name=None, parm7_file=None, nc_file=None, use_element_symbols=None) dpdata.system.System

Convert this format to System.

Returns:
System

converted system

Convert from this format to LabeledSystem
dpdata.LabeledSystem(file_name=None, parm7_file=None, nc_file=None, mdfrc_file=None, mden_file=None, mdout_file=None, use_element_symbols=None, fmt: Literal['amber/md'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_amber_md(file_name=None, parm7_file=None, nc_file=None, mdfrc_file=None, mden_file=None, mdout_file=None, use_element_symbols=None) dpdata.system.LabeledSystem

Convert this format to LabeledSystem.

Returns:
LabeledSystem

converted system

cp2k/aimd_output format

Class: CP2KAIMDOutputFormat

Conversions

Convert from this format to LabeledSystem
dpdata.LabeledSystem(file_name, restart=False, fmt: Literal['cp2k/aimd_output'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_cp2k_aimd_output(file_name, restart=False) dpdata.system.LabeledSystem

Convert this format to LabeledSystem.

Returns:
LabeledSystem

converted system

cp2k/output format

Class: CP2KOutputFormat

Conversions

Convert from this format to LabeledSystem
dpdata.LabeledSystem(file_name, restart=False, fmt: Literal['cp2k/output'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_cp2k_output(file_name, restart=False) dpdata.system.LabeledSystem

Convert this format to LabeledSystem.

Returns:
LabeledSystem

converted system

dftbplus format

Class: DFTBplusFormat

The DFTBplusFormat class handles files in the DFTB+ format.

This class provides a method to read DFTB+ files from a labeled system and returns a dictionary containing various properties of the system.For more information, please refer to the official documentation at the following URL: https://dftbplus.org/documentation

Attributes:
None

Methods

from_labeled_system(file_paths, **kwargs): Reads system information from files.

Conversions

Convert from this format to LabeledSystem
dpdata.LabeledSystem(file_paths, fmt: Literal['dftbplus'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_dftbplus(file_paths) dpdata.system.LabeledSystem

Reads system information from the given DFTB+ file paths.

Parameters:
file_pathstuple

A tuple containing the input and output file paths. - Input file (file_in): Contains information about symbols and coord. - Output file (file_out): Contains information about energy and force.

Returns:
LabeledSystem

converted system

deepmd/comp format

deepmd/npy format

Class: DeePMDCompFormat

Conversions

Convert from this format to System
dpdata.System(file_name, type_map=None, fmt: Literal['deepmd/comp'] = None) dpdata.system.System
dpdata.System(file_name, type_map=None, fmt: Literal['deepmd/npy'] = None) dpdata.system.System
dpdata.System.from_deepmd_comp(file_name, type_map=None) dpdata.system.System
dpdata.System.from_deepmd_npy(file_name, type_map=None) dpdata.system.System

Convert this format to System.

Returns:
System

converted system

Convert from System to this format
dpdata.System.to(fmt: Literal['deepmd/comp'], file_name, set_size=5000, prec=<class 'numpy.float64'>)
dpdata.System.to(fmt: Literal['deepmd/comp'], file_name, set_size=5000, prec=<class 'numpy.float64'>)
dpdata.System.to_deepmd_comp(file_name, set_size=5000, prec=<class 'numpy.float64'>)
dpdata.System.to_deepmd_npy(file_name, set_size=5000, prec=<class 'numpy.float64'>)

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

The frames are firstly split to sets, then dumped to seperated subfolders named as folder/set.000, folder/set.001, ….

Each set contains set_size frames. The last set may have less frames than set_size.

Parameters:
file_namestr

The output folder

set_sizeint

The size of each set.

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/comp'], file_name, set_size=5000, prec=<class 'numpy.float64'>)
dpdata.LabeledSystem.to(fmt: Literal['deepmd/comp'], file_name, set_size=5000, prec=<class 'numpy.float64'>)
dpdata.LabeledSystem.to_deepmd_comp(file_name, set_size=5000, prec=<class 'numpy.float64'>)
dpdata.LabeledSystem.to_deepmd_npy(file_name, set_size=5000, prec=<class 'numpy.float64'>)

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

The frames are firstly split to sets, then dumped to seperated subfolders named as folder/set.000, folder/set.001, ….

Each set contains set_size frames. The last set may have less frames than set_size.

Parameters:
file_namestr

The output folder

set_sizeint

The size of each set.

prec{numpy.float32, numpy.float64}

The floating point precision of the compressed data

Convert from this format to LabeledSystem
dpdata.LabeledSystem(file_name, type_map=None, fmt: Literal['deepmd/comp'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem(file_name, type_map=None, fmt: Literal['deepmd/npy'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_deepmd_comp(file_name, type_map=None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_deepmd_npy(file_name, type_map=None) dpdata.system.LabeledSystem

Convert this format to LabeledSystem.

Returns:
LabeledSystem

converted system

Convert from this format to MultiSystems
dpdata.MultiSystems.from_deepmd_comp(directory) dpdata.system.MultiSystems
dpdata.MultiSystems.from_deepmd_npy(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/comp'], directory) dpdata.system.MultiSystems
dpdata.MultiSystems.to(fmt: Literal['deepmd/comp'], directory) dpdata.system.MultiSystems
dpdata.MultiSystems.to_deepmd_comp(directory) dpdata.system.MultiSystems
dpdata.MultiSystems.to_deepmd_npy(directory) dpdata.system.MultiSystems

Convert MultiSystems to this format.

Parameters:
directorystr

directory to save systems

Returns:
MultiSystems

this system

deepmd/hdf5 format

Class: DeePMDHDF5Format

HDF5 format for DeePMD-kit.

Examples

Dump a MultiSystems to a HDF5 file:

>>> import dpdata
>>> dpdata.MultiSystems().from_deepmd_npy("data").to_deepmd_hdf5("data.hdf5")

Conversions

Convert from this format to System
dpdata.System(file_name: 'str | (h5py.Group | h5py.File)', type_map: 'list[str] | None' = None, fmt: Literal['deepmd/hdf5'] = None) dpdata.system.System
dpdata.System.from_deepmd_hdf5(file_name: 'str | (h5py.Group | h5py.File)', type_map: 'list[str] | None' = None) dpdata.system.System

Convert HDF5 file to System data.

Parameters:
file_namestr or h5py.Group or h5py.File

file name of the HDF5 file or HDF5 object. If it is a string, hashtag is used to split path to the HDF5 file and the HDF5 group

type_mapdict[str]

type map

Returns:
System

converted system

Raises:
TypeError

file_name is not str or h5py.Group or h5py.File

Convert from System to this format
dpdata.System.to(fmt: Literal['deepmd/hdf5'], file_name: 'str | (h5py.Group | h5py.File)', set_size: 'int' = 5000, comp_prec: 'np.dtype' = <class 'numpy.float64'>)
dpdata.System.to_deepmd_hdf5(file_name: 'str | (h5py.Group | h5py.File)', set_size: 'int' = 5000, comp_prec: 'np.dtype' = <class 'numpy.float64'>)

Convert System data to HDF5 file.

Parameters:
file_namestr or h5py.Group or h5py.File

file name of the HDF5 file or HDF5 object. If it is a string, hashtag is used to split path to the HDF5 file and the HDF5 group

set_sizeint, default=5000

set size

comp_precnp.dtype

data precision

Convert from LabeledSystem to this format
dpdata.LabeledSystem.to(fmt: Literal['deepmd/hdf5'], file_name: 'str | (h5py.Group | h5py.File)', set_size: 'int' = 5000, comp_prec: 'np.dtype' = <class 'numpy.float64'>)
dpdata.LabeledSystem.to_deepmd_hdf5(file_name: 'str | (h5py.Group | h5py.File)', set_size: 'int' = 5000, comp_prec: 'np.dtype' = <class 'numpy.float64'>)

Convert System data to HDF5 file.

Parameters:
file_namestr or h5py.Group or h5py.File

file name of the HDF5 file or HDF5 object. If it is a string, hashtag is used to split path to the HDF5 file and the HDF5 group

set_sizeint, default=5000

set size

comp_precnp.dtype

data precision

Convert from this format to LabeledSystem
dpdata.LabeledSystem(file_name: 'str | (h5py.Group | h5py.File)', type_map: 'list[str] | None' = None, fmt: Literal['deepmd/hdf5'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_deepmd_hdf5(file_name: 'str | (h5py.Group | h5py.File)', type_map: 'list[str] | None' = None) dpdata.system.LabeledSystem

Convert HDF5 file to LabeledSystem data.

Parameters:
file_namestr or h5py.Group or h5py.File

file name of the HDF5 file or HDF5 object. If it is a string, hashtag is used to split path to the HDF5 file and the HDF5 group

type_mapdict[str]

type map

Returns:
LabeledSystem

converted system

Raises:
TypeError

file_name is not str or h5py.Group or h5py.File

Convert from this format to MultiSystems
dpdata.MultiSystems.from_deepmd_hdf5(directory: 'str') dpdata.system.MultiSystems

Generate HDF5 groups from a HDF5 file, which will be passed to from_system.

Parameters:
directorystr

HDF5 file name

Returns:
MultiSystems

converted system

Convert from MultiSystems to this format
dpdata.MultiSystems.to(fmt: Literal['deepmd/hdf5'], directory: 'str') dpdata.system.MultiSystems
dpdata.MultiSystems.to_deepmd_hdf5(directory: 'str') dpdata.system.MultiSystems

Generate HDF5 groups, which will be passed to to_system.

Parameters:
directorystr

HDF5 file name

Returns:
MultiSystems

this system

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

deepmd/raw format

deepmd format

Class: DeePMDRawFormat

Conversions

Convert from this format to System
dpdata.System(file_name, type_map=None, fmt: Literal['deepmd/raw'] = None) dpdata.system.System
dpdata.System(file_name, type_map=None, fmt: Literal['deepmd'] = None) dpdata.system.System
dpdata.System.from_deepmd_raw(file_name, type_map=None) dpdata.system.System
dpdata.System.from_deepmd(file_name, type_map=None) dpdata.system.System

Convert this format to System.

Returns:
System

converted system

Convert from System to this format
dpdata.System.to(fmt: Literal['deepmd/raw'], file_name)
dpdata.System.to(fmt: Literal['deepmd/raw'], file_name)
dpdata.System.to_deepmd_raw(file_name)
dpdata.System.to_deepmd(file_name)

Dump the system in deepmd raw format to directory file_name.

Convert from LabeledSystem to this format
dpdata.LabeledSystem.to(fmt: Literal['deepmd/raw'], file_name)
dpdata.LabeledSystem.to(fmt: Literal['deepmd/raw'], file_name)
dpdata.LabeledSystem.to_deepmd_raw(file_name)
dpdata.LabeledSystem.to_deepmd(file_name)

Dump the system in deepmd raw format to directory file_name.

Convert from this format to LabeledSystem
dpdata.LabeledSystem(file_name, type_map=None, fmt: Literal['deepmd/raw'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem(file_name, type_map=None, fmt: Literal['deepmd'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_deepmd_raw(file_name, type_map=None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_deepmd(file_name, type_map=None) dpdata.system.LabeledSystem

Convert this format to LabeledSystem.

Returns:
LabeledSystem

converted system

Convert from this format to MultiSystems
dpdata.MultiSystems.from_deepmd_raw(directory) dpdata.system.MultiSystems
dpdata.MultiSystems.from_deepmd(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/raw'], directory) dpdata.system.MultiSystems
dpdata.MultiSystems.to(fmt: Literal['deepmd/raw'], directory) dpdata.system.MultiSystems
dpdata.MultiSystems.to_deepmd_raw(directory) dpdata.system.MultiSystems
dpdata.MultiSystems.to_deepmd(directory) dpdata.system.MultiSystems

Convert MultiSystems to this format.

Parameters:
directorystr

directory to save systems

Returns:
MultiSystems

this system

fhi_aims/output format

fhi_aims/md format

Class: FhiMDFormat

Conversions

Convert from this format to LabeledSystem
dpdata.LabeledSystem(file_name, md=True, begin=0, step=1, convergence_check=True, fmt: Literal['fhi_aims/output'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem(file_name, md=True, begin=0, step=1, convergence_check=True, fmt: Literal['fhi_aims/md'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_fhi_aims_output(file_name, md=True, begin=0, step=1, convergence_check=True) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_fhi_aims_md(file_name, md=True, begin=0, step=1, convergence_check=True) dpdata.system.LabeledSystem

Convert this format to LabeledSystem.

Returns:
LabeledSystem

converted system

fhi_aims/scf format

Class: FhiSCFFormat

Conversions

Convert from this format to LabeledSystem
dpdata.LabeledSystem(file_name, fmt: Literal['fhi_aims/scf'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_fhi_aims_scf(file_name) dpdata.system.LabeledSystem

Convert this format to LabeledSystem.

Returns:
LabeledSystem

converted system

gaussian/gjf format

Class: GaussiaGJFFormat

Gaussian input file.

Conversions

Convert from this format to System
dpdata.System(file_name: str, fmt: Literal['gaussian/gjf'] = None) dpdata.system.System
dpdata.System.from_gaussian_gjf(file_name: str) dpdata.system.System

Read Gaussian input file.

Parameters:
file_namestr

file name

Returns:
System

converted system

Convert from System to this format
dpdata.System.to(fmt: Literal['gaussian/gjf'], file_name: str)
dpdata.System.to_gaussian_gjf(file_name: str)

Generate Gaussian input file.

Parameters:
file_namestr

file name

Convert from LabeledSystem to this format
dpdata.LabeledSystem.to(fmt: Literal['gaussian/gjf'], file_name: str)
dpdata.LabeledSystem.to_gaussian_gjf(file_name: str)

Generate Gaussian input file.

Parameters:
file_namestr

file name

gaussian/log format

Class: GaussianLogFormat

Conversions

Convert from this format to LabeledSystem
dpdata.LabeledSystem(file_name, md=False, fmt: Literal['gaussian/log'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_gaussian_log(file_name, md=False) dpdata.system.LabeledSystem

Convert this format to LabeledSystem.

Returns:
LabeledSystem

converted system

gaussian/md format

Class: GaussianMDFormat

Conversions

Convert from this format to LabeledSystem
dpdata.LabeledSystem(file_name, fmt: Literal['gaussian/md'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_gaussian_md(file_name) dpdata.system.LabeledSystem

Convert this format to LabeledSystem.

Returns:
LabeledSystem

converted system

gromacs/gro format

gro format

Class: GromacsGroFormat

Conversions

Convert from this format to System
dpdata.System(file_name, format_atom_name=True, fmt: Literal['gromacs/gro'] = None) dpdata.system.System
dpdata.System(file_name, format_atom_name=True, fmt: Literal['gro'] = None) dpdata.system.System
dpdata.System.from_gromacs_gro(file_name, format_atom_name=True) dpdata.system.System
dpdata.System.from_gro(file_name, format_atom_name=True) dpdata.system.System

Load gromacs .gro file.

Parameters:
file_namestr

The input file name

format_atom_namebool

Whether to format the atom name

Returns:
System

converted system

Convert from System to this format
dpdata.System.to(fmt: Literal['gromacs/gro'], file_name=None, frame_idx=-1)
dpdata.System.to(fmt: Literal['gromacs/gro'], file_name=None, frame_idx=-1)
dpdata.System.to_gromacs_gro(file_name=None, frame_idx=-1)
dpdata.System.to_gro(file_name=None, frame_idx=-1)

Dump the system in gromacs .gro format.

Parameters:
file_namestr or None

The output file name. If None, return the file content as a string

frame_idxint

The index of the frame to dump

Convert from LabeledSystem to this format
dpdata.LabeledSystem.to(fmt: Literal['gromacs/gro'], file_name=None, frame_idx=-1)
dpdata.LabeledSystem.to(fmt: Literal['gromacs/gro'], file_name=None, frame_idx=-1)
dpdata.LabeledSystem.to_gromacs_gro(file_name=None, frame_idx=-1)
dpdata.LabeledSystem.to_gro(file_name=None, frame_idx=-1)

Dump the system in gromacs .gro format.

Parameters:
file_namestr or None

The output file name. If None, return the file content as a string

frame_idxint

The index of the frame to dump

lammps/dump format

dump format

Class: LAMMPSDumpFormat

Conversions

Convert from this format to System
dpdata.System(file_name, type_map=None, begin=0, step=1, unwrap=False, fmt: Literal['lammps/dump'] = None) dpdata.system.System
dpdata.System(file_name, type_map=None, begin=0, step=1, unwrap=False, fmt: Literal['dump'] = None) dpdata.system.System
dpdata.System.from_lammps_dump(file_name, type_map=None, begin=0, step=1, unwrap=False) dpdata.system.System
dpdata.System.from_dump(file_name, type_map=None, begin=0, step=1, unwrap=False) dpdata.system.System

Convert this format to System.

Returns:
System

converted system

lammps/lmp format

lmp format

Class: LAMMPSLmpFormat

Conversions

Convert from this format to System
dpdata.System(file_name, type_map=None, fmt: Literal['lammps/lmp'] = None) dpdata.system.System
dpdata.System(file_name, type_map=None, fmt: Literal['lmp'] = None) dpdata.system.System
dpdata.System.from_lammps_lmp(file_name, type_map=None) dpdata.system.System
dpdata.System.from_lmp(file_name, type_map=None) dpdata.system.System

Convert this format to System.

Returns:
System

converted system

Convert from System to this format
dpdata.System.to(fmt: Literal['lammps/lmp'], file_name, frame_idx=0)
dpdata.System.to(fmt: Literal['lammps/lmp'], file_name, frame_idx=0)
dpdata.System.to_lammps_lmp(file_name, frame_idx=0)
dpdata.System.to_lmp(file_name, frame_idx=0)

Dump the system in lammps data format.

Parameters:
file_namestr

The output file name

frame_idxint

The index of the frame to dump

Convert from LabeledSystem to this format
dpdata.LabeledSystem.to(fmt: Literal['lammps/lmp'], file_name, frame_idx=0)
dpdata.LabeledSystem.to(fmt: Literal['lammps/lmp'], file_name, frame_idx=0)
dpdata.LabeledSystem.to_lammps_lmp(file_name, frame_idx=0)
dpdata.LabeledSystem.to_lmp(file_name, frame_idx=0)

Dump the system in lammps data format.

Parameters:
file_namestr

The output file name

frame_idxint

The index of the frame to dump

list format

Class: ListFormat

Conversions

Convert from System to this format
dpdata.System.to(fmt: Literal['list'])
dpdata.System.to_list()

Convert system to list, usefull for data collection.

Convert from LabeledSystem to this format
dpdata.LabeledSystem.to(fmt: Literal['list'])
dpdata.LabeledSystem.to_list()

Convert system to list, usefull for data collection.

mol_file format

mol format

Class: MolFormat

Conversions

Convert from this format to BondOrderSystem
dpdata.BondOrderSystem(file_name, fmt: Literal['mol_file'] = None) dpdata.bond_order_system.BondOrderSystem
dpdata.BondOrderSystem(file_name, fmt: Literal['mol'] = None) dpdata.bond_order_system.BondOrderSystem
dpdata.BondOrderSystem.from_mol_file(file_name) dpdata.bond_order_system.BondOrderSystem
dpdata.BondOrderSystem.from_mol(file_name) dpdata.bond_order_system.BondOrderSystem

Convert this format to BondOrderSystem.

Returns:
BondOrderSystem

converted system

Convert from BondOrderSystem to this format
dpdata.BondOrderSystem.to(fmt: Literal['mol_file'], mol, file_name, frame_idx=0)
dpdata.BondOrderSystem.to(fmt: Literal['mol_file'], mol, file_name, frame_idx=0)
dpdata.BondOrderSystem.to_mol_file(mol, file_name, frame_idx=0)
dpdata.BondOrderSystem.to_mol(mol, file_name, frame_idx=0)

Convert BondOrderSystem to this format.

n2p2 format

Class: N2P2Format

n2p2.

This class support the conversion from and to the training data of n2p2 format. For more information about the n2p2 format, please refer to https://compphysvienna.github.io/n2p2/topics/cfg_file.html

Conversions

Convert from this format to LabeledSystem
dpdata.LabeledSystem(file_name, fmt: Literal['n2p2'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_n2p2(file_name) dpdata.system.LabeledSystem

Read from n2p2 format.

Parameters:
file_namestr

file name, i.e. the first argument

Returns:
LabeledSystem

converted system

Convert from LabeledSystem to this format
dpdata.LabeledSystem.to(fmt: Literal['n2p2'], file_name)
dpdata.LabeledSystem.to_n2p2(file_name)

Write n2p2 format.

By default, LabeledSystem.to will fallback to System.to.

Parameters:
file_namestr

file name, where the data will be written

openmx/md format

Class: OPENMXFormat

Format for the OpenMX <https://www.openmx-square.org/>.

OpenMX (Open source package for Material eXplorer) is a nano-scale material simulation package based on DFT, norm-conserving pseudopotentials, and pseudo-atomic localized basis functions.

Note that two output files, System.Name.dat and System.Name.md, are required.

Use the openmx/md keyword argument to supply this format.

Conversions

Convert from this format to System
dpdata.System(file_name: str, fmt: Literal['openmx/md'] = None) dpdata.system.System
dpdata.System.from_openmx_md(file_name: str) dpdata.system.System

Read from OpenMX output.

Parameters:
file_namestr

file name, which is specified by a input file, i.e. System.Name.dat

Returns:
System

converted system

Convert from this format to LabeledSystem
dpdata.LabeledSystem(file_name: str, fmt: Literal['openmx/md'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_openmx_md(file_name: str) dpdata.system.LabeledSystem

Read from OpenMX output.

Parameters:
file_namestr

file name, which is specified by a input file, i.e. System.Name.dat

Returns:
LabeledSystem

converted system

orca/spout format

Class: ORCASPOutFormat

ORCA single point energy output.

Note that both the energy and the gradient should be printed into the output file.

Conversions

Convert from this format to LabeledSystem
dpdata.LabeledSystem(file_name: str, fmt: Literal['orca/spout'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_orca_spout(file_name: str) dpdata.system.LabeledSystem

Read from ORCA single point energy output.

Parameters:
file_namestr

file name

Returns:
LabeledSystem

converted system

psi4/inp format

Class: PSI4InputFormat

Psi4 input file.

Conversions

Convert from System to this format
dpdata.System.to(fmt: Literal['psi4/inp'], file_name: str, method: str, basis: str, charge: int = 0, multiplicity: int = 1, frame_idx=0)
dpdata.System.to_psi4_inp(file_name: str, method: str, basis: str, charge: int = 0, multiplicity: int = 1, frame_idx=0)

Write PSI4 input.

Parameters:
file_namestr

file name

methodstr

computational method

basisstr

basis set; see https://psicode.org/psi4manual/master/basissets_tables.html

chargeint, default=0

charge of system

multiplicityint, default=1

multiplicity of system

frame_idxint, default=0

The index of the frame to dump

Convert from LabeledSystem to this format
dpdata.LabeledSystem.to(fmt: Literal['psi4/inp'], file_name: str, method: str, basis: str, charge: int = 0, multiplicity: int = 1, frame_idx=0)
dpdata.LabeledSystem.to_psi4_inp(file_name: str, method: str, basis: str, charge: int = 0, multiplicity: int = 1, frame_idx=0)

Write PSI4 input.

Parameters:
file_namestr

file name

methodstr

computational method

basisstr

basis set; see https://psicode.org/psi4manual/master/basissets_tables.html

chargeint, default=0

charge of system

multiplicityint, default=1

multiplicity of system

frame_idxint, default=0

The index of the frame to dump

psi4/out format

Class: PSI4OutFormat

Psi4 output.

Note that both the energy and the gradient should be printed into the output file.

Conversions

Convert from this format to LabeledSystem
dpdata.LabeledSystem(file_name: str, fmt: Literal['psi4/out'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_psi4_out(file_name: str) dpdata.system.LabeledSystem

Read from Psi4 output.

Parameters:
file_namestr

file name

Returns:
LabeledSystem

converted system

pwmat/final.config format

pwmat/atom.config format

final.config format

atom.config format

Class: PwmatAtomconfigFormat

Conversions

Convert from this format to System
dpdata.System(file_name, fmt: Literal['pwmat/final.config'] = None) dpdata.system.System
dpdata.System(file_name, fmt: Literal['pwmat/atom.config'] = None) dpdata.system.System
dpdata.System(file_name, fmt: Literal['final.config'] = None) dpdata.system.System
dpdata.System(file_name, fmt: Literal['atom.config'] = None) dpdata.system.System
dpdata.System.from_pwmat_finalconfig(file_name) dpdata.system.System
dpdata.System.from_pwmat_atomconfig(file_name) dpdata.system.System
dpdata.System.from_finalconfig(file_name) dpdata.system.System
dpdata.System.from_atomconfig(file_name) dpdata.system.System

Convert this format to System.

Returns:
System

converted system

Convert from System to this format
dpdata.System.to(fmt: Literal['pwmat/final.config'], file_name, frame_idx=0)
dpdata.System.to(fmt: Literal['pwmat/final.config'], file_name, frame_idx=0)
dpdata.System.to(fmt: Literal['pwmat/final.config'], file_name, frame_idx=0)
dpdata.System.to(fmt: Literal['pwmat/final.config'], file_name, frame_idx=0)
dpdata.System.to_pwmat_finalconfig(file_name, frame_idx=0)
dpdata.System.to_pwmat_atomconfig(file_name, frame_idx=0)
dpdata.System.to_finalconfig(file_name, frame_idx=0)
dpdata.System.to_atomconfig(file_name, frame_idx=0)

Dump the system in pwmat atom.config format.

Parameters:
file_namestr

The output file name

frame_idxint

The index of the frame to dump

Convert from LabeledSystem to this format
dpdata.LabeledSystem.to(fmt: Literal['pwmat/final.config'], file_name, frame_idx=0)
dpdata.LabeledSystem.to(fmt: Literal['pwmat/final.config'], file_name, frame_idx=0)
dpdata.LabeledSystem.to(fmt: Literal['pwmat/final.config'], file_name, frame_idx=0)
dpdata.LabeledSystem.to(fmt: Literal['pwmat/final.config'], file_name, frame_idx=0)
dpdata.LabeledSystem.to_pwmat_finalconfig(file_name, frame_idx=0)
dpdata.LabeledSystem.to_pwmat_atomconfig(file_name, frame_idx=0)
dpdata.LabeledSystem.to_finalconfig(file_name, frame_idx=0)
dpdata.LabeledSystem.to_atomconfig(file_name, frame_idx=0)

Dump the system in pwmat atom.config format.

Parameters:
file_namestr

The output file name

frame_idxint

The index of the frame to dump

pwmat/output format

pwmat/mlmd format

pwmat/movement format

mlmd format

movement format

Class: PwmatOutputFormat

Conversions

Convert from this format to LabeledSystem
dpdata.LabeledSystem(file_name, begin=0, step=1, convergence_check=True, fmt: Literal['pwmat/output'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem(file_name, begin=0, step=1, convergence_check=True, fmt: Literal['pwmat/mlmd'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem(file_name, begin=0, step=1, convergence_check=True, fmt: Literal['pwmat/movement'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem(file_name, begin=0, step=1, convergence_check=True, fmt: Literal['mlmd'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem(file_name, begin=0, step=1, convergence_check=True, fmt: Literal['movement'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_pwmat_output(file_name, begin=0, step=1, convergence_check=True) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_pwmat_mlmd(file_name, begin=0, step=1, convergence_check=True) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_pwmat_movement(file_name, begin=0, step=1, convergence_check=True) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_mlmd(file_name, begin=0, step=1, convergence_check=True) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_movement(file_name, begin=0, step=1, convergence_check=True) dpdata.system.LabeledSystem

Convert this format to LabeledSystem.

Returns:
LabeledSystem

converted system

3dmol format

Class: Py3DMolFormat

3DMol format.

To use this format, py3Dmol should be installed in advance.

Conversions

Convert from System to this format
dpdata.System.to(fmt: Literal['3dmol'], f_idx: int = 0, size: Tuple[int] = (300, 300), style: dict = {'stick': {}, 'sphere': {'radius': 0.4}})
dpdata.System.to_3dmol(f_idx: int = 0, size: Tuple[int] = (300, 300), style: dict = {'stick': {}, 'sphere': {'radius': 0.4}})

Show 3D structure of a frame in jupyter.

Parameters:
f_idxint

frame index to show

sizetuple[int]

(width, height) of the widget

styledict

style of 3DMol. Read 3DMol documentation for details.

Examples

>>> system.to_3dmol()
Convert from LabeledSystem to this format
dpdata.LabeledSystem.to(fmt: Literal['3dmol'], f_idx: int = 0, size: Tuple[int] = (300, 300), style: dict = {'stick': {}, 'sphere': {'radius': 0.4}})
dpdata.LabeledSystem.to_3dmol(f_idx: int = 0, size: Tuple[int] = (300, 300), style: dict = {'stick': {}, 'sphere': {'radius': 0.4}})

Show 3D structure of a frame in jupyter.

Parameters:
f_idxint

frame index to show

sizetuple[int]

(width, height) of the widget

styledict

style of 3DMol. Read 3DMol documentation for details.

Examples

>>> system.to_3dmol()

pymatgen/computedstructureentry format

Class: PyMatgenCSEFormat

Conversions

Convert from LabeledSystem to this format
dpdata.LabeledSystem.to(fmt: Literal['pymatgen/computedstructureentry'])
dpdata.LabeledSystem.to_pymatgen_computedstructureentry()

Convert System to Pymagen ComputedStructureEntry obj.

pymatgen/molecule format

Class: PyMatgenMoleculeFormat

Conversions

Convert from this format to System
dpdata.System(file_name, fmt: Literal['pymatgen/molecule'] = None) dpdata.system.System
dpdata.System.from_pymatgen_molecule(file_name) dpdata.system.System

Convert this format to System.

Returns:
System

converted system

Convert from System to this format
dpdata.System.to(fmt: Literal['pymatgen/molecule'])
dpdata.System.to_pymatgen_molecule()

Convert System to Pymatgen Molecule obj.

Convert from LabeledSystem to this format
dpdata.LabeledSystem.to(fmt: Literal['pymatgen/molecule'])
dpdata.LabeledSystem.to_pymatgen_molecule()

Convert System to Pymatgen Molecule obj.

pymatgen/structure format

Class: PyMatgenStructureFormat

Conversions

Convert from this format to System
dpdata.System(structure, fmt: Literal['pymatgen/structure'] = None) dpdata.system.System
dpdata.System.from_pymatgen_structure(structure) dpdata.system.System

Convert pymatgen.core.Structure to System.

Parameters:
structurepymatgen.core.Structure

a Pymatgen Structure, containing a structure

Returns:
System

converted system

Convert from System to this format
dpdata.System.to(fmt: Literal['pymatgen/structure'])
dpdata.System.to_pymatgen_structure()

Convert System to Pymatgen Structure obj.

Convert from LabeledSystem to this format
dpdata.LabeledSystem.to(fmt: Literal['pymatgen/structure'])
dpdata.LabeledSystem.to_pymatgen_structure()

Convert System to Pymatgen Structure obj.

qe/pw/scf format

Class: QECPPWSCFFormat

Conversions

Convert from this format to LabeledSystem
dpdata.LabeledSystem(file_name, fmt: Literal['qe/pw/scf'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_qe_pw_scf(file_name) dpdata.system.LabeledSystem

Convert this format to LabeledSystem.

Returns:
LabeledSystem

converted system

qe/cp/traj format

Class: QECPTrajFormat

Conversions

Convert from this format to System
dpdata.System(file_name, begin=0, step=1, fmt: Literal['qe/cp/traj'] = None) dpdata.system.System
dpdata.System.from_qe_cp_traj(file_name, begin=0, step=1) dpdata.system.System

Convert this format to System.

Returns:
System

converted system

Convert from this format to LabeledSystem
dpdata.LabeledSystem(file_name, begin=0, step=1, fmt: Literal['qe/cp/traj'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_qe_cp_traj(file_name, begin=0, step=1) dpdata.system.LabeledSystem

Convert this format to LabeledSystem.

Returns:
LabeledSystem

converted system

quip/gap/xyz_file format

quip/gap/xyz format

Class: QuipGapXYZFormat

Conversions

Convert from this format to LabeledSystem
dpdata.LabeledSystem(data, fmt: Literal['quip/gap/xyz_file'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem(data, fmt: Literal['quip/gap/xyz'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_quip_gap_xyz_file(data) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_quip_gap_xyz(data) dpdata.system.LabeledSystem

Convert this format to LabeledSystem.

Returns:
LabeledSystem

converted system

Convert from this format to MultiSystems
dpdata.MultiSystems.from_quip_gap_xyz_file(file_name) dpdata.system.MultiSystems
dpdata.MultiSystems.from_quip_gap_xyz(file_name) dpdata.system.MultiSystems

Convert this format to MultiSystems.

Parameters:
directorystr

directory of systems

Returns:
MultiSystems

converted system

sqm/in format

Class: SQMINFormat

Conversions

Convert from System to this format
dpdata.System.to(fmt: Literal['sqm/in'], fname=None, frame_idx=0)
dpdata.System.to_sqm_in(fname=None, frame_idx=0)

Generate input files for semi-emperical calculation in sqm software.

Parameters:
fnamestr

output file name

frame_idxint, default=0

index of frame to write

Other Parameters:
**kwargsdict
valid parameters are:
qm_theorystr, default=dftb3

level of theory. Options includes AM1, RM1, MNDO, PM3-PDDG, MNDO-PDDG, PM3-CARB1, MNDO/d, AM1/d, PM6, DFTB2, DFTB3

chargeint, default=0

total charge in electron units

maxcycint, default=0

maximum number of minimization cycles to allow. 0 represents a single-point calculation

multint, default=1

multiplicity. Only 1 is allowed.

Convert from LabeledSystem to this format
dpdata.LabeledSystem.to(fmt: Literal['sqm/in'], fname=None, frame_idx=0)
dpdata.LabeledSystem.to_sqm_in(fname=None, frame_idx=0)

Generate input files for semi-emperical calculation in sqm software.

Parameters:
fnamestr

output file name

frame_idxint, default=0

index of frame to write

Other Parameters:
**kwargsdict
valid parameters are:
qm_theorystr, default=dftb3

level of theory. Options includes AM1, RM1, MNDO, PM3-PDDG, MNDO-PDDG, PM3-CARB1, MNDO/d, AM1/d, PM6, DFTB2, DFTB3

chargeint, default=0

total charge in electron units

maxcycint, default=0

maximum number of minimization cycles to allow. 0 represents a single-point calculation

multint, default=1

multiplicity. Only 1 is allowed.

sqm/out format

Class: SQMOutFormat

Conversions

Convert from this format to System
dpdata.System(fname, fmt: Literal['sqm/out'] = None) dpdata.system.System
dpdata.System.from_sqm_out(fname) dpdata.system.System

Read from ambertools sqm.out.

Returns:
System

converted system

Convert from this format to LabeledSystem
dpdata.LabeledSystem(fname, fmt: Literal['sqm/out'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_sqm_out(fname) dpdata.system.LabeledSystem

Read from ambertools sqm.out.

Returns:
LabeledSystem

converted system

sdf_file format

sdf format

Class: SdfFormat

Conversions

Convert from this format to BondOrderSystem
dpdata.BondOrderSystem(file_name, fmt: Literal['sdf_file'] = None) dpdata.bond_order_system.BondOrderSystem
dpdata.BondOrderSystem(file_name, fmt: Literal['sdf'] = None) dpdata.bond_order_system.BondOrderSystem
dpdata.BondOrderSystem.from_sdf_file(file_name) dpdata.bond_order_system.BondOrderSystem
dpdata.BondOrderSystem.from_sdf(file_name) dpdata.bond_order_system.BondOrderSystem

Note that it requires all molecules in .sdf file must be of the same topology.

Returns:
BondOrderSystem

converted system

Convert from BondOrderSystem to this format
dpdata.BondOrderSystem.to(fmt: Literal['sdf_file'], mol, file_name, frame_idx=-1)
dpdata.BondOrderSystem.to(fmt: Literal['sdf_file'], mol, file_name, frame_idx=-1)
dpdata.BondOrderSystem.to_sdf_file(mol, file_name, frame_idx=-1)
dpdata.BondOrderSystem.to_sdf(mol, file_name, frame_idx=-1)

Convert BondOrderSystem to this format.

siesta/aimd_output format

Class: SiestaAIMDOutputFormat

Conversions

Convert from this format to System
dpdata.System(file_name, fmt: Literal['siesta/aimd_output'] = None) dpdata.system.System
dpdata.System.from_siesta_aimd_output(file_name) dpdata.system.System

Convert this format to System.

Returns:
System

converted system

Convert from this format to LabeledSystem
dpdata.LabeledSystem(file_name, fmt: Literal['siesta/aimd_output'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_siesta_aimd_output(file_name) dpdata.system.LabeledSystem

Convert this format to LabeledSystem.

Returns:
LabeledSystem

converted system

siesta/output format

Class: SiestaOutputFormat

Conversions

Convert from this format to System
dpdata.System(file_name, fmt: Literal['siesta/output'] = None) dpdata.system.System
dpdata.System.from_siesta_output(file_name) dpdata.system.System

Convert this format to System.

Returns:
System

converted system

Convert from this format to LabeledSystem
dpdata.LabeledSystem(file_name, fmt: Literal['siesta/output'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_siesta_output(file_name) dpdata.system.LabeledSystem

Convert this format to LabeledSystem.

Returns:
LabeledSystem

converted system

vasp/outcar format

outcar format

Class: VASPOutcarFormat

Conversions

Convert from this format to LabeledSystem
dpdata.LabeledSystem(file_name, begin=0, step=1, convergence_check=True, fmt: Literal['vasp/outcar'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem(file_name, begin=0, step=1, convergence_check=True, fmt: Literal['outcar'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_vasp_outcar(file_name, begin=0, step=1, convergence_check=True) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_outcar(file_name, begin=0, step=1, convergence_check=True) dpdata.system.LabeledSystem

Convert this format to LabeledSystem.

Returns:
LabeledSystem

converted system

vasp/contcar format

vasp/poscar format

contcar format

poscar format

Class: VASPPoscarFormat

Conversions

Convert from this format to System
dpdata.System(file_name, fmt: Literal['vasp/contcar'] = None) dpdata.system.System
dpdata.System(file_name, fmt: Literal['vasp/poscar'] = None) dpdata.system.System
dpdata.System(file_name, fmt: Literal['contcar'] = None) dpdata.system.System
dpdata.System(file_name, fmt: Literal['poscar'] = None) dpdata.system.System
dpdata.System.from_vasp_contcar(file_name) dpdata.system.System
dpdata.System.from_vasp_poscar(file_name) dpdata.system.System
dpdata.System.from_contcar(file_name) dpdata.system.System
dpdata.System.from_poscar(file_name) dpdata.system.System

Convert this format to System.

Returns:
System

converted system

Convert from System to this format
dpdata.System.to(fmt: Literal['vasp/contcar'], file_name, frame_idx=0)
dpdata.System.to(fmt: Literal['vasp/contcar'], file_name, frame_idx=0)
dpdata.System.to(fmt: Literal['vasp/contcar'], file_name, frame_idx=0)
dpdata.System.to(fmt: Literal['vasp/contcar'], file_name, frame_idx=0)
dpdata.System.to_vasp_contcar(file_name, frame_idx=0)
dpdata.System.to_vasp_poscar(file_name, frame_idx=0)
dpdata.System.to_contcar(file_name, frame_idx=0)
dpdata.System.to_poscar(file_name, frame_idx=0)

Dump the system in vasp POSCAR format.

Parameters:
file_namestr

The output file name

frame_idxint

The index of the frame to dump

Convert from LabeledSystem to this format
dpdata.LabeledSystem.to(fmt: Literal['vasp/contcar'], file_name, frame_idx=0)
dpdata.LabeledSystem.to(fmt: Literal['vasp/contcar'], file_name, frame_idx=0)
dpdata.LabeledSystem.to(fmt: Literal['vasp/contcar'], file_name, frame_idx=0)
dpdata.LabeledSystem.to(fmt: Literal['vasp/contcar'], file_name, frame_idx=0)
dpdata.LabeledSystem.to_vasp_contcar(file_name, frame_idx=0)
dpdata.LabeledSystem.to_vasp_poscar(file_name, frame_idx=0)
dpdata.LabeledSystem.to_contcar(file_name, frame_idx=0)
dpdata.LabeledSystem.to_poscar(file_name, frame_idx=0)

Dump the system in vasp POSCAR format.

Parameters:
file_namestr

The output file name

frame_idxint

The index of the frame to dump

vasp/string format

Class: VASPStringFormat

Conversions

Convert from System to this format
dpdata.System.to(fmt: Literal['vasp/string'], frame_idx=0)
dpdata.System.to_vasp_string(frame_idx=0)

Dump the system in vasp POSCAR format string.

Parameters:
frame_idxint

The index of the frame to dump

Convert from LabeledSystem to this format
dpdata.LabeledSystem.to(fmt: Literal['vasp/string'], frame_idx=0)
dpdata.LabeledSystem.to_vasp_string(frame_idx=0)

Dump the system in vasp POSCAR format string.

Parameters:
frame_idxint

The index of the frame to dump

vasp/xml format

xml format

Class: VASPXMLFormat

Conversions

Convert from this format to LabeledSystem
dpdata.LabeledSystem(file_name, begin=0, step=1, fmt: Literal['vasp/xml'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem(file_name, begin=0, step=1, fmt: Literal['xml'] = None) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_vasp_xml(file_name, begin=0, step=1) dpdata.system.LabeledSystem
dpdata.LabeledSystem.from_xml(file_name, begin=0, step=1) dpdata.system.LabeledSystem

Convert this format to LabeledSystem.

Returns:
LabeledSystem

converted system

xyz format

Class: XYZFormat

XYZ foramt.

Examples

>>> s.to("xyz", "a.xyz")

Conversions

Convert from this format to System
dpdata.System(file_name, fmt: Literal['xyz'] = None) dpdata.system.System
dpdata.System.from_xyz(file_name) dpdata.system.System

Convert this format to System.

Returns:
System

converted system

Convert from System to this format
dpdata.System.to(fmt: Literal['xyz'], file_name)
dpdata.System.to_xyz(file_name)

Convert System to this format.

Convert from LabeledSystem to this format
dpdata.LabeledSystem.to(fmt: Literal['xyz'], file_name)
dpdata.LabeledSystem.to_xyz(file_name)

Convert LabeledSystem to this format.

Supported Drivers

dpdata supports the following drivers:

Supported Drivers

Class

Alias

HybridDriver

hybrid

DPDriver

deepmd-kit deepmd dp

ASEDriver

ase

GaussianDriver

gaussian

SQMDriver

sqm

Supported Minimizers

dpdata supports the following minimizers:

Supported Minimizers

Class

Alias

ASEMinimizer

ase

SQMMinimizer

sqm

API documentation

dpdata package

class dpdata.BondOrderSystem(file_name=None, fmt='auto', type_map=None, begin=0, step=1, data=None, rdkit_mol=None, sanitize_level='medium', raise_errors=True, verbose=False, **kwargs)[source]

Bases: System

The system with chemical bond and formal charges information.

For example, a labeled methane system named d_example has one molecule (5 atoms, 4 bonds) and n_frames frames. The bond order and formal charge information can be accessed by
  • d_example[‘bonds’]a numpy array of size 4 x 3, and

    the first column represents the index of begin atom, the second column represents the index of end atom, the third columen represents the bond order:

    1 - single bond, 2 - double bond, 3 - triple bond, 1.5 - aromatic bond

  • d_example[‘formal_charges’] : a numpy array of size 5 x 1

Attributes:
formula

Return the formula of this system, like C3H5O2.

formula_hash

Return the hash of the formula of this system.

nopbc
short_formula

Return the short formula of this system.

short_name

Return the short name of this system (no more than 255 bytes), in the following order: - formula - short_formula - formula_hash.

uniq_formula

Return the uniq_formula of this system.

Methods

add_atom_names(atom_names)

Add atom_names that do not exist.

append(system)

Append a system to this system.

apply_pbc()

Append periodic boundary condition.

as_dict()

Returns data dict of System instance.

check_data()

Check if data is correct.

check_type_map(type_map)

Assign atom_names to type_map if type_map is given and different from atom_names.

convert_to_mixed_type([type_map])

Convert the data dict to mixed type format structure, in order to append systems with different formula but the same number of atoms.

copy()

Returns a copy of the system.

dump(filename[, indent])

Dump .json or .yaml file.

extend(systems)

Extend a system list to this system.

from_3dmol(file_name, **kwargs)

Read data from dpdata.plugins.3dmol.Py3DMolFormat format.

from_abacus_lcao_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_lcao_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_lcao_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_pw_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_pw_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_pw_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_stru(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSTRUFormat format.

from_amber_md(file_name, **kwargs)

Read data from dpdata.plugins.amber.AmberMDFormat format.

from_ase_structure(file_name, **kwargs)

Read data from dpdata.plugins.ase.ASEStructureFormat format.

from_ase_traj(file_name, **kwargs)

Read data from dpdata.plugins.ase.ASETrajFormat format.

from_atomconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_contcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_cp2k_aimd_output(file_name, **kwargs)

Read data from dpdata.plugins.cp2k.CP2KAIMDOutputFormat format.

from_cp2k_output(file_name, **kwargs)

Read data from dpdata.plugins.cp2k.CP2KOutputFormat format.

from_deepmd(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDRawFormat format.

from_deepmd_comp(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDCompFormat format.

from_deepmd_hdf5(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDHDF5Format format.

from_deepmd_npy(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDCompFormat format.

from_deepmd_npy_mixed(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDMixedFormat format.

from_deepmd_raw(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDRawFormat format.

from_dftbplus(file_name, **kwargs)

Read data from dpdata.plugins.dftbplus.DFTBplusFormat format.

from_dict(d)

param d:

Dict representation.

from_dump(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSDumpFormat format.

from_fhi_aims_md(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiMDFormat format.

from_fhi_aims_output(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiMDFormat format.

from_fhi_aims_scf(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiSCFFormat format.

from_finalconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_gaussian_gjf(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussiaGJFFormat format.

from_gaussian_log(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussianLogFormat format.

from_gaussian_md(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussianMDFormat format.

from_gro(file_name, **kwargs)

Read data from dpdata.plugins.gromacs.GromacsGroFormat format.

from_gromacs_gro(file_name, **kwargs)

Read data from dpdata.plugins.gromacs.GromacsGroFormat format.

from_lammps_dump(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSDumpFormat format.

from_lammps_lmp(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSLmpFormat format.

from_list(file_name, **kwargs)

Read data from dpdata.plugins.list.ListFormat format.

from_lmp(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSLmpFormat format.

from_mlmd(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_mol(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.MolFormat format.

from_mol_file(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.MolFormat format.

from_movement(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_n2p2(file_name, **kwargs)

Read data from dpdata.plugins.n2p2.N2P2Format format.

from_openmx_md(file_name, **kwargs)

Read data from dpdata.plugins.openmx.OPENMXFormat format.

from_orca_spout(file_name, **kwargs)

Read data from dpdata.plugins.orca.ORCASPOutFormat format.

from_outcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPOutcarFormat format.

from_poscar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_psi4_inp(file_name, **kwargs)

Read data from dpdata.plugins.psi4.PSI4InputFormat format.

from_psi4_out(file_name, **kwargs)

Read data from dpdata.plugins.psi4.PSI4OutFormat format.

from_pwmat_atomconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_pwmat_finalconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_pwmat_mlmd(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pwmat_movement(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pwmat_output(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pymatgen_computedstructureentry(...)

Read data from dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

from_pymatgen_molecule(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenMoleculeFormat format.

from_pymatgen_structure(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenStructureFormat format.

from_qe_cp_traj(file_name, **kwargs)

Read data from dpdata.plugins.qe.QECPTrajFormat format.

from_qe_pw_scf(file_name, **kwargs)

Read data from dpdata.plugins.qe.QECPPWSCFFormat format.

from_quip_gap_xyz(file_name, **kwargs)

Read data from dpdata.plugins.xyz.QuipGapXYZFormat format.

from_quip_gap_xyz_file(file_name, **kwargs)

Read data from dpdata.plugins.xyz.QuipGapXYZFormat format.

from_rdkit_mol(rdkit_mol)

Initialize from a rdkit.Chem.rdchem.Mol object.

from_sdf(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.SdfFormat format.

from_sdf_file(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.SdfFormat format.

from_siesta_aiMD_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

from_siesta_aimd_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

from_siesta_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaOutputFormat format.

from_sqm_in(file_name, **kwargs)

Read data from dpdata.plugins.amber.SQMINFormat format.

from_sqm_out(file_name, **kwargs)

Read data from dpdata.plugins.amber.SQMOutFormat format.

from_stru(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSTRUFormat format.

from_vasp_contcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_vasp_outcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPOutcarFormat format.

from_vasp_poscar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_vasp_string(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPStringFormat format.

from_vasp_xml(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPXMLFormat format.

from_xml(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPXMLFormat format.

from_xyz(file_name, **kwargs)

Read data from dpdata.plugins.xyz.XYZFormat format.

get_atom_names()

Returns name of atoms.

get_atom_numbs()

Returns number of atoms.

get_atom_types()

Returns type of atoms.

get_bond_order(begin_atom_idx, end_atom_idx)

Return the bond order between given atoms.

get_charge()

Return the total formal charge of the moleclue.

get_formal_charges()

Return the formal charges on each atom.

get_mol()

Return the rdkit.Mol object.

get_natoms()

Returns total number of atoms in the system.

get_nbonds()

Return the number of bonds.

get_nframes()

Returns number of frames in the system.

get_ntypes()

Returns total number of atom types in the system.

load(filename)

Rebuild System obj.

map_atom_types([type_map])

Map the atom types of the system.

minimize(*args, minimizer, **kwargs)

Minimize the geometry.

perturb(pert_num, cell_pert_fraction, ...[, ...])

Perturb each frame in the system randomly.

pick_atom_idx(idx[, nopbc])

Pick atom index.

pick_by_amber_mask(param, maskstr[, ...])

Pick atoms by amber mask.

predict(*args[, driver])

Predict energies and forces by a driver.

register_data_type(*data_type)

Register data type.

remove_atom_names(atom_names)

Remove atom names and all such atoms.

remove_pbc([protect_layer])

This method does NOT delete the definition of the cells, it (1) revises the cell to a cubic cell and ensures that the cell boundary to any atom in the system is no less than protect_layer (2) translates the system such that the center-of-geometry of the system locates at the center of the cell.

replicate(ncopy)

Replicate the each frame in the system in 3 dimensions.

shuffle()

Shuffle frames randomly.

sort_atom_names([type_map])

Sort atom_names of the system and reorder atom_numbs and atom_types accoarding to atom_names.

sort_atom_types()

Sort atom types.

sub_system(f_idx)

Construct a subsystem from the system.

to(fmt, *args, **kwargs)

Dump systems to the specific format.

to_3dmol(*args, **kwargs)

Dump data to dpdata.plugins.3dmol.Py3DMolFormat format.

to_abacus_lcao_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_lcao_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_lcao_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_pw_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_pw_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_pw_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_stru(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSTRUFormat format.

to_amber_md(*args, **kwargs)

Dump data to dpdata.plugins.amber.AmberMDFormat format.

to_ase_structure(*args, **kwargs)

Dump data to dpdata.plugins.ase.ASEStructureFormat format.

to_ase_traj(*args, **kwargs)

Dump data to dpdata.plugins.ase.ASETrajFormat format.

to_atomconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_contcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_cp2k_aimd_output(*args, **kwargs)

Dump data to dpdata.plugins.cp2k.CP2KAIMDOutputFormat format.

to_cp2k_output(*args, **kwargs)

Dump data to dpdata.plugins.cp2k.CP2KOutputFormat format.

to_deepmd(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDRawFormat format.

to_deepmd_comp(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDCompFormat format.

to_deepmd_hdf5(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDHDF5Format format.

to_deepmd_npy(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDCompFormat format.

to_deepmd_npy_mixed(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDMixedFormat format.

to_deepmd_raw(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDRawFormat format.

to_dftbplus(*args, **kwargs)

Dump data to dpdata.plugins.dftbplus.DFTBplusFormat format.

to_dump(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSDumpFormat format.

to_fhi_aims_md(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiMDFormat format.

to_fhi_aims_output(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiMDFormat format.

to_fhi_aims_scf(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiSCFFormat format.

to_finalconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_gaussian_gjf(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussiaGJFFormat format.

to_gaussian_log(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussianLogFormat format.

to_gaussian_md(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussianMDFormat format.

to_gro(*args, **kwargs)

Dump data to dpdata.plugins.gromacs.GromacsGroFormat format.

to_gromacs_gro(*args, **kwargs)

Dump data to dpdata.plugins.gromacs.GromacsGroFormat format.

to_json()

Returns a json string representation of the MSONable object.

to_lammps_dump(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSDumpFormat format.

to_lammps_lmp(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSLmpFormat format.

to_list(*args, **kwargs)

Dump data to dpdata.plugins.list.ListFormat format.

to_lmp(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSLmpFormat format.

to_mlmd(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_mol(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.MolFormat format.

to_mol_file(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.MolFormat format.

to_movement(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_n2p2(*args, **kwargs)

Dump data to dpdata.plugins.n2p2.N2P2Format format.

to_openmx_md(*args, **kwargs)

Dump data to dpdata.plugins.openmx.OPENMXFormat format.

to_orca_spout(*args, **kwargs)

Dump data to dpdata.plugins.orca.ORCASPOutFormat format.

to_outcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPOutcarFormat format.

to_poscar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_psi4_inp(*args, **kwargs)

Dump data to dpdata.plugins.psi4.PSI4InputFormat format.

to_psi4_out(*args, **kwargs)

Dump data to dpdata.plugins.psi4.PSI4OutFormat format.

to_pwmat_atomconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_pwmat_finalconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_pwmat_mlmd(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pwmat_movement(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pwmat_output(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pymatgen_ComputedStructureEntry(*args, ...)

Dump data to dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

to_pymatgen_computedstructureentry(*args, ...)

Dump data to dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

to_pymatgen_molecule(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenMoleculeFormat format.

to_pymatgen_structure(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenStructureFormat format.

to_qe_cp_traj(*args, **kwargs)

Dump data to dpdata.plugins.qe.QECPTrajFormat format.

to_qe_pw_scf(*args, **kwargs)

Dump data to dpdata.plugins.qe.QECPPWSCFFormat format.

to_quip_gap_xyz(*args, **kwargs)

Dump data to dpdata.plugins.xyz.QuipGapXYZFormat format.

to_quip_gap_xyz_file(*args, **kwargs)

Dump data to dpdata.plugins.xyz.QuipGapXYZFormat format.

to_sdf(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.SdfFormat format.

to_sdf_file(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.SdfFormat format.

to_siesta_aimd_output(*args, **kwargs)

Dump data to dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

to_siesta_output(*args, **kwargs)

Dump data to dpdata.plugins.siesta.SiestaOutputFormat format.

to_sqm_in(*args, **kwargs)

Dump data to dpdata.plugins.amber.SQMINFormat format.

to_sqm_out(*args, **kwargs)

Dump data to dpdata.plugins.amber.SQMOutFormat format.

to_stru(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSTRUFormat format.

to_vasp_contcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_vasp_outcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPOutcarFormat format.

to_vasp_poscar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_vasp_string(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPStringFormat format.

to_vasp_xml(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPXMLFormat format.

to_xml(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPXMLFormat format.

to_xyz(*args, **kwargs)

Dump data to dpdata.plugins.xyz.XYZFormat format.

unsafe_hash()

Returns an hash of the current object.

validate_monty_v1(_MSONable__input_value)

Pydantic validator with correct signature for pydantic v1.x

validate_monty_v2(_MSONable__input_value, _)

Pydantic validator with correct signature for pydantic v2.x

affine_map

apply_type_map

from_fmt

from_fmt_obj

replace

rot_frame_lower_triangular

rot_lower_triangular

to_fmt_obj

DTYPES = (<dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>)
copy()[source]

Returns a copy of the system.

from_fmt_obj(fmtobj, file_name, **kwargs)[source]
from_rdkit_mol(rdkit_mol)[source]

Initialize from a rdkit.Chem.rdchem.Mol object.

get_bond_order(begin_atom_idx, end_atom_idx)[source]

Return the bond order between given atoms.

get_charge()[source]

Return the total formal charge of the moleclue.

get_formal_charges()[source]

Return the formal charges on each atom.

get_mol()[source]

Return the rdkit.Mol object.

get_nbonds()[source]

Return the number of bonds.

to_fmt_obj(fmtobj, *args, **kwargs)[source]
class dpdata.LabeledSystem(file_name=None, fmt='auto', type_map=None, begin=0, step=1, data=None, convergence_check=True, **kwargs)[source]

Bases: System

The labeled data System.

For example, a labeled water system named d_example has two molecules (6 atoms) and nframes frames. The labels can be accessed by
  • d_example[‘energies’] : a numpy array of size nframes

  • d_example[‘forces’] : a numpy array of size nframes x 6 x 3

  • d_example[‘virials’] : optional, a numpy array of size nframes x 3 x 3

It is noted that
  • The order of frames stored in ‘energies’, ‘forces’ and ‘virials’ should be consistent with ‘atom_types’, ‘cells’ and ‘coords’.

  • The order of atoms in every frame of ‘forces’ should be consistent with ‘coords’ and ‘atom_types’.

Parameters:
file_namestr

The file to load the system

fmtstr
Format of the file, supported formats are
  • auto: infered from file_name’s extension

  • vasp/xml: vasp xml

  • vasp/outcar: vasp OUTCAR

  • deepmd/raw: deepmd-kit raw

  • deepmd/npy: deepmd-kit compressed format (numpy binary)

  • qe/cp/traj: Quantum Espresso CP trajectory files. should have: file_name+’.in’, file_name+’.pos’, file_name+’.evp’ and file_name+’.for’

  • qe/pw/scf: Quantum Espresso PW single point calculations. Both input and output files are required. If file_name is a string, it denotes the output file name. Input file name is obtained by replacing ‘out’ by ‘in’ from file_name. Or file_name is a list, with the first element being the input file name and the second element being the output filename.

  • siesta/output: siesta SCF output file

  • siesta/aimd_output: siesta aimd output file

  • gaussian/log: gaussian logs

  • gaussian/md: gaussian ab initio molecular dynamics

  • cp2k/output: cp2k output file

  • cp2k/aimd_output: cp2k aimd output dir(contains pos.xyz and *.log file); optional restart=True if it is a cp2k restarted task.

  • pwmat/movement: pwmat md output file

  • pwmat/out.mlmd: pwmat scf output file

type_maplist of str

Maps atom type to name. The atom with type ii is mapped to type_map[ii]. If not provided the atom names are assigned to ‘Type_1’, ‘Type_2’, ‘Type_3’

beginint

The beginning frame when loading MD trajectory.

stepint

The number of skipped frames when loading MD trajectory.

Attributes:
formula

Return the formula of this system, like C3H5O2.

formula_hash

Return the hash of the formula of this system.

nopbc
short_formula

Return the short formula of this system.

short_name

Return the short name of this system (no more than 255 bytes), in the following order: - formula - short_formula - formula_hash.

uniq_formula

Return the uniq_formula of this system.

Methods

add_atom_names(atom_names)

Add atom_names that do not exist.

append(system)

Append a system to this system.

apply_pbc()

Append periodic boundary condition.

as_dict()

Returns data dict of System instance.

check_data()

Check if data is correct.

check_type_map(type_map)

Assign atom_names to type_map if type_map is given and different from atom_names.

convert_to_mixed_type([type_map])

Convert the data dict to mixed type format structure, in order to append systems with different formula but the same number of atoms.

copy()

Returns a copy of the system.

correction(hl_sys)

Get energy and force correction between self and a high-level LabeledSystem.

dump(filename[, indent])

Dump .json or .yaml file.

extend(systems)

Extend a system list to this system.

from_3dmol(file_name, **kwargs)

Read data from dpdata.plugins.3dmol.Py3DMolFormat format.

from_abacus_lcao_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_lcao_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_lcao_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_pw_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_pw_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_pw_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_stru(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSTRUFormat format.

from_amber_md(file_name, **kwargs)

Read data from dpdata.plugins.amber.AmberMDFormat format.

from_ase_structure(file_name, **kwargs)

Read data from dpdata.plugins.ase.ASEStructureFormat format.

from_ase_traj(file_name, **kwargs)

Read data from dpdata.plugins.ase.ASETrajFormat format.

from_atomconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_contcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_cp2k_aimd_output(file_name, **kwargs)

Read data from dpdata.plugins.cp2k.CP2KAIMDOutputFormat format.

from_cp2k_output(file_name, **kwargs)

Read data from dpdata.plugins.cp2k.CP2KOutputFormat format.

from_deepmd(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDRawFormat format.

from_deepmd_comp(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDCompFormat format.

from_deepmd_hdf5(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDHDF5Format format.

from_deepmd_npy(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDCompFormat format.

from_deepmd_npy_mixed(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDMixedFormat format.

from_deepmd_raw(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDRawFormat format.

from_dftbplus(file_name, **kwargs)

Read data from dpdata.plugins.dftbplus.DFTBplusFormat format.

from_dict(d)

param d:

Dict representation.

from_dump(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSDumpFormat format.

from_fhi_aims_md(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiMDFormat format.

from_fhi_aims_output(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiMDFormat format.

from_fhi_aims_scf(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiSCFFormat format.

from_finalconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_gaussian_gjf(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussiaGJFFormat format.

from_gaussian_log(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussianLogFormat format.

from_gaussian_md(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussianMDFormat format.

from_gro(file_name, **kwargs)

Read data from dpdata.plugins.gromacs.GromacsGroFormat format.

from_gromacs_gro(file_name, **kwargs)

Read data from dpdata.plugins.gromacs.GromacsGroFormat format.

from_lammps_dump(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSDumpFormat format.

from_lammps_lmp(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSLmpFormat format.

from_list(file_name, **kwargs)

Read data from dpdata.plugins.list.ListFormat format.

from_lmp(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSLmpFormat format.

from_mlmd(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_mol(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.MolFormat format.

from_mol_file(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.MolFormat format.

from_movement(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_n2p2(file_name, **kwargs)

Read data from dpdata.plugins.n2p2.N2P2Format format.

from_openmx_md(file_name, **kwargs)

Read data from dpdata.plugins.openmx.OPENMXFormat format.

from_orca_spout(file_name, **kwargs)

Read data from dpdata.plugins.orca.ORCASPOutFormat format.

from_outcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPOutcarFormat format.

from_poscar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_psi4_inp(file_name, **kwargs)

Read data from dpdata.plugins.psi4.PSI4InputFormat format.

from_psi4_out(file_name, **kwargs)

Read data from dpdata.plugins.psi4.PSI4OutFormat format.

from_pwmat_atomconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_pwmat_finalconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_pwmat_mlmd(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pwmat_movement(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pwmat_output(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pymatgen_computedstructureentry(...)

Read data from dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

from_pymatgen_molecule(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenMoleculeFormat format.

from_pymatgen_structure(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenStructureFormat format.

from_qe_cp_traj(file_name, **kwargs)

Read data from dpdata.plugins.qe.QECPTrajFormat format.

from_qe_pw_scf(file_name, **kwargs)

Read data from dpdata.plugins.qe.QECPPWSCFFormat format.

from_quip_gap_xyz(file_name, **kwargs)

Read data from dpdata.plugins.xyz.QuipGapXYZFormat format.

from_quip_gap_xyz_file(file_name, **kwargs)

Read data from dpdata.plugins.xyz.QuipGapXYZFormat format.

from_sdf(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.SdfFormat format.

from_sdf_file(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.SdfFormat format.

from_siesta_aiMD_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

from_siesta_aimd_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

from_siesta_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaOutputFormat format.

from_sqm_in(file_name, **kwargs)

Read data from dpdata.plugins.amber.SQMINFormat format.

from_sqm_out(file_name, **kwargs)

Read data from dpdata.plugins.amber.SQMOutFormat format.

from_stru(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSTRUFormat format.

from_vasp_contcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_vasp_outcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPOutcarFormat format.

from_vasp_poscar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_vasp_string(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPStringFormat format.

from_vasp_xml(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPXMLFormat format.

from_xml(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPXMLFormat format.

from_xyz(file_name, **kwargs)

Read data from dpdata.plugins.xyz.XYZFormat format.

get_atom_names()

Returns name of atoms.

get_atom_numbs()

Returns number of atoms.

get_atom_types()

Returns type of atoms.

get_natoms()

Returns total number of atoms in the system.

get_nframes()

Returns number of frames in the system.

get_ntypes()

Returns total number of atom types in the system.

load(filename)

Rebuild System obj.

map_atom_types([type_map])

Map the atom types of the system.

minimize(*args, minimizer, **kwargs)

Minimize the geometry.

perturb(pert_num, cell_pert_fraction, ...[, ...])

Perturb each frame in the system randomly.

pick_atom_idx(idx[, nopbc])

Pick atom index.

pick_by_amber_mask(param, maskstr[, ...])

Pick atoms by amber mask.

predict(*args[, driver])

Predict energies and forces by a driver.

register_data_type(*data_type)

Register data type.

remove_atom_names(atom_names)

Remove atom names and all such atoms.

remove_outlier([threshold])

Remove outlier frames from the system.

remove_pbc([protect_layer])

This method does NOT delete the definition of the cells, it (1) revises the cell to a cubic cell and ensures that the cell boundary to any atom in the system is no less than protect_layer (2) translates the system such that the center-of-geometry of the system locates at the center of the cell.

replicate(ncopy)

Replicate the each frame in the system in 3 dimensions.

shuffle()

Shuffle frames randomly.

sort_atom_names([type_map])

Sort atom_names of the system and reorder atom_numbs and atom_types accoarding to atom_names.

sort_atom_types()

Sort atom types.

sub_system(f_idx)

Construct a subsystem from the system.

to(fmt, *args, **kwargs)

Dump systems to the specific format.

to_3dmol(*args, **kwargs)

Dump data to dpdata.plugins.3dmol.Py3DMolFormat format.

to_abacus_lcao_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_lcao_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_lcao_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_pw_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_pw_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_pw_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_stru(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSTRUFormat format.

to_amber_md(*args, **kwargs)

Dump data to dpdata.plugins.amber.AmberMDFormat format.

to_ase_structure(*args, **kwargs)

Dump data to dpdata.plugins.ase.ASEStructureFormat format.

to_ase_traj(*args, **kwargs)

Dump data to dpdata.plugins.ase.ASETrajFormat format.

to_atomconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_contcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_cp2k_aimd_output(*args, **kwargs)

Dump data to dpdata.plugins.cp2k.CP2KAIMDOutputFormat format.

to_cp2k_output(*args, **kwargs)

Dump data to dpdata.plugins.cp2k.CP2KOutputFormat format.

to_deepmd(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDRawFormat format.

to_deepmd_comp(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDCompFormat format.

to_deepmd_hdf5(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDHDF5Format format.

to_deepmd_npy(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDCompFormat format.

to_deepmd_npy_mixed(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDMixedFormat format.

to_deepmd_raw(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDRawFormat format.

to_dftbplus(*args, **kwargs)

Dump data to dpdata.plugins.dftbplus.DFTBplusFormat format.

to_dump(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSDumpFormat format.

to_fhi_aims_md(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiMDFormat format.

to_fhi_aims_output(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiMDFormat format.

to_fhi_aims_scf(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiSCFFormat format.

to_finalconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_gaussian_gjf(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussiaGJFFormat format.

to_gaussian_log(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussianLogFormat format.

to_gaussian_md(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussianMDFormat format.

to_gro(*args, **kwargs)

Dump data to dpdata.plugins.gromacs.GromacsGroFormat format.

to_gromacs_gro(*args, **kwargs)

Dump data to dpdata.plugins.gromacs.GromacsGroFormat format.

to_json()

Returns a json string representation of the MSONable object.

to_lammps_dump(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSDumpFormat format.

to_lammps_lmp(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSLmpFormat format.

to_list(*args, **kwargs)

Dump data to dpdata.plugins.list.ListFormat format.

to_lmp(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSLmpFormat format.

to_mlmd(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_mol(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.MolFormat format.

to_mol_file(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.MolFormat format.

to_movement(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_n2p2(*args, **kwargs)

Dump data to dpdata.plugins.n2p2.N2P2Format format.

to_openmx_md(*args, **kwargs)

Dump data to dpdata.plugins.openmx.OPENMXFormat format.

to_orca_spout(*args, **kwargs)

Dump data to dpdata.plugins.orca.ORCASPOutFormat format.

to_outcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPOutcarFormat format.

to_poscar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_psi4_inp(*args, **kwargs)

Dump data to dpdata.plugins.psi4.PSI4InputFormat format.

to_psi4_out(*args, **kwargs)

Dump data to dpdata.plugins.psi4.PSI4OutFormat format.

to_pwmat_atomconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_pwmat_finalconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_pwmat_mlmd(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pwmat_movement(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pwmat_output(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pymatgen_ComputedStructureEntry(*args, ...)

Dump data to dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

to_pymatgen_computedstructureentry(*args, ...)

Dump data to dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

to_pymatgen_molecule(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenMoleculeFormat format.

to_pymatgen_structure(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenStructureFormat format.

to_qe_cp_traj(*args, **kwargs)

Dump data to dpdata.plugins.qe.QECPTrajFormat format.

to_qe_pw_scf(*args, **kwargs)

Dump data to dpdata.plugins.qe.QECPPWSCFFormat format.

to_quip_gap_xyz(*args, **kwargs)

Dump data to dpdata.plugins.xyz.QuipGapXYZFormat format.

to_quip_gap_xyz_file(*args, **kwargs)

Dump data to dpdata.plugins.xyz.QuipGapXYZFormat format.

to_sdf(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.SdfFormat format.

to_sdf_file(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.SdfFormat format.

to_siesta_aimd_output(*args, **kwargs)

Dump data to dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

to_siesta_output(*args, **kwargs)

Dump data to dpdata.plugins.siesta.SiestaOutputFormat format.

to_sqm_in(*args, **kwargs)

Dump data to dpdata.plugins.amber.SQMINFormat format.

to_sqm_out(*args, **kwargs)

Dump data to dpdata.plugins.amber.SQMOutFormat format.

to_stru(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSTRUFormat format.

to_vasp_contcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_vasp_outcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPOutcarFormat format.

to_vasp_poscar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_vasp_string(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPStringFormat format.

to_vasp_xml(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPXMLFormat format.

to_xml(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPXMLFormat format.

to_xyz(*args, **kwargs)

Dump data to dpdata.plugins.xyz.XYZFormat format.

unsafe_hash()

Returns an hash of the current object.

validate_monty_v1(_MSONable__input_value)

Pydantic validator with correct signature for pydantic v1.x

validate_monty_v2(_MSONable__input_value, _)

Pydantic validator with correct signature for pydantic v2.x

affine_map

affine_map_fv

apply_type_map

from_fmt

from_fmt_obj

has_virial

replace

rot_frame_lower_triangular

rot_lower_triangular

to_fmt_obj

DTYPES = (<dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>)
affine_map_fv(trans, f_idx)[source]
correction(hl_sys)[source]

Get energy and force correction between self and a high-level LabeledSystem. The self’s coordinates will be kept, but energy and forces will be replaced by the correction between these two systems.

Note: The function will not check whether coordinates and elements of two systems are the same. The user should make sure by itself.

Parameters:
hl_sysLabeledSystem

high-level LabeledSystem

Returns:
corrected_sys: LabeledSystem

Corrected LabeledSystem

from_3dmol(file_name, **kwargs)

Read data from dpdata.plugins.3dmol.Py3DMolFormat format.

from_abacus_lcao_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_lcao_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_lcao_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_pw_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_pw_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_pw_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_stru(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSTRUFormat format.

from_amber_md(file_name, **kwargs)

Read data from dpdata.plugins.amber.AmberMDFormat format.

from_ase_structure(file_name, **kwargs)

Read data from dpdata.plugins.ase.ASEStructureFormat format.

from_ase_traj(file_name, **kwargs)

Read data from dpdata.plugins.ase.ASETrajFormat format.

from_atomconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_contcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_cp2k_aimd_output(file_name, **kwargs)

Read data from dpdata.plugins.cp2k.CP2KAIMDOutputFormat format.

from_cp2k_output(file_name, **kwargs)

Read data from dpdata.plugins.cp2k.CP2KOutputFormat format.

from_deepmd(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDRawFormat format.

from_deepmd_comp(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDCompFormat format.

from_deepmd_hdf5(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDHDF5Format format.

from_deepmd_npy(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDCompFormat format.

from_deepmd_npy_mixed(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDMixedFormat format.

from_deepmd_raw(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDRawFormat format.

from_dftbplus(file_name, **kwargs)

Read data from dpdata.plugins.dftbplus.DFTBplusFormat format.

from_dump(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSDumpFormat format.

from_fhi_aims_md(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiMDFormat format.

from_fhi_aims_output(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiMDFormat format.

from_fhi_aims_scf(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiSCFFormat format.

from_finalconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_fmt_obj(fmtobj, file_name, **kwargs)[source]
from_gaussian_gjf(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussiaGJFFormat format.

from_gaussian_log(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussianLogFormat format.

from_gaussian_md(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussianMDFormat format.

from_gro(file_name, **kwargs)

Read data from dpdata.plugins.gromacs.GromacsGroFormat format.

from_gromacs_gro(file_name, **kwargs)

Read data from dpdata.plugins.gromacs.GromacsGroFormat format.

from_lammps_dump(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSDumpFormat format.

from_lammps_lmp(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSLmpFormat format.

from_list(file_name, **kwargs)

Read data from dpdata.plugins.list.ListFormat format.

from_lmp(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSLmpFormat format.

from_mlmd(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_mol(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.MolFormat format.

from_mol_file(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.MolFormat format.

from_movement(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_n2p2(file_name, **kwargs)

Read data from dpdata.plugins.n2p2.N2P2Format format.

from_openmx_md(file_name, **kwargs)

Read data from dpdata.plugins.openmx.OPENMXFormat format.

from_orca_spout(file_name, **kwargs)

Read data from dpdata.plugins.orca.ORCASPOutFormat format.

from_outcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPOutcarFormat format.

from_poscar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_psi4_inp(file_name, **kwargs)

Read data from dpdata.plugins.psi4.PSI4InputFormat format.

from_psi4_out(file_name, **kwargs)

Read data from dpdata.plugins.psi4.PSI4OutFormat format.

from_pwmat_atomconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_pwmat_finalconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_pwmat_mlmd(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pwmat_movement(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pwmat_output(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pymatgen_computedstructureentry(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

from_pymatgen_molecule(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenMoleculeFormat format.

from_pymatgen_structure(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenStructureFormat format.

from_qe_cp_traj(file_name, **kwargs)

Read data from dpdata.plugins.qe.QECPTrajFormat format.

from_qe_pw_scf(file_name, **kwargs)

Read data from dpdata.plugins.qe.QECPPWSCFFormat format.

from_quip_gap_xyz(file_name, **kwargs)

Read data from dpdata.plugins.xyz.QuipGapXYZFormat format.

from_quip_gap_xyz_file(file_name, **kwargs)

Read data from dpdata.plugins.xyz.QuipGapXYZFormat format.

from_sdf(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.SdfFormat format.

from_sdf_file(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.SdfFormat format.

from_siesta_aiMD_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

from_siesta_aimd_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

from_siesta_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaOutputFormat format.

from_sqm_in(file_name, **kwargs)

Read data from dpdata.plugins.amber.SQMINFormat format.

from_sqm_out(file_name, **kwargs)

Read data from dpdata.plugins.amber.SQMOutFormat format.

from_stru(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSTRUFormat format.

from_vasp_contcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_vasp_outcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPOutcarFormat format.

from_vasp_poscar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_vasp_string(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPStringFormat format.

from_vasp_xml(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPXMLFormat format.

from_xml(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPXMLFormat format.

from_xyz(file_name, **kwargs)

Read data from dpdata.plugins.xyz.XYZFormat format.

has_virial()[source]
post_funcs = <dpdata.plugin.Plugin object>
remove_outlier(threshold: float = 8.0) LabeledSystem[source]

Remove outlier frames from the system.

Remove the frames whose energies satisfy the condition

\[\frac{\left \| E - \bar{E} \right \|}{\sigma(E)} \geq \text{threshold}\]

where \(\bar{E}\) and \(\sigma(E)\) are the mean and standard deviation of the energies in the system.

Parameters:
thresholdfloat

The threshold of outlier detection. The default value is 8.0.

Returns:
LabeledSystem

The system without outlier frames.

References

[1]

Gao, X.; Ramezanghorbani, F.; Isayev, O.; Smith, J. S.; Roitberg, A. E. TorchANI: A Free and Open Source PyTorch-Based Deep Learning Implementation of the ANI Neural Network Potentials. J. Chem. Inf. Model. 2020, 60, 3408-3415.

[2]

Zeng, J.; Tao, Y.; Giese, T. J.; York, D. M.. QDπ: A Quantum Deep Potential Interaction Model for Drug Discovery. J. Comput. Chem. 2023, 19, 1261-1275.

rot_frame_lower_triangular(f_idx=0)[source]
to_3dmol(*args, **kwargs)

Dump data to dpdata.plugins.3dmol.Py3DMolFormat format.

to_abacus_lcao_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_lcao_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_lcao_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_pw_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_pw_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_pw_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_stru(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSTRUFormat format.

to_amber_md(*args, **kwargs)

Dump data to dpdata.plugins.amber.AmberMDFormat format.

to_ase_structure(*args, **kwargs)

Dump data to dpdata.plugins.ase.ASEStructureFormat format.

to_ase_traj(*args, **kwargs)

Dump data to dpdata.plugins.ase.ASETrajFormat format.

to_atomconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_contcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_cp2k_aimd_output(*args, **kwargs)

Dump data to dpdata.plugins.cp2k.CP2KAIMDOutputFormat format.

to_cp2k_output(*args, **kwargs)

Dump data to dpdata.plugins.cp2k.CP2KOutputFormat format.

to_deepmd(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDRawFormat format.

to_deepmd_comp(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDCompFormat format.

to_deepmd_hdf5(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDHDF5Format format.

to_deepmd_npy(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDCompFormat format.

to_deepmd_npy_mixed(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDMixedFormat format.

to_deepmd_raw(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDRawFormat format.

to_dftbplus(*args, **kwargs)

Dump data to dpdata.plugins.dftbplus.DFTBplusFormat format.

to_dump(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSDumpFormat format.

to_fhi_aims_md(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiMDFormat format.

to_fhi_aims_output(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiMDFormat format.

to_fhi_aims_scf(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiSCFFormat format.

to_finalconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_fmt_obj(fmtobj, *args, **kwargs)[source]
to_gaussian_gjf(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussiaGJFFormat format.

to_gaussian_log(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussianLogFormat format.

to_gaussian_md(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussianMDFormat format.

to_gro(*args, **kwargs)

Dump data to dpdata.plugins.gromacs.GromacsGroFormat format.

to_gromacs_gro(*args, **kwargs)

Dump data to dpdata.plugins.gromacs.GromacsGroFormat format.

to_lammps_dump(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSDumpFormat format.

to_lammps_lmp(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSLmpFormat format.

to_list(*args, **kwargs)

Dump data to dpdata.plugins.list.ListFormat format.

to_lmp(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSLmpFormat format.

to_mlmd(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_mol(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.MolFormat format.

to_mol_file(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.MolFormat format.

to_movement(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_n2p2(*args, **kwargs)

Dump data to dpdata.plugins.n2p2.N2P2Format format.

to_openmx_md(*args, **kwargs)

Dump data to dpdata.plugins.openmx.OPENMXFormat format.

to_orca_spout(*args, **kwargs)

Dump data to dpdata.plugins.orca.ORCASPOutFormat format.

to_outcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPOutcarFormat format.

to_poscar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_psi4_inp(*args, **kwargs)

Dump data to dpdata.plugins.psi4.PSI4InputFormat format.

to_psi4_out(*args, **kwargs)

Dump data to dpdata.plugins.psi4.PSI4OutFormat format.

to_pwmat_atomconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_pwmat_finalconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_pwmat_mlmd(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pwmat_movement(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pwmat_output(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pymatgen_ComputedStructureEntry(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

to_pymatgen_computedstructureentry(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

to_pymatgen_molecule(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenMoleculeFormat format.

to_pymatgen_structure(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenStructureFormat format.

to_qe_cp_traj(*args, **kwargs)

Dump data to dpdata.plugins.qe.QECPTrajFormat format.

to_qe_pw_scf(*args, **kwargs)

Dump data to dpdata.plugins.qe.QECPPWSCFFormat format.

to_quip_gap_xyz(*args, **kwargs)

Dump data to dpdata.plugins.xyz.QuipGapXYZFormat format.

to_quip_gap_xyz_file(*args, **kwargs)

Dump data to dpdata.plugins.xyz.QuipGapXYZFormat format.

to_sdf(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.SdfFormat format.

to_sdf_file(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.SdfFormat format.

to_siesta_aimd_output(*args, **kwargs)

Dump data to dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

to_siesta_output(*args, **kwargs)

Dump data to dpdata.plugins.siesta.SiestaOutputFormat format.

to_sqm_in(*args, **kwargs)

Dump data to dpdata.plugins.amber.SQMINFormat format.

to_sqm_out(*args, **kwargs)

Dump data to dpdata.plugins.amber.SQMOutFormat format.

to_stru(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSTRUFormat format.

to_vasp_contcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_vasp_outcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPOutcarFormat format.

to_vasp_poscar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_vasp_string(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPStringFormat format.

to_vasp_xml(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPXMLFormat format.

to_xml(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPXMLFormat format.

to_xyz(*args, **kwargs)

Dump data to dpdata.plugins.xyz.XYZFormat format.

class dpdata.MultiSystems(*systems, type_map=None)[source]

Bases: object

A set containing several systems.

Methods

append(*systems)

Append systems or MultiSystems to systems.

check_atom_names(system)

Make atom_names in all systems equal, prevent inconsistent atom_types.

correction(hl_sys)

Get energy and force correction between self (assumed low-level) and a high-level MultiSystems.

from_3dmol(file_name, **kwargs)

Read data from dpdata.plugins.3dmol.Py3DMolFormat format.

from_abacus_lcao_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_lcao_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_lcao_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_pw_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_pw_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_pw_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_stru(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSTRUFormat format.

from_amber_md(file_name, **kwargs)

Read data from dpdata.plugins.amber.AmberMDFormat format.

from_ase_structure(file_name, **kwargs)

Read data from dpdata.plugins.ase.ASEStructureFormat format.

from_ase_traj(file_name, **kwargs)

Read data from dpdata.plugins.ase.ASETrajFormat format.

from_atomconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_contcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_cp2k_aimd_output(file_name, **kwargs)

Read data from dpdata.plugins.cp2k.CP2KAIMDOutputFormat format.

from_cp2k_output(file_name, **kwargs)

Read data from dpdata.plugins.cp2k.CP2KOutputFormat format.

from_deepmd(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDRawFormat format.

from_deepmd_comp(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDCompFormat format.

from_deepmd_hdf5(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDHDF5Format format.

from_deepmd_npy(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDCompFormat format.

from_deepmd_npy_mixed(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDMixedFormat format.

from_deepmd_raw(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDRawFormat format.

from_dftbplus(file_name, **kwargs)

Read data from dpdata.plugins.dftbplus.DFTBplusFormat format.

from_dump(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSDumpFormat format.

from_fhi_aims_md(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiMDFormat format.

from_fhi_aims_output(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiMDFormat format.

from_fhi_aims_scf(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiSCFFormat format.

from_finalconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_gaussian_gjf(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussiaGJFFormat format.

from_gaussian_log(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussianLogFormat format.

from_gaussian_md(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussianMDFormat format.

from_gro(file_name, **kwargs)

Read data from dpdata.plugins.gromacs.GromacsGroFormat format.

from_gromacs_gro(file_name, **kwargs)

Read data from dpdata.plugins.gromacs.GromacsGroFormat format.

from_lammps_dump(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSDumpFormat format.

from_lammps_lmp(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSLmpFormat format.

from_list(file_name, **kwargs)

Read data from dpdata.plugins.list.ListFormat format.

from_lmp(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSLmpFormat format.

from_mlmd(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_mol(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.MolFormat format.

from_mol_file(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.MolFormat format.

from_movement(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_n2p2(file_name, **kwargs)

Read data from dpdata.plugins.n2p2.N2P2Format format.

from_openmx_md(file_name, **kwargs)

Read data from dpdata.plugins.openmx.OPENMXFormat format.

from_orca_spout(file_name, **kwargs)

Read data from dpdata.plugins.orca.ORCASPOutFormat format.

from_outcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPOutcarFormat format.

from_poscar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_psi4_inp(file_name, **kwargs)

Read data from dpdata.plugins.psi4.PSI4InputFormat format.

from_psi4_out(file_name, **kwargs)

Read data from dpdata.plugins.psi4.PSI4OutFormat format.

from_pwmat_atomconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_pwmat_finalconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_pwmat_mlmd(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pwmat_movement(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pwmat_output(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pymatgen_computedstructureentry(...)

Read data from dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

from_pymatgen_molecule(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenMoleculeFormat format.

from_pymatgen_structure(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenStructureFormat format.

from_qe_cp_traj(file_name, **kwargs)

Read data from dpdata.plugins.qe.QECPTrajFormat format.

from_qe_pw_scf(file_name, **kwargs)

Read data from dpdata.plugins.qe.QECPPWSCFFormat format.

from_quip_gap_xyz(file_name, **kwargs)

Read data from dpdata.plugins.xyz.QuipGapXYZFormat format.

from_quip_gap_xyz_file(file_name, **kwargs)

Read data from dpdata.plugins.xyz.QuipGapXYZFormat format.

from_sdf(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.SdfFormat format.

from_sdf_file(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.SdfFormat format.

from_siesta_aiMD_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

from_siesta_aimd_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

from_siesta_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaOutputFormat format.

from_sqm_in(file_name, **kwargs)

Read data from dpdata.plugins.amber.SQMINFormat format.

from_sqm_out(file_name, **kwargs)

Read data from dpdata.plugins.amber.SQMOutFormat format.

from_stru(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSTRUFormat format.

from_vasp_contcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_vasp_outcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPOutcarFormat format.

from_vasp_poscar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_vasp_string(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPStringFormat format.

from_vasp_xml(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPXMLFormat format.

from_xml(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPXMLFormat format.

from_xyz(file_name, **kwargs)

Read data from dpdata.plugins.xyz.XYZFormat format.

get_nframes()

Returns number of frames in all systems.

minimize(*args, minimizer, **kwargs)

Minimize geometry by a minimizer.

pick_atom_idx(idx[, nopbc])

Pick atom index.

predict(*args[, driver])

Predict energies and forces by a driver.

to(fmt, *args, **kwargs)

Dump systems to the specific format.

to_3dmol(*args, **kwargs)

Dump data to dpdata.plugins.3dmol.Py3DMolFormat format.

to_abacus_lcao_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_lcao_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_lcao_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_pw_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_pw_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_pw_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_stru(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSTRUFormat format.

to_amber_md(*args, **kwargs)

Dump data to dpdata.plugins.amber.AmberMDFormat format.

to_ase_structure(*args, **kwargs)

Dump data to dpdata.plugins.ase.ASEStructureFormat format.

to_ase_traj(*args, **kwargs)

Dump data to dpdata.plugins.ase.ASETrajFormat format.

to_atomconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_contcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_cp2k_aimd_output(*args, **kwargs)

Dump data to dpdata.plugins.cp2k.CP2KAIMDOutputFormat format.

to_cp2k_output(*args, **kwargs)

Dump data to dpdata.plugins.cp2k.CP2KOutputFormat format.

to_deepmd(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDRawFormat format.

to_deepmd_comp(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDCompFormat format.

to_deepmd_hdf5(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDHDF5Format format.

to_deepmd_npy(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDCompFormat format.

to_deepmd_npy_mixed(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDMixedFormat format.

to_deepmd_raw(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDRawFormat format.

to_dftbplus(*args, **kwargs)

Dump data to dpdata.plugins.dftbplus.DFTBplusFormat format.

to_dump(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSDumpFormat format.

to_fhi_aims_md(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiMDFormat format.

to_fhi_aims_output(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiMDFormat format.

to_fhi_aims_scf(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiSCFFormat format.

to_finalconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_gaussian_gjf(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussiaGJFFormat format.

to_gaussian_log(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussianLogFormat format.

to_gaussian_md(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussianMDFormat format.

to_gro(*args, **kwargs)

Dump data to dpdata.plugins.gromacs.GromacsGroFormat format.

to_gromacs_gro(*args, **kwargs)

Dump data to dpdata.plugins.gromacs.GromacsGroFormat format.

to_lammps_dump(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSDumpFormat format.

to_lammps_lmp(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSLmpFormat format.

to_list(*args, **kwargs)

Dump data to dpdata.plugins.list.ListFormat format.

to_lmp(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSLmpFormat format.

to_mlmd(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_mol(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.MolFormat format.

to_mol_file(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.MolFormat format.

to_movement(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_n2p2(*args, **kwargs)

Dump data to dpdata.plugins.n2p2.N2P2Format format.

to_openmx_md(*args, **kwargs)

Dump data to dpdata.plugins.openmx.OPENMXFormat format.

to_orca_spout(*args, **kwargs)

Dump data to dpdata.plugins.orca.ORCASPOutFormat format.

to_outcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPOutcarFormat format.

to_poscar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_psi4_inp(*args, **kwargs)

Dump data to dpdata.plugins.psi4.PSI4InputFormat format.

to_psi4_out(*args, **kwargs)

Dump data to dpdata.plugins.psi4.PSI4OutFormat format.

to_pwmat_atomconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_pwmat_finalconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_pwmat_mlmd(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pwmat_movement(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pwmat_output(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pymatgen_ComputedStructureEntry(*args, ...)

Dump data to dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

to_pymatgen_computedstructureentry(*args, ...)

Dump data to dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

to_pymatgen_molecule(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenMoleculeFormat format.

to_pymatgen_structure(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenStructureFormat format.

to_qe_cp_traj(*args, **kwargs)

Dump data to dpdata.plugins.qe.QECPTrajFormat format.

to_qe_pw_scf(*args, **kwargs)

Dump data to dpdata.plugins.qe.QECPPWSCFFormat format.

to_quip_gap_xyz(*args, **kwargs)

Dump data to dpdata.plugins.xyz.QuipGapXYZFormat format.

to_quip_gap_xyz_file(*args, **kwargs)

Dump data to dpdata.plugins.xyz.QuipGapXYZFormat format.

to_sdf(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.SdfFormat format.

to_sdf_file(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.SdfFormat format.

to_siesta_aimd_output(*args, **kwargs)

Dump data to dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

to_siesta_output(*args, **kwargs)

Dump data to dpdata.plugins.siesta.SiestaOutputFormat format.

to_sqm_in(*args, **kwargs)

Dump data to dpdata.plugins.amber.SQMINFormat format.

to_sqm_out(*args, **kwargs)

Dump data to dpdata.plugins.amber.SQMOutFormat format.

to_stru(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSTRUFormat format.

to_vasp_contcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_vasp_outcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPOutcarFormat format.

to_vasp_poscar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_vasp_string(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPStringFormat format.

to_vasp_xml(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPXMLFormat format.

to_xml(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPXMLFormat format.

to_xyz(*args, **kwargs)

Dump data to dpdata.plugins.xyz.XYZFormat format.

train_test_split(test_size[, seed])

Split systems into random train and test subsets.

from_dir

from_file

from_fmt_obj

load_systems_from_file

to_fmt_obj

append(*systems)[source]

Append systems or MultiSystems to systems.

Parameters:
*systemsSystem

The system to append

check_atom_names(system)[source]

Make atom_names in all systems equal, prevent inconsistent atom_types.

correction(hl_sys: MultiSystems)[source]

Get energy and force correction between self (assumed low-level) and a high-level MultiSystems. The self’s coordinates will be kept, but energy and forces will be replaced by the correction between these two systems.

Parameters:
hl_sysMultiSystems

high-level MultiSystems

Returns:
corrected_sysMultiSystems

Corrected MultiSystems

Notes

This method will not check whether coordinates and elements of two systems are the same. The user should make sure by itself.

Examples

Get correction between a low-level system and a high-level system:

>>> low_level = dpdata.MultiSystems().from_deepmd_hdf5("low_level.hdf5")
>>> high_level = dpdata.MultiSystems().from_deepmd_hdf5("high_level.hdf5")
>>> corr = low_level.correction(high_lebel)
>>> corr.to_deepmd_hdf5("corr.hdf5")
from_3dmol(file_name, **kwargs)

Read data from dpdata.plugins.3dmol.Py3DMolFormat format.

from_abacus_lcao_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_lcao_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_lcao_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_pw_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_pw_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_pw_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_stru(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSTRUFormat format.

from_amber_md(file_name, **kwargs)

Read data from dpdata.plugins.amber.AmberMDFormat format.

from_ase_structure(file_name, **kwargs)

Read data from dpdata.plugins.ase.ASEStructureFormat format.

from_ase_traj(file_name, **kwargs)

Read data from dpdata.plugins.ase.ASETrajFormat format.

from_atomconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_contcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_cp2k_aimd_output(file_name, **kwargs)

Read data from dpdata.plugins.cp2k.CP2KAIMDOutputFormat format.

from_cp2k_output(file_name, **kwargs)

Read data from dpdata.plugins.cp2k.CP2KOutputFormat format.

from_deepmd(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDRawFormat format.

from_deepmd_comp(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDCompFormat format.

from_deepmd_hdf5(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDHDF5Format format.

from_deepmd_npy(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDCompFormat format.

from_deepmd_npy_mixed(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDMixedFormat format.

from_deepmd_raw(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDRawFormat format.

from_dftbplus(file_name, **kwargs)

Read data from dpdata.plugins.dftbplus.DFTBplusFormat format.

classmethod from_dir(dir_name, file_name, fmt='auto', type_map=None)[source]
from_dump(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSDumpFormat format.

from_fhi_aims_md(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiMDFormat format.

from_fhi_aims_output(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiMDFormat format.

from_fhi_aims_scf(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiSCFFormat format.

classmethod from_file(file_name, fmt, **kwargs)[source]
from_finalconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_fmt_obj(fmtobj, directory, labeled=True, **kwargs)[source]
from_gaussian_gjf(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussiaGJFFormat format.

from_gaussian_log(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussianLogFormat format.

from_gaussian_md(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussianMDFormat format.

from_gro(file_name, **kwargs)

Read data from dpdata.plugins.gromacs.GromacsGroFormat format.

from_gromacs_gro(file_name, **kwargs)

Read data from dpdata.plugins.gromacs.GromacsGroFormat format.

from_lammps_dump(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSDumpFormat format.

from_lammps_lmp(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSLmpFormat format.

from_list(file_name, **kwargs)

Read data from dpdata.plugins.list.ListFormat format.

from_lmp(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSLmpFormat format.

from_mlmd(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_mol(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.MolFormat format.

from_mol_file(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.MolFormat format.

from_movement(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_n2p2(file_name, **kwargs)

Read data from dpdata.plugins.n2p2.N2P2Format format.

from_openmx_md(file_name, **kwargs)

Read data from dpdata.plugins.openmx.OPENMXFormat format.

from_orca_spout(file_name, **kwargs)

Read data from dpdata.plugins.orca.ORCASPOutFormat format.

from_outcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPOutcarFormat format.

from_poscar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_psi4_inp(file_name, **kwargs)

Read data from dpdata.plugins.psi4.PSI4InputFormat format.

from_psi4_out(file_name, **kwargs)

Read data from dpdata.plugins.psi4.PSI4OutFormat format.

from_pwmat_atomconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_pwmat_finalconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_pwmat_mlmd(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pwmat_movement(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pwmat_output(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pymatgen_computedstructureentry(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

from_pymatgen_molecule(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenMoleculeFormat format.

from_pymatgen_structure(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenStructureFormat format.

from_qe_cp_traj(file_name, **kwargs)

Read data from dpdata.plugins.qe.QECPTrajFormat format.

from_qe_pw_scf(file_name, **kwargs)

Read data from dpdata.plugins.qe.QECPPWSCFFormat format.

from_quip_gap_xyz(file_name, **kwargs)

Read data from dpdata.plugins.xyz.QuipGapXYZFormat format.

from_quip_gap_xyz_file(file_name, **kwargs)

Read data from dpdata.plugins.xyz.QuipGapXYZFormat format.

from_sdf(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.SdfFormat format.

from_sdf_file(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.SdfFormat format.

from_siesta_aiMD_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

from_siesta_aimd_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

from_siesta_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaOutputFormat format.

from_sqm_in(file_name, **kwargs)

Read data from dpdata.plugins.amber.SQMINFormat format.

from_sqm_out(file_name, **kwargs)

Read data from dpdata.plugins.amber.SQMOutFormat format.

from_stru(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSTRUFormat format.

from_vasp_contcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_vasp_outcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPOutcarFormat format.

from_vasp_poscar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_vasp_string(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPStringFormat format.

from_vasp_xml(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPXMLFormat format.

from_xml(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPXMLFormat format.

from_xyz(file_name, **kwargs)

Read data from dpdata.plugins.xyz.XYZFormat format.

get_nframes()[source]

Returns number of frames in all systems.

load_systems_from_file(file_name=None, fmt=None, **kwargs)[source]
minimize(*args: Any, minimizer: str | Minimizer, **kwargs: Any) MultiSystems[source]

Minimize geometry by a minimizer.

Parameters:
*argsiterable

Arguments passing to the minimizer

minimizerstr or Minimizer

The assigned minimizer

**kwargsdict

Other arguments passing to the minimizer

Returns:
MultiSystems

A new labeled MultiSystems.

Examples

Minimize a system using ASE BFGS along with a DP driver:

>>> from dpdata.driver import Driver
>>> from ase.optimize import BFGS
>>> driver = Driver.get_driver("dp")("some_model.pb")
>>> some_system.minimize(minimizer="ase", driver=driver, optimizer=BFGS, fmax=1e-5)
pick_atom_idx(idx, nopbc=None)[source]

Pick atom index.

Parameters:
idxint or list or slice

atom index

nopbcBoolen (default: None)

If nopbc is True or False, set nopbc

Returns:
new_sys: MultiSystems

new system

predict(*args: Any, driver='dp', **kwargs: Any) MultiSystems[source]

Predict energies and forces by a driver.

Parameters:
*argsiterable

Arguments passing to the driver

driverstr, default=dp

The assigned driver. For compatibility, default is dp

**kwargsdict

Other arguments passing to the driver

Returns:
MultiSystems

A new labeled MultiSystems.

to(fmt: str, *args, **kwargs) MultiSystems[source]

Dump systems to the specific format.

Parameters:
fmtstr

format

*argslist

arguments

**kwargsdict

keyword arguments

Returns:
MultiSystems

self

to_3dmol(*args, **kwargs)

Dump data to dpdata.plugins.3dmol.Py3DMolFormat format.

to_abacus_lcao_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_lcao_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_lcao_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_pw_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_pw_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_pw_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_stru(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSTRUFormat format.

to_amber_md(*args, **kwargs)

Dump data to dpdata.plugins.amber.AmberMDFormat format.

to_ase_structure(*args, **kwargs)

Dump data to dpdata.plugins.ase.ASEStructureFormat format.

to_ase_traj(*args, **kwargs)

Dump data to dpdata.plugins.ase.ASETrajFormat format.

to_atomconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_contcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_cp2k_aimd_output(*args, **kwargs)

Dump data to dpdata.plugins.cp2k.CP2KAIMDOutputFormat format.

to_cp2k_output(*args, **kwargs)

Dump data to dpdata.plugins.cp2k.CP2KOutputFormat format.

to_deepmd(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDRawFormat format.

to_deepmd_comp(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDCompFormat format.

to_deepmd_hdf5(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDHDF5Format format.

to_deepmd_npy(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDCompFormat format.

to_deepmd_npy_mixed(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDMixedFormat format.

to_deepmd_raw(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDRawFormat format.

to_dftbplus(*args, **kwargs)

Dump data to dpdata.plugins.dftbplus.DFTBplusFormat format.

to_dump(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSDumpFormat format.

to_fhi_aims_md(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiMDFormat format.

to_fhi_aims_output(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiMDFormat format.

to_fhi_aims_scf(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiSCFFormat format.

to_finalconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_fmt_obj(fmtobj, directory, *args, **kwargs)[source]
to_gaussian_gjf(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussiaGJFFormat format.

to_gaussian_log(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussianLogFormat format.

to_gaussian_md(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussianMDFormat format.

to_gro(*args, **kwargs)

Dump data to dpdata.plugins.gromacs.GromacsGroFormat format.

to_gromacs_gro(*args, **kwargs)

Dump data to dpdata.plugins.gromacs.GromacsGroFormat format.

to_lammps_dump(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSDumpFormat format.

to_lammps_lmp(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSLmpFormat format.

to_list(*args, **kwargs)

Dump data to dpdata.plugins.list.ListFormat format.

to_lmp(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSLmpFormat format.

to_mlmd(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_mol(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.MolFormat format.

to_mol_file(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.MolFormat format.

to_movement(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_n2p2(*args, **kwargs)

Dump data to dpdata.plugins.n2p2.N2P2Format format.

to_openmx_md(*args, **kwargs)

Dump data to dpdata.plugins.openmx.OPENMXFormat format.

to_orca_spout(*args, **kwargs)

Dump data to dpdata.plugins.orca.ORCASPOutFormat format.

to_outcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPOutcarFormat format.

to_poscar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_psi4_inp(*args, **kwargs)

Dump data to dpdata.plugins.psi4.PSI4InputFormat format.

to_psi4_out(*args, **kwargs)

Dump data to dpdata.plugins.psi4.PSI4OutFormat format.

to_pwmat_atomconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_pwmat_finalconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_pwmat_mlmd(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pwmat_movement(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pwmat_output(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pymatgen_ComputedStructureEntry(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

to_pymatgen_computedstructureentry(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

to_pymatgen_molecule(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenMoleculeFormat format.

to_pymatgen_structure(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenStructureFormat format.

to_qe_cp_traj(*args, **kwargs)

Dump data to dpdata.plugins.qe.QECPTrajFormat format.

to_qe_pw_scf(*args, **kwargs)

Dump data to dpdata.plugins.qe.QECPPWSCFFormat format.

to_quip_gap_xyz(*args, **kwargs)

Dump data to dpdata.plugins.xyz.QuipGapXYZFormat format.

to_quip_gap_xyz_file(*args, **kwargs)

Dump data to dpdata.plugins.xyz.QuipGapXYZFormat format.

to_sdf(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.SdfFormat format.

to_sdf_file(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.SdfFormat format.

to_siesta_aimd_output(*args, **kwargs)

Dump data to dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

to_siesta_output(*args, **kwargs)

Dump data to dpdata.plugins.siesta.SiestaOutputFormat format.

to_sqm_in(*args, **kwargs)

Dump data to dpdata.plugins.amber.SQMINFormat format.

to_sqm_out(*args, **kwargs)

Dump data to dpdata.plugins.amber.SQMOutFormat format.

to_stru(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSTRUFormat format.

to_vasp_contcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_vasp_outcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPOutcarFormat format.

to_vasp_poscar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_vasp_string(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPStringFormat format.

to_vasp_xml(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPXMLFormat format.

to_xml(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPXMLFormat format.

to_xyz(*args, **kwargs)

Dump data to dpdata.plugins.xyz.XYZFormat format.

train_test_split(test_size: float | int, seed: int | None = None) Tuple[MultiSystems, MultiSystems, Dict[str, ndarray]][source]

Split systems into random train and test subsets.

Parameters:
test_sizefloat or int

If float, should be between 0.0 and 1.0 and represent the proportion of the dataset to include in the test split. If int, represents the absolute number of test samples.

seedint, default=None

Random seed

Returns:
MultiSystems

The training set

MultiSystems

The testing set

Dict[str, np.ndarray]

The bool array of training and testing sets for each system. False for training set and True for testing set.

class dpdata.System(file_name=None, fmt='auto', type_map=None, begin=0, step=1, data=None, convergence_check=True, **kwargs)[source]

Bases: MSONable

The data System.

A data System (a concept used by deepmd-kit) contains frames (e.g. produced by an MD simulation) that has the same number of atoms of the same type. The order of the atoms should be consistent among the frames in one System.

For example, a water system named d_example has two molecules. The properties can be accessed by
  • d_example[‘atom_numbs’] : [2, 4]

  • d_example[‘atom_names’] : [‘O’, ‘H’]

  • d_example[‘atom_types’] : [0, 1, 1, 0, 1, 1]

  • d_example[‘orig’] : [0, 0, 0]

  • d_example[‘cells’] : a numpy array of size nframes x 3 x 3

  • d_example[‘coords’] : a numpy array of size nframes x natoms x 3

It is noted that
  • The order of frames stored in ‘atom_types’, ‘cells’ and ‘coords’ should be consistent.

  • The order of atoms in all frames of ‘atom_types’ and ‘coords’ should be consistent.

Restrictions:
  • d_example[‘orig’] is always [0, 0, 0]

  • d_example[‘cells’][ii] is always lower triangular (lammps cell tensor convention)

Attributes:
DTYPEStuple[DataType]

data types of this class

Methods

add_atom_names(atom_names)

Add atom_names that do not exist.

append(system)

Append a system to this system.

apply_pbc()

Append periodic boundary condition.

as_dict()

Returns data dict of System instance.

check_data()

Check if data is correct.

check_type_map(type_map)

Assign atom_names to type_map if type_map is given and different from atom_names.

convert_to_mixed_type([type_map])

Convert the data dict to mixed type format structure, in order to append systems with different formula but the same number of atoms.

copy()

Returns a copy of the system.

dump(filename[, indent])

Dump .json or .yaml file.

extend(systems)

Extend a system list to this system.

from_3dmol(file_name, **kwargs)

Read data from dpdata.plugins.3dmol.Py3DMolFormat format.

from_abacus_lcao_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_lcao_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_lcao_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_pw_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_pw_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_pw_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_stru(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSTRUFormat format.

from_amber_md(file_name, **kwargs)

Read data from dpdata.plugins.amber.AmberMDFormat format.

from_ase_structure(file_name, **kwargs)

Read data from dpdata.plugins.ase.ASEStructureFormat format.

from_ase_traj(file_name, **kwargs)

Read data from dpdata.plugins.ase.ASETrajFormat format.

from_atomconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_contcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_cp2k_aimd_output(file_name, **kwargs)

Read data from dpdata.plugins.cp2k.CP2KAIMDOutputFormat format.

from_cp2k_output(file_name, **kwargs)

Read data from dpdata.plugins.cp2k.CP2KOutputFormat format.

from_deepmd(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDRawFormat format.

from_deepmd_comp(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDCompFormat format.

from_deepmd_hdf5(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDHDF5Format format.

from_deepmd_npy(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDCompFormat format.

from_deepmd_npy_mixed(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDMixedFormat format.

from_deepmd_raw(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDRawFormat format.

from_dftbplus(file_name, **kwargs)

Read data from dpdata.plugins.dftbplus.DFTBplusFormat format.

from_dict(d)

param d:

Dict representation.

from_dump(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSDumpFormat format.

from_fhi_aims_md(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiMDFormat format.

from_fhi_aims_output(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiMDFormat format.

from_fhi_aims_scf(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiSCFFormat format.

from_finalconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_gaussian_gjf(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussiaGJFFormat format.

from_gaussian_log(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussianLogFormat format.

from_gaussian_md(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussianMDFormat format.

from_gro(file_name, **kwargs)

Read data from dpdata.plugins.gromacs.GromacsGroFormat format.

from_gromacs_gro(file_name, **kwargs)

Read data from dpdata.plugins.gromacs.GromacsGroFormat format.

from_lammps_dump(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSDumpFormat format.

from_lammps_lmp(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSLmpFormat format.

from_list(file_name, **kwargs)

Read data from dpdata.plugins.list.ListFormat format.

from_lmp(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSLmpFormat format.

from_mlmd(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_mol(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.MolFormat format.

from_mol_file(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.MolFormat format.

from_movement(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_n2p2(file_name, **kwargs)

Read data from dpdata.plugins.n2p2.N2P2Format format.

from_openmx_md(file_name, **kwargs)

Read data from dpdata.plugins.openmx.OPENMXFormat format.

from_orca_spout(file_name, **kwargs)

Read data from dpdata.plugins.orca.ORCASPOutFormat format.

from_outcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPOutcarFormat format.

from_poscar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_psi4_inp(file_name, **kwargs)

Read data from dpdata.plugins.psi4.PSI4InputFormat format.

from_psi4_out(file_name, **kwargs)

Read data from dpdata.plugins.psi4.PSI4OutFormat format.

from_pwmat_atomconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_pwmat_finalconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_pwmat_mlmd(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pwmat_movement(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pwmat_output(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pymatgen_computedstructureentry(...)

Read data from dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

from_pymatgen_molecule(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenMoleculeFormat format.

from_pymatgen_structure(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenStructureFormat format.

from_qe_cp_traj(file_name, **kwargs)

Read data from dpdata.plugins.qe.QECPTrajFormat format.

from_qe_pw_scf(file_name, **kwargs)

Read data from dpdata.plugins.qe.QECPPWSCFFormat format.

from_quip_gap_xyz(file_name, **kwargs)

Read data from dpdata.plugins.xyz.QuipGapXYZFormat format.

from_quip_gap_xyz_file(file_name, **kwargs)

Read data from dpdata.plugins.xyz.QuipGapXYZFormat format.

from_sdf(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.SdfFormat format.

from_sdf_file(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.SdfFormat format.

from_siesta_aiMD_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

from_siesta_aimd_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

from_siesta_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaOutputFormat format.

from_sqm_in(file_name, **kwargs)

Read data from dpdata.plugins.amber.SQMINFormat format.

from_sqm_out(file_name, **kwargs)

Read data from dpdata.plugins.amber.SQMOutFormat format.

from_stru(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSTRUFormat format.

from_vasp_contcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_vasp_outcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPOutcarFormat format.

from_vasp_poscar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_vasp_string(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPStringFormat format.

from_vasp_xml(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPXMLFormat format.

from_xml(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPXMLFormat format.

from_xyz(file_name, **kwargs)

Read data from dpdata.plugins.xyz.XYZFormat format.

get_atom_names()

Returns name of atoms.

get_atom_numbs()

Returns number of atoms.

get_atom_types()

Returns type of atoms.

get_natoms()

Returns total number of atoms in the system.

get_nframes()

Returns number of frames in the system.

get_ntypes()

Returns total number of atom types in the system.

load(filename)

Rebuild System obj.

map_atom_types([type_map])

Map the atom types of the system.

minimize(*args, minimizer, **kwargs)

Minimize the geometry.

perturb(pert_num, cell_pert_fraction, ...[, ...])

Perturb each frame in the system randomly.

pick_atom_idx(idx[, nopbc])

Pick atom index.

pick_by_amber_mask(param, maskstr[, ...])

Pick atoms by amber mask.

predict(*args[, driver])

Predict energies and forces by a driver.

register_data_type(*data_type)

Register data type.

remove_atom_names(atom_names)

Remove atom names and all such atoms.

remove_pbc([protect_layer])

This method does NOT delete the definition of the cells, it (1) revises the cell to a cubic cell and ensures that the cell boundary to any atom in the system is no less than protect_layer (2) translates the system such that the center-of-geometry of the system locates at the center of the cell.

replicate(ncopy)

Replicate the each frame in the system in 3 dimensions.

shuffle()

Shuffle frames randomly.

sort_atom_names([type_map])

Sort atom_names of the system and reorder atom_numbs and atom_types accoarding to atom_names.

sort_atom_types()

Sort atom types.

sub_system(f_idx)

Construct a subsystem from the system.

to(fmt, *args, **kwargs)

Dump systems to the specific format.

to_3dmol(*args, **kwargs)

Dump data to dpdata.plugins.3dmol.Py3DMolFormat format.

to_abacus_lcao_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_lcao_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_lcao_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_pw_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_pw_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_pw_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_stru(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSTRUFormat format.

to_amber_md(*args, **kwargs)

Dump data to dpdata.plugins.amber.AmberMDFormat format.

to_ase_structure(*args, **kwargs)

Dump data to dpdata.plugins.ase.ASEStructureFormat format.

to_ase_traj(*args, **kwargs)

Dump data to dpdata.plugins.ase.ASETrajFormat format.

to_atomconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_contcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_cp2k_aimd_output(*args, **kwargs)

Dump data to dpdata.plugins.cp2k.CP2KAIMDOutputFormat format.

to_cp2k_output(*args, **kwargs)

Dump data to dpdata.plugins.cp2k.CP2KOutputFormat format.

to_deepmd(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDRawFormat format.

to_deepmd_comp(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDCompFormat format.

to_deepmd_hdf5(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDHDF5Format format.

to_deepmd_npy(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDCompFormat format.

to_deepmd_npy_mixed(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDMixedFormat format.

to_deepmd_raw(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDRawFormat format.

to_dftbplus(*args, **kwargs)

Dump data to dpdata.plugins.dftbplus.DFTBplusFormat format.

to_dump(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSDumpFormat format.

to_fhi_aims_md(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiMDFormat format.

to_fhi_aims_output(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiMDFormat format.

to_fhi_aims_scf(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiSCFFormat format.

to_finalconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_gaussian_gjf(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussiaGJFFormat format.

to_gaussian_log(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussianLogFormat format.

to_gaussian_md(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussianMDFormat format.

to_gro(*args, **kwargs)

Dump data to dpdata.plugins.gromacs.GromacsGroFormat format.

to_gromacs_gro(*args, **kwargs)

Dump data to dpdata.plugins.gromacs.GromacsGroFormat format.

to_json()

Returns a json string representation of the MSONable object.

to_lammps_dump(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSDumpFormat format.

to_lammps_lmp(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSLmpFormat format.

to_list(*args, **kwargs)

Dump data to dpdata.plugins.list.ListFormat format.

to_lmp(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSLmpFormat format.

to_mlmd(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_mol(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.MolFormat format.

to_mol_file(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.MolFormat format.

to_movement(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_n2p2(*args, **kwargs)

Dump data to dpdata.plugins.n2p2.N2P2Format format.

to_openmx_md(*args, **kwargs)

Dump data to dpdata.plugins.openmx.OPENMXFormat format.

to_orca_spout(*args, **kwargs)

Dump data to dpdata.plugins.orca.ORCASPOutFormat format.

to_outcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPOutcarFormat format.

to_poscar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_psi4_inp(*args, **kwargs)

Dump data to dpdata.plugins.psi4.PSI4InputFormat format.

to_psi4_out(*args, **kwargs)

Dump data to dpdata.plugins.psi4.PSI4OutFormat format.

to_pwmat_atomconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_pwmat_finalconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_pwmat_mlmd(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pwmat_movement(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pwmat_output(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pymatgen_ComputedStructureEntry(*args, ...)

Dump data to dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

to_pymatgen_computedstructureentry(*args, ...)

Dump data to dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

to_pymatgen_molecule(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenMoleculeFormat format.

to_pymatgen_structure(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenStructureFormat format.

to_qe_cp_traj(*args, **kwargs)

Dump data to dpdata.plugins.qe.QECPTrajFormat format.

to_qe_pw_scf(*args, **kwargs)

Dump data to dpdata.plugins.qe.QECPPWSCFFormat format.

to_quip_gap_xyz(*args, **kwargs)

Dump data to dpdata.plugins.xyz.QuipGapXYZFormat format.

to_quip_gap_xyz_file(*args, **kwargs)

Dump data to dpdata.plugins.xyz.QuipGapXYZFormat format.

to_sdf(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.SdfFormat format.

to_sdf_file(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.SdfFormat format.

to_siesta_aimd_output(*args, **kwargs)

Dump data to dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

to_siesta_output(*args, **kwargs)

Dump data to dpdata.plugins.siesta.SiestaOutputFormat format.

to_sqm_in(*args, **kwargs)

Dump data to dpdata.plugins.amber.SQMINFormat format.

to_sqm_out(*args, **kwargs)

Dump data to dpdata.plugins.amber.SQMOutFormat format.

to_stru(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSTRUFormat format.

to_vasp_contcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_vasp_outcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPOutcarFormat format.

to_vasp_poscar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_vasp_string(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPStringFormat format.

to_vasp_xml(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPXMLFormat format.

to_xml(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPXMLFormat format.

to_xyz(*args, **kwargs)

Dump data to dpdata.plugins.xyz.XYZFormat format.

unsafe_hash()

Returns an hash of the current object.

validate_monty_v1(_MSONable__input_value)

Pydantic validator with correct signature for pydantic v1.x

validate_monty_v2(_MSONable__input_value, _)

Pydantic validator with correct signature for pydantic v2.x

affine_map

apply_type_map

from_fmt

from_fmt_obj

replace

rot_frame_lower_triangular

rot_lower_triangular

to_fmt_obj

DTYPES = (<dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>)
add_atom_names(atom_names)[source]

Add atom_names that do not exist.

affine_map(trans, f_idx=0)[source]
append(system)[source]

Append a system to this system.

Parameters:
systemSystem

The system to append

apply_pbc()[source]

Append periodic boundary condition.

apply_type_map(type_map)[source]
as_dict()[source]

Returns data dict of System instance.

check_data()[source]

Check if data is correct.

Raises:
DataError

if data is not correct

check_type_map(type_map)[source]

Assign atom_names to type_map if type_map is given and different from atom_names.

Parameters:
type_maplist

type_map

convert_to_mixed_type(type_map=None)[source]

Convert the data dict to mixed type format structure, in order to append systems with different formula but the same number of atoms. Change the ‘atom_names’ to one placeholder type ‘MIXED_TOKEN’ and add ‘real_atom_types’ to store the real type vectors according to the given type_map.

Parameters:
type_maplist

type_map

copy()[source]

Returns a copy of the system.

dump(filename, indent=4)[source]

Dump .json or .yaml file.

extend(systems)[source]

Extend a system list to this system.

Parameters:
systems[System1, System2, System3 ]

The list to extend

property formula

Return the formula of this system, like C3H5O2.

property formula_hash: str

Return the hash of the formula of this system.

from_3dmol(file_name, **kwargs)

Read data from dpdata.plugins.3dmol.Py3DMolFormat format.

from_abacus_lcao_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_lcao_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_lcao_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_pw_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_pw_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_pw_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_stru(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSTRUFormat format.

from_amber_md(file_name, **kwargs)

Read data from dpdata.plugins.amber.AmberMDFormat format.

from_ase_structure(file_name, **kwargs)

Read data from dpdata.plugins.ase.ASEStructureFormat format.

from_ase_traj(file_name, **kwargs)

Read data from dpdata.plugins.ase.ASETrajFormat format.

from_atomconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_contcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_cp2k_aimd_output(file_name, **kwargs)

Read data from dpdata.plugins.cp2k.CP2KAIMDOutputFormat format.

from_cp2k_output(file_name, **kwargs)

Read data from dpdata.plugins.cp2k.CP2KOutputFormat format.

from_deepmd(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDRawFormat format.

from_deepmd_comp(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDCompFormat format.

from_deepmd_hdf5(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDHDF5Format format.

from_deepmd_npy(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDCompFormat format.

from_deepmd_npy_mixed(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDMixedFormat format.

from_deepmd_raw(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDRawFormat format.

from_dftbplus(file_name, **kwargs)

Read data from dpdata.plugins.dftbplus.DFTBplusFormat format.

from_dump(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSDumpFormat format.

from_fhi_aims_md(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiMDFormat format.

from_fhi_aims_output(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiMDFormat format.

from_fhi_aims_scf(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiSCFFormat format.

from_finalconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_fmt(file_name, fmt='auto', **kwargs)[source]
from_fmt_obj(fmtobj, file_name, **kwargs)[source]
from_gaussian_gjf(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussiaGJFFormat format.

from_gaussian_log(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussianLogFormat format.

from_gaussian_md(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussianMDFormat format.

from_gro(file_name, **kwargs)

Read data from dpdata.plugins.gromacs.GromacsGroFormat format.

from_gromacs_gro(file_name, **kwargs)

Read data from dpdata.plugins.gromacs.GromacsGroFormat format.

from_lammps_dump(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSDumpFormat format.

from_lammps_lmp(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSLmpFormat format.

from_list(file_name, **kwargs)

Read data from dpdata.plugins.list.ListFormat format.

from_lmp(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSLmpFormat format.

from_mlmd(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_mol(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.MolFormat format.

from_mol_file(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.MolFormat format.

from_movement(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_n2p2(file_name, **kwargs)

Read data from dpdata.plugins.n2p2.N2P2Format format.

from_openmx_md(file_name, **kwargs)

Read data from dpdata.plugins.openmx.OPENMXFormat format.

from_orca_spout(file_name, **kwargs)

Read data from dpdata.plugins.orca.ORCASPOutFormat format.

from_outcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPOutcarFormat format.

from_poscar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_psi4_inp(file_name, **kwargs)

Read data from dpdata.plugins.psi4.PSI4InputFormat format.

from_psi4_out(file_name, **kwargs)

Read data from dpdata.plugins.psi4.PSI4OutFormat format.

from_pwmat_atomconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_pwmat_finalconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_pwmat_mlmd(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pwmat_movement(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pwmat_output(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pymatgen_computedstructureentry(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

from_pymatgen_molecule(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenMoleculeFormat format.

from_pymatgen_structure(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenStructureFormat format.

from_qe_cp_traj(file_name, **kwargs)

Read data from dpdata.plugins.qe.QECPTrajFormat format.

from_qe_pw_scf(file_name, **kwargs)

Read data from dpdata.plugins.qe.QECPPWSCFFormat format.

from_quip_gap_xyz(file_name, **kwargs)

Read data from dpdata.plugins.xyz.QuipGapXYZFormat format.

from_quip_gap_xyz_file(file_name, **kwargs)

Read data from dpdata.plugins.xyz.QuipGapXYZFormat format.

from_sdf(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.SdfFormat format.

from_sdf_file(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.SdfFormat format.

from_siesta_aiMD_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

from_siesta_aimd_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

from_siesta_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaOutputFormat format.

from_sqm_in(file_name, **kwargs)

Read data from dpdata.plugins.amber.SQMINFormat format.

from_sqm_out(file_name, **kwargs)

Read data from dpdata.plugins.amber.SQMOutFormat format.

from_stru(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSTRUFormat format.

from_vasp_contcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_vasp_outcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPOutcarFormat format.

from_vasp_poscar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_vasp_string(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPStringFormat format.

from_vasp_xml(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPXMLFormat format.

from_xml(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPXMLFormat format.

from_xyz(file_name, **kwargs)

Read data from dpdata.plugins.xyz.XYZFormat format.

get_atom_names()[source]

Returns name of atoms.

get_atom_numbs()[source]

Returns number of atoms.

get_atom_types()[source]

Returns type of atoms.

get_natoms()[source]

Returns total number of atoms in the system.

get_nframes()[source]

Returns number of frames in the system.

get_ntypes() int[source]

Returns total number of atom types in the system.

static load(filename)[source]

Rebuild System obj. from .json or .yaml file.

map_atom_types(type_map=None) ndarray[source]

Map the atom types of the system.

Parameters:
type_map

dict : {“H”:0,”O”:1} or list [“H”,”C”,”O”,”N”] The map between elements and index if no map_dict is given, index will be set according to atomic number

Returns:
new_atom_typesnp.ndarray

The mapped atom types

minimize(*args: Any, minimizer: str | Minimizer, **kwargs: Any) LabeledSystem[source]

Minimize the geometry.

Parameters:
*argsiterable

Arguments passing to the minimizer

minimizerstr or Minimizer

The assigned minimizer

**kwargsdict

Other arguments passing to the minimizer

Returns:
labeled_sysLabeledSystem

A new labeled system.

property nopbc
perturb(pert_num, cell_pert_fraction, atom_pert_distance, atom_pert_style='normal')[source]

Perturb each frame in the system randomly. The cell will be deformed randomly, and atoms will be displaced by a random distance in random direction.

Parameters:
pert_numint

Each frame in the system will make pert_num copies, and all the copies will be perturbed. That means the system to be returned will contain pert_num * frame_num of the input system.

cell_pert_fractionfloat

A fraction determines how much (relatively) will cell deform. The cell of each frame is deformed by a symmetric matrix perturbed from identity. The perturbation to the diagonal part is subject to a uniform distribution in [-cell_pert_fraction, cell_pert_fraction), and the perturbation to the off-diagonal part is subject to a uniform distribution in [-0.5*cell_pert_fraction, 0.5*cell_pert_fraction).

atom_pert_distancefloat

unit: Angstrom. A distance determines how far atoms will move. Atoms will move about atom_pert_distance in random direction. The distribution of the distance atoms move is determined by atom_pert_style

atom_pert_stylestr

Determines the distribution of the distance atoms move is subject to. Avaliable options are

  • ‘normal’: the distance will be object to chi-square distribution with 3 degrees of freedom after normalization.

    The mean value of the distance is atom_pert_fraction*side_length

  • ‘uniform’: will generate uniformly random points in a 3D-balls with radius as atom_pert_distance.

    These points are treated as vector used by atoms to move. Obviously, the max length of the distance atoms move is atom_pert_distance.

  • ‘const’: The distance atoms move will be a constant atom_pert_distance.

Returns:
perturbed_systemSystem

The perturbed_system. It contains pert_num * frame_num of the input system frames.

pick_atom_idx(idx, nopbc=None)[source]

Pick atom index.

Parameters:
idxint or list or slice

atom index

nopbcBoolen (default: None)

If nopbc is True or False, set nopbc

Returns:
new_sys: System

new system

pick_by_amber_mask(param, maskstr, pass_coords=False, nopbc=None)[source]

Pick atoms by amber mask.

Parameters:
paramstr or parmed.Structure

filename of Amber param file or parmed.Structure

maskstrstr

Amber masks

pass_coordsBoolen (default: False)

If pass_coords is true, the function will pass coordinates and return a MultiSystem. Otherwise, the result is coordinate-independent, and the function will return System or LabeledSystem.

nopbcBoolen (default: None)

If nopbc is True or False, set nopbc

post_funcs = <dpdata.plugin.Plugin object>
predict(*args: Any, driver: str = 'dp', **kwargs: Any) LabeledSystem[source]

Predict energies and forces by a driver.

Parameters:
*argsiterable

Arguments passing to the driver

driverstr, default=dp

The assigned driver. For compatibility, default is dp

**kwargsdict

Other arguments passing to the driver

Returns:
labeled_sysLabeledSystem

A new labeled system.

Examples

The default driver is DP:

>>> labeled_sys = ori_sys.predict("frozen_model_compressed.pb")
classmethod register_data_type(*data_type: Tuple[DataType])[source]

Register data type.

Parameters:
*data_typetuple[DataType]

data type to be regiestered

remove_atom_names(atom_names)[source]

Remove atom names and all such atoms. For example, you may not remove EP atoms in TIP4P/Ew water, which is not a real atom.

remove_pbc(protect_layer=9)[source]

This method does NOT delete the definition of the cells, it (1) revises the cell to a cubic cell and ensures that the cell boundary to any atom in the system is no less than protect_layer (2) translates the system such that the center-of-geometry of the system locates at the center of the cell.

Parameters:
protect_layerthe protect layer between the atoms and the cell

boundary

replace(initial_atom_type, end_atom_type, replace_num)[source]
replicate(ncopy)[source]

Replicate the each frame in the system in 3 dimensions. Each frame in the system will become a supercell.

Parameters:
ncopy

list: [4,2,3] or tuple: (4,2,3,) make ncopy[0] copys in x dimensions, make ncopy[1] copys in y dimensions, make ncopy[2] copys in z dimensions.

Returns:
tmpSystem

The system after replication.

rot_frame_lower_triangular(f_idx=0)[source]
rot_lower_triangular()[source]
property short_formula: str

Return the short formula of this system. Elements with zero number will be removed.

property short_name: str

Return the short name of this system (no more than 255 bytes), in the following order:

  • formula

  • short_formula

  • formula_hash.

shuffle()[source]

Shuffle frames randomly.

sort_atom_names(type_map=None)[source]

Sort atom_names of the system and reorder atom_numbs and atom_types accoarding to atom_names. If type_map is not given, atom_names will be sorted by alphabetical order. If type_map is given, atom_names will be type_map.

Parameters:
type_maplist

type_map

sort_atom_types() ndarray[source]

Sort atom types.

Returns:
idxnp.ndarray

new atom index in the Axis.NATOMS

sub_system(f_idx)[source]

Construct a subsystem from the system.

Parameters:
f_idxint or index

Which frame to use in the subsystem

Returns:
sub_systemSystem

The subsystem

to(fmt: str, *args, **kwargs) System[source]

Dump systems to the specific format.

Parameters:
fmtstr

format

*args

arguments

**kwargs

keyword arguments

Returns:
System

self

to_3dmol(*args, **kwargs)

Dump data to dpdata.plugins.3dmol.Py3DMolFormat format.

to_abacus_lcao_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_lcao_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_lcao_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_pw_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_pw_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_pw_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_stru(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSTRUFormat format.

to_amber_md(*args, **kwargs)

Dump data to dpdata.plugins.amber.AmberMDFormat format.

to_ase_structure(*args, **kwargs)

Dump data to dpdata.plugins.ase.ASEStructureFormat format.

to_ase_traj(*args, **kwargs)

Dump data to dpdata.plugins.ase.ASETrajFormat format.

to_atomconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_contcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_cp2k_aimd_output(*args, **kwargs)

Dump data to dpdata.plugins.cp2k.CP2KAIMDOutputFormat format.

to_cp2k_output(*args, **kwargs)

Dump data to dpdata.plugins.cp2k.CP2KOutputFormat format.

to_deepmd(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDRawFormat format.

to_deepmd_comp(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDCompFormat format.

to_deepmd_hdf5(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDHDF5Format format.

to_deepmd_npy(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDCompFormat format.

to_deepmd_npy_mixed(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDMixedFormat format.

to_deepmd_raw(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDRawFormat format.

to_dftbplus(*args, **kwargs)

Dump data to dpdata.plugins.dftbplus.DFTBplusFormat format.

to_dump(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSDumpFormat format.

to_fhi_aims_md(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiMDFormat format.

to_fhi_aims_output(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiMDFormat format.

to_fhi_aims_scf(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiSCFFormat format.

to_finalconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_fmt_obj(fmtobj, *args, **kwargs)[source]
to_gaussian_gjf(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussiaGJFFormat format.

to_gaussian_log(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussianLogFormat format.

to_gaussian_md(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussianMDFormat format.

to_gro(*args, **kwargs)

Dump data to dpdata.plugins.gromacs.GromacsGroFormat format.

to_gromacs_gro(*args, **kwargs)

Dump data to dpdata.plugins.gromacs.GromacsGroFormat format.

to_lammps_dump(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSDumpFormat format.

to_lammps_lmp(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSLmpFormat format.

to_list(*args, **kwargs)

Dump data to dpdata.plugins.list.ListFormat format.

to_lmp(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSLmpFormat format.

to_mlmd(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_mol(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.MolFormat format.

to_mol_file(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.MolFormat format.

to_movement(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_n2p2(*args, **kwargs)

Dump data to dpdata.plugins.n2p2.N2P2Format format.

to_openmx_md(*args, **kwargs)

Dump data to dpdata.plugins.openmx.OPENMXFormat format.

to_orca_spout(*args, **kwargs)

Dump data to dpdata.plugins.orca.ORCASPOutFormat format.

to_outcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPOutcarFormat format.

to_poscar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_psi4_inp(*args, **kwargs)

Dump data to dpdata.plugins.psi4.PSI4InputFormat format.

to_psi4_out(*args, **kwargs)

Dump data to dpdata.plugins.psi4.PSI4OutFormat format.

to_pwmat_atomconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_pwmat_finalconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_pwmat_mlmd(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pwmat_movement(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pwmat_output(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pymatgen_ComputedStructureEntry(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

to_pymatgen_computedstructureentry(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

to_pymatgen_molecule(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenMoleculeFormat format.

to_pymatgen_structure(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenStructureFormat format.

to_qe_cp_traj(*args, **kwargs)

Dump data to dpdata.plugins.qe.QECPTrajFormat format.

to_qe_pw_scf(*args, **kwargs)

Dump data to dpdata.plugins.qe.QECPPWSCFFormat format.

to_quip_gap_xyz(*args, **kwargs)

Dump data to dpdata.plugins.xyz.QuipGapXYZFormat format.

to_quip_gap_xyz_file(*args, **kwargs)

Dump data to dpdata.plugins.xyz.QuipGapXYZFormat format.

to_sdf(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.SdfFormat format.

to_sdf_file(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.SdfFormat format.

to_siesta_aimd_output(*args, **kwargs)

Dump data to dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

to_siesta_output(*args, **kwargs)

Dump data to dpdata.plugins.siesta.SiestaOutputFormat format.

to_sqm_in(*args, **kwargs)

Dump data to dpdata.plugins.amber.SQMINFormat format.

to_sqm_out(*args, **kwargs)

Dump data to dpdata.plugins.amber.SQMOutFormat format.

to_stru(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSTRUFormat format.

to_vasp_contcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_vasp_outcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPOutcarFormat format.

to_vasp_poscar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_vasp_string(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPStringFormat format.

to_vasp_xml(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPXMLFormat format.

to_xml(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPXMLFormat format.

to_xyz(*args, **kwargs)

Dump data to dpdata.plugins.xyz.XYZFormat format.

property uniq_formula

Return the uniq_formula of this system. The uniq_formula sort the elements in formula by names. Systems with the same uniq_formula can be append together.

Subpackages

dpdata.abacus package
Submodules
dpdata.abacus.md module
dpdata.abacus.md.get_coord_dump_freq(inlines)[source]
dpdata.abacus.md.get_coords_from_dump(dumplines, natoms)[source]
dpdata.abacus.md.get_energy(outlines, ndump, dump_freq)[source]
dpdata.abacus.md.get_frame(fname)[source]
dpdata.abacus.md.get_path_out(fname, inlines)[source]
dpdata.abacus.relax module
dpdata.abacus.relax.get_coords_from_log(loglines, natoms)[source]

NOTICE: unit of coords and cells is Angstrom order:

coordinate cell (no output if cell is not changed) energy (no output, if SCF is not converged) force (no output, if cal_force is not setted or abnormal ending) stress (no output, if set cal_stress is not setted or abnormal ending).

dpdata.abacus.relax.get_frame(fname)[source]
dpdata.abacus.relax.get_log_file(fname, inlines)[source]
dpdata.abacus.scf module
dpdata.abacus.scf.CheckFile(ifile)[source]
dpdata.abacus.scf.collect_force(outlines)[source]
dpdata.abacus.scf.collect_stress(outlines)[source]
dpdata.abacus.scf.get_block(lines, keyword, skip=0, nlines=None)[source]
dpdata.abacus.scf.get_cell(geometry_inlines)[source]
dpdata.abacus.scf.get_coords(celldm, cell, geometry_inlines, inlines=None)[source]
dpdata.abacus.scf.get_energy(outlines)[source]
dpdata.abacus.scf.get_force(outlines, natoms)[source]
dpdata.abacus.scf.get_frame(fname)[source]
dpdata.abacus.scf.get_frame_from_stru(fname)[source]
dpdata.abacus.scf.get_geometry_in(fname, inlines)[source]
dpdata.abacus.scf.get_nele_from_stru(geometry_inlines)[source]
dpdata.abacus.scf.get_path_out(fname, inlines)[source]
dpdata.abacus.scf.get_stress(outlines)[source]
dpdata.abacus.scf.get_stru_block(lines, keyword)[source]
dpdata.abacus.scf.make_unlabeled_stru(data, frame_idx, pp_file=None, numerical_orbital=None, numerical_descriptor=None, mass=None)[source]
dpdata.amber package
Submodules
dpdata.amber.mask module

Amber mask.

dpdata.amber.mask.load_param_file(param_file)[source]
dpdata.amber.mask.pick_by_amber_mask(param, maskstr, coords=None)[source]

Pick atoms by amber masks.

Parameters:
paramstr or parmed.Structure

filename of Amber param file or parmed.Structure

maskstrstr

Amber masks

coordsnp.ndarray (optional)

frame coordinates, shape: N*3

dpdata.amber.md module
dpdata.amber.md.read_amber_traj(parm7_file, nc_file, mdfrc_file=None, mden_file=None, mdout_file=None, use_element_symbols=None, labeled=True)[source]

The amber trajectory includes: * nc, NetCDF format, stores coordinates * mdfrc, NetCDF format, stores forces * mden (optional), text format, stores energies * mdout (optional), text format, may store energies if there is no mden_file * parm7, text format, stores types.

Parameters:
parm7_file, nc_file, mdfrc_file, mden_file, mdout_file:

filenames

use_element_symbolsNone or list or str

If use_element_symbols is a list of atom indexes, these atoms will use element symbols instead of amber types. For example, a ligand will use C, H, O, N, and so on instead of h1, hc, o, os, and so on. IF use_element_symbols is str, it will be considered as Amber mask.

labeledbool

Whether to return labeled data

dpdata.amber.sqm module
dpdata.amber.sqm.make_sqm_in(data, fname=None, frame_idx=0, **kwargs)[source]
dpdata.amber.sqm.parse_sqm_out(fname)[source]

Read atom symbols, charges and coordinates from ambertools sqm.out file.

dpdata.cp2k package
Submodules
dpdata.cp2k.cell module
dpdata.cp2k.cell.cell_to_low_triangle(A, B, C, alpha, beta, gamma)[source]

Convert cell to low triangle matrix.

Parameters:
Afloat

cell length A

Bfloat

cell length B

Cfloat

cell length C

alphafloat

radian. The angle between vector B and vector C.

betafloat

radian. The angle between vector A and vector C.

gammafloat

radian. The angle between vector B and vector C.

Returns:
celllist

The cell matrix used by dpdata in low triangle form.

dpdata.cp2k.output module
class dpdata.cp2k.output.Cp2kSystems(log_file_name, xyz_file_name, restart=False)[source]

Bases: object

deal with cp2k outputfile.

Methods

get_log_block_generator

get_xyz_block_generator

handle_single_log_frame

handle_single_xyz_frame

get_log_block_generator()[source]
get_xyz_block_generator()[source]
handle_single_log_frame(lines)[source]
handle_single_xyz_frame(lines)[source]
dpdata.cp2k.output.get_frames(fname)[source]
dpdata.deepmd package
Submodules
dpdata.deepmd.comp module
dpdata.deepmd.comp.dump(folder, data, set_size=5000, comp_prec=<class 'numpy.float32'>, remove_sets=True)[source]
dpdata.deepmd.comp.to_system_data(folder, type_map=None, labels=True)[source]
dpdata.deepmd.hdf5 module

Utils for deepmd/hdf5 format.

dpdata.deepmd.hdf5.dump(f: ~h5py._hl.files.File | ~h5py._hl.group.Group, folder: str, data: dict, set_size=5000, comp_prec=<class 'numpy.float32'>) None[source]

Dump data to a HDF5 file.

Parameters:
fh5py.File or h5py.Group

HDF5 file or group object

folderstr

path in the HDF5 file

datadict

System or LabeledSystem data

set_sizeint, default: 5000

size of a set

comp_precnp.dtype, default: np.float32

precision of data

dpdata.deepmd.hdf5.to_system_data(f: File | Group, folder: str, type_map: list | None = None, labels: bool = True)[source]

Load a HDF5 file.

Parameters:
fh5py.File or h5py.Group

HDF5 file or group object

folderstr

path in the HDF5 file

type_maplist

type map

labelsbool

labels

dpdata.deepmd.mixed module
dpdata.deepmd.mixed.dump(folder, data, set_size=2000, comp_prec=<class 'numpy.float32'>, remove_sets=True)[source]
dpdata.deepmd.mixed.formula(atom_names, atom_numbs)[source]

Return the formula of this system, like C3H5O2.

dpdata.deepmd.mixed.load_type(folder)[source]
dpdata.deepmd.mixed.mix_system(*system, type_map, **kwargs)[source]

Mix the systems into mixed_type ones according to the unified given type_map.

Parameters:
*systemSystem

The systems to mix

type_maplist of str

Maps atom type to name

**kwargsdict

Other parameters

Returns:
mixed_systems: dict

dict of mixed system with key ‘atom_numbs’

dpdata.deepmd.mixed.split_system(sys, split_num=10000)[source]
dpdata.deepmd.mixed.to_system_data(folder, type_map=None, labels=True)[source]
dpdata.deepmd.raw module
dpdata.deepmd.raw.dump(folder, data)[source]
dpdata.deepmd.raw.load_type(folder, type_map=None)[source]
dpdata.deepmd.raw.to_system_data(folder, type_map=None, labels=True)[source]
dpdata.dftbplus package
Submodules
dpdata.dftbplus.output module
dpdata.dftbplus.output.read_dftb_plus(fn_1: str, fn_2: str) Tuple[str, ndarray, float, ndarray][source]

Read from DFTB+ input and output.

Parameters:
fn_1str

DFTB+ input file name

fn_2str

DFTB+ output file name

Returns:
str

atomic symbols

np.ndarray

atomic coordinates

float

total potential energy

np.ndarray

atomic forces

dpdata.fhi_aims package
Submodules
dpdata.fhi_aims.output module
dpdata.fhi_aims.output.analyze_block(lines, first_blk=False, md=True)[source]
dpdata.fhi_aims.output.get_fhi_aims_block(fp)[source]
dpdata.fhi_aims.output.get_frames(fname, md=True, begin=0, step=1, convergence_check=True)[source]
dpdata.fhi_aims.output.get_info(lines, type_idx_zero=False)[source]
dpdata.gaussian package
Submodules
dpdata.gaussian.gjf module

Generate Gaussian input file.

dpdata.gaussian.gjf.detect_multiplicity(symbols: ndarray) int[source]

Find the minimal multiplicity of the given molecules.

Parameters:
symbolsnp.ndarray

element symbols; virtual elements are not supported

Returns:
int

spin multiplicity

dpdata.gaussian.gjf.make_gaussian_input(sys_data: dict, keywords: str | List[str], multiplicity: str | int = 'auto', charge: int = 0, fragment_guesses: bool = False, basis_set: str | None = None, keywords_high_multiplicity: str | None = None, nproc: int = 1) str[source]

Make gaussian input file.

Parameters:
sys_datadict

system data

keywordsstr or list[str]

Gaussian keywords, e.g. force b3lyp/6-31g**. If a list, run multiple steps

multiplicitystr or int, default=auto

spin multiplicity state. It can be a number. If auto, multiplicity will be detected automatically, with the following rules:

fragment_guesses=True

multiplicity will +1 for each radical, and +2 for each oxygen molecule

fragment_guesses=False

multiplicity will be 1 or 2, but +2 for each oxygen molecule

chargeint, default=0

molecule charge. Only used when charge is not provided by the system

fragment_guessesbool, default=False

initial guess generated from fragment guesses. If True, multiplicity should be auto

basis_setstr, default=None

custom basis set

keywords_high_multiplicitystr, default=None

keywords for points with multiple raicals. multiplicity should be auto. If not set, fallback to normal keywords

nprocint, default=1

Number of CPUs to use

Returns:
str

gjf output string

dpdata.gaussian.gjf.read_gaussian_input(inp: str)[source]

Read Gaussian input.

Parameters:
inpstr

Gaussian input str

Returns:
dict

system data

dpdata.gaussian.log module
dpdata.gaussian.log.to_system_data(file_name, md=False)[source]

Read Gaussian log file.

Parameters:
file_namestr

file name

mdbool, default False

whether to read multiple frames

Returns:
datadict

system data

Raises:
RuntimeError

if the input orientation is not found

dpdata.gromacs package
Submodules
dpdata.gromacs.gro module
dpdata.gromacs.gro.file_to_system_data(fname, format_atom_name=True, **kwargs)[source]
dpdata.gromacs.gro.from_system_data(system, f_idx=0, **kwargs)[source]
dpdata.lammps package
Submodules
dpdata.lammps.dump module
exception dpdata.lammps.dump.UnwrapWarning[source]

Bases: UserWarning

dpdata.lammps.dump.box2dumpbox(orig, box)[source]
dpdata.lammps.dump.dumpbox2box(bounds, tilt)[source]
dpdata.lammps.dump.get_atype(lines, type_idx_zero=False)[source]
dpdata.lammps.dump.get_coordtype_and_scalefactor(keys)[source]
dpdata.lammps.dump.get_dumpbox(lines)[source]
dpdata.lammps.dump.get_natoms(lines)[source]
dpdata.lammps.dump.get_natoms_vec(lines)[source]
dpdata.lammps.dump.get_natomtypes(lines)[source]
dpdata.lammps.dump.load_file(fname, begin=0, step=1)[source]
dpdata.lammps.dump.safe_get_posi(lines, cell, orig=array([0., 0., 0.]), unwrap=False)[source]
dpdata.lammps.dump.split_traj(dump_lines)[source]
dpdata.lammps.dump.system_data(lines, type_map=None, type_idx_zero=True, unwrap=False)[source]
dpdata.lammps.lmp module
dpdata.lammps.lmp.box2lmpbox(orig, box)[source]
dpdata.lammps.lmp.from_system_data(system, f_idx=0)[source]
dpdata.lammps.lmp.get_atoms(lines)[source]
dpdata.lammps.lmp.get_atype(lines, type_idx_zero=False)[source]
dpdata.lammps.lmp.get_lmpbox(lines)[source]
dpdata.lammps.lmp.get_natoms(lines)[source]
dpdata.lammps.lmp.get_natoms_vec(lines)[source]
dpdata.lammps.lmp.get_natomtypes(lines)[source]
dpdata.lammps.lmp.get_posi(lines)[source]
dpdata.lammps.lmp.lmpbox2box(lohi, tilt)[source]
dpdata.lammps.lmp.system_data(lines, type_map=None, type_idx_zero=True)[source]
dpdata.lammps.lmp.to_system_data(lines, type_map=None, type_idx_zero=True)[source]
dpdata.openmx package
Submodules
dpdata.openmx.omx module
dpdata.openmx.omx.load_atom(lines)[source]
dpdata.openmx.omx.load_cells(lines)[source]
dpdata.openmx.omx.load_coords(lines, atom_names, natoms)[source]
dpdata.openmx.omx.load_data(mdname, atom_names, natoms)[source]
dpdata.openmx.omx.load_energy(lines)[source]
dpdata.openmx.omx.load_force(lines, atom_names, atom_numbs)[source]
dpdata.openmx.omx.load_param_file(fname, mdname)[source]
dpdata.openmx.omx.to_system_data(fname, mdname)[source]
dpdata.openmx.omx.to_system_label(fname, mdname)[source]
dpdata.orca package
Submodules
dpdata.orca.output module
dpdata.orca.output.read_orca_sp_output(fn: str) Tuple[ndarray, ndarray, float, ndarray][source]

Read from ORCA output.

Note that both the energy and the gradient should be printed.

Parameters:
fnstr

file name

Returns:
np.ndarray

atomic symbols

np.ndarray

atomic coordinates

float

total potential energy

np.ndarray

atomic forces

dpdata.plugins package
Submodules
dpdata.plugins.3dmol module
class dpdata.plugins.3dmol.Py3DMolFormat[source]

Bases: Format

3DMol format.

To use this format, py3Dmol should be installed in advance.

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data[, f_idx, size, style])

Show 3D structure of a frame in jupyter.

to_system(data: dict, f_idx: int = 0, size: Tuple[int] = (300, 300), style: dict = {'sphere': {'radius': 0.4}, 'stick': {}}, **kwargs)[source]

Show 3D structure of a frame in jupyter.

Parameters:
datadict

system data

f_idxint

frame index to show

sizetuple[int]

(width, height) of the widget

styledict

style of 3DMol. Read 3DMol documentation for details.

**kwargsdict

other parameters

Examples

>>> system.to_3dmol()
dpdata.plugins.abacus module
class dpdata.plugins.abacus.AbacusMDFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, *args, **kwargs)

Implement System.to that converts from System to this format.

from_labeled_system(file_name, **kwargs)[source]

Implement LabeledSystem.from that converts from this format to LabeledSystem.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in LabeledSystem.DTYPES

class dpdata.plugins.abacus.AbacusRelaxFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, *args, **kwargs)

Implement System.to that converts from System to this format.

from_labeled_system(file_name, **kwargs)[source]

Implement LabeledSystem.from that converts from this format to LabeledSystem.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in LabeledSystem.DTYPES

class dpdata.plugins.abacus.AbacusSCFFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, *args, **kwargs)

Implement System.to that converts from System to this format.

from_labeled_system(file_name, **kwargs)[source]

Implement LabeledSystem.from that converts from this format to LabeledSystem.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in LabeledSystem.DTYPES

class dpdata.plugins.abacus.AbacusSTRUFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, file_name[, frame_idx])

Dump the system into ABACUS STRU format file.

from_system(file_name, **kwargs)[source]

Implement System.from that converts from this format to System.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in System.DTYPES

to_system(data, file_name, frame_idx=0, **kwargs)[source]

Dump the system into ABACUS STRU format file.

Parameters:
datadict

System data

file_namestr

The output file name

frame_idxint

The index of the frame to dump

pp_filelist of string, optional

List of pseudo potential files

numerical_orbitallist of string, optional

List of orbital files

masslist of float, optional

List of atomic masses

numerical_descriptorstr, optional

numerical descriptor file

**kwargsdict

other parameters

dpdata.plugins.amber module
class dpdata.plugins.amber.AmberMDFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system([file_name, parm7_file, ...])

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system([file_name, parm7_file, ...])

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, *args, **kwargs)

Implement System.to that converts from System to this format.

from_labeled_system(file_name=None, parm7_file=None, nc_file=None, mdfrc_file=None, mden_file=None, mdout_file=None, use_element_symbols=None, **kwargs)[source]

Implement LabeledSystem.from that converts from this format to LabeledSystem.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in LabeledSystem.DTYPES

from_system(file_name=None, parm7_file=None, nc_file=None, use_element_symbols=None, **kwargs)[source]

Implement System.from that converts from this format to System.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in System.DTYPES

class dpdata.plugins.amber.SQMDriver(sqm_exec: str = 'sqm', **kwargs: dict)[source]

Bases: Driver

AMBER sqm program driver.

Parameters:
sqm_execstr, default=sqm

path to sqm program

**kwargsdict

other arguments to make input files. See SQMINFormat

Examples

Use DFTB3 method to calculate potential energy:

>>> labeled_system = system.predict(theory="DFTB3", driver="sqm")
>>> labeled_system['energies'][0]
-15.41111246
Attributes:
ase_calculator

Returns an ase calculator based on this driver.

Methods

get_driver(key)

Get a driver plugin.

get_drivers()

Get all driver plugins.

label(data)

Label a system data.

register(key)

Register a driver plugin.

label(data: dict) dict[source]

Label a system data. Returns new data with energy, forces, and virials.

Parameters:
datadict

data with coordinates and atom types

Returns:
dict

labeled data with energies and forces

class dpdata.plugins.amber.SQMINFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data[, fname, frame_idx])

Generate input files for semi-emperical calculation in sqm software.

to_system(data, fname=None, frame_idx=0, **kwargs)[source]

Generate input files for semi-emperical calculation in sqm software.

Parameters:
datadict

system data

fnamestr

output file name

frame_idxint, default=0

index of frame to write

**kwargsdict

other parameters

Other Parameters:
**kwargsdict
valid parameters are:
qm_theorystr, default=dftb3

level of theory. Options includes AM1, RM1, MNDO, PM3-PDDG, MNDO-PDDG, PM3-CARB1, MNDO/d, AM1/d, PM6, DFTB2, DFTB3

chargeint, default=0

total charge in electron units

maxcycint, default=0

maximum number of minimization cycles to allow. 0 represents a single-point calculation

multint, default=1

multiplicity. Only 1 is allowed.

class dpdata.plugins.amber.SQMMinimizer(maxcyc=1000, *args, **kwargs)[source]

Bases: Minimizer

SQM minimizer.

Parameters:
maxcycint, default=1000

maximun cycle to minimize

Methods

get_minimizer(key)

Get a minimizer plugin.

get_minimizers()

Get all minimizer plugins.

minimize(data)

Minimize the geometry.

register(key)

Register a minimizer plugin.

minimize(data: dict) dict[source]

Minimize the geometry.

Parameters:
datadict

data with coordinates and atom types

Returns:
dict

labeled data with minimized coordinates, energies, and forces

class dpdata.plugins.amber.SQMOutFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(fname, **kwargs)

Read from ambertools sqm.out.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(fname, **kwargs)

Read from ambertools sqm.out.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, *args, **kwargs)

Implement System.to that converts from System to this format.

from_labeled_system(fname, **kwargs)[source]

Read from ambertools sqm.out.

from_system(fname, **kwargs)[source]

Read from ambertools sqm.out.

dpdata.plugins.ase module
class dpdata.plugins.ase.ASEDriver(calculator: ase.calculators.calculator.Calculator)[source]

Bases: Driver

ASE Driver.

Parameters:
calculatorase.calculators.calculator.Calculato

ASE calculator

Attributes:
ase_calculator

Returns an ase calculator based on this driver.

Methods

get_driver(key)

Get a driver plugin.

get_drivers()

Get all driver plugins.

label(data)

Label a system data.

register(key)

Register a driver plugin.

label(data: dict) dict[source]

Label a system data. Returns new data with energy, forces, and virials.

Parameters:
datadict

data with coordinates and atom types

Returns:
dict

labeled data with energies and forces

class dpdata.plugins.ase.ASEMinimizer(driver: Driver, optimizer: Type[Optimizer] | None = None, fmax: float = 0.005, max_steps: int | None = None, optimizer_kwargs: dict = {})[source]

Bases: Minimizer

ASE minimizer.

Parameters:
driverDriver

dpdata driver

optimizertype, optional

ase optimizer class

fmaxfloat, optional, default=5e-3

force convergence criterion

max_stepsint, optional

max steps to optimize

optimizer_kwargsdict, optional

other parameters for optimizer

Methods

get_minimizer(key)

Get a minimizer plugin.

get_minimizers()

Get all minimizer plugins.

minimize(data)

Minimize the geometry.

register(key)

Register a minimizer plugin.

minimize(data: dict) dict[source]

Minimize the geometry.

Parameters:
datadict

data with coordinates and atom types

Returns:
dict

labeled data with minimized coordinates, energies, and forces

class dpdata.plugins.ase.ASEStructureFormat[source]

Bases: Format

Format for the Atomic Simulation Environment (ase).

ASE supports parsing a few dozen of data formats. As described in i the documentation, many of these formats can be determined automatically. Use the ase_fmt keyword argument to supply the format if automatic detection fails.

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(atoms, **kwargs)

Convert ase.Atoms to a LabeledSystem.

from_multi_systems(file_name[, begin, end, ...])

Convert a ASE supported file to ASE Atoms.

from_system(atoms, **kwargs)

Convert ase.Atoms to a System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Convert System to ASE Atoms object.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, **kwargs)

Convert System to ASE Atom obj.

from_labeled_system(atoms: ase.Atoms, **kwargs) dict[source]

Convert ase.Atoms to a LabeledSystem. Energies and forces are calculated by the calculator.

Parameters:
atomsase.Atoms

an ASE Atoms, containing a structure

**kwargsdict

other parameters

Returns:
dict

data dict

Raises:
RuntimeError

ASE will raise RuntimeError if the atoms does not have a calculator

from_multi_systems(file_name: str, begin: int | None = None, end: int | None = None, step: int | None = None, ase_fmt: str | None = None, **kwargs) ase.Atoms[source]

Convert a ASE supported file to ASE Atoms.

It will finally be converted to MultiSystems.

Parameters:
file_namestr

path to file

beginint, optional

begin frame index

endint, optional

end frame index

stepint, optional

frame index step

ase_fmtstr, optional

ASE format. See the ASE documentation about supported formats

**kwargsdict

other parameters

Yields:
ase.Atoms

ASE atoms in the file

from_system(atoms: ase.Atoms, **kwargs) dict[source]

Convert ase.Atoms to a System.

Parameters:
atomsase.Atoms

an ASE Atoms, containing a structure

**kwargsdict

other parameters

Returns:
dict

data dict

to_labeled_system(data, *args, **kwargs)[source]

Convert System to ASE Atoms object.

to_system(data, **kwargs)[source]

Convert System to ASE Atom obj.

class dpdata.plugins.ase.ASETrajFormat[source]

Bases: Format

Format for the ASE’s trajectory format <https://wiki.fysik.dtu.dk/ase/ase/io/trajectory.html#module-ase.io.trajectory>`_ (ase).’ a `traj’ contains a sequence of frames, each of which is an `Atoms’ object.

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name[, begin, end, ...])

Read ASE's trajectory file to System of multiple frames.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name[, begin, end, step])

Read ASE's trajectory file to System of multiple frames.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, *args, **kwargs)

Implement System.to that converts from System to this format.

from_labeled_system(file_name: str, begin: int | None = 0, end: int | None = None, step: int | None = 1, **kwargs) dict[source]

Read ASE’s trajectory file to System of multiple frames.

Parameters:
file_namestr

ASE’s trajectory file

beginint, optional

begin frame index

endint, optional

end frame index

stepint, optional

frame index step

**kwargsdict

other parameters

Returns:
dict_frames: dict

a dictionary containing data of multiple frames

from_system(file_name: str, begin: int | None = 0, end: int | None = None, step: int | None = 1, **kwargs) dict[source]

Read ASE’s trajectory file to System of multiple frames.

Parameters:
file_namestr

ASE’s trajectory file

beginint, optional

begin frame index

endint, optional

end frame index

stepint, optional

frame index step

**kwargsdict

other parameters

Returns:
dict_frames: dict

a dictionary containing data of multiple frames

dpdata.plugins.cp2k module
class dpdata.plugins.cp2k.CP2KAIMDOutputFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name[, restart])

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, *args, **kwargs)

Implement System.to that converts from System to this format.

from_labeled_system(file_name, restart=False, **kwargs)[source]

Implement LabeledSystem.from that converts from this format to LabeledSystem.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in LabeledSystem.DTYPES

class dpdata.plugins.cp2k.CP2KOutputFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name[, restart])

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, *args, **kwargs)

Implement System.to that converts from System to this format.

from_labeled_system(file_name, restart=False, **kwargs)[source]

Implement LabeledSystem.from that converts from this format to LabeledSystem.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in LabeledSystem.DTYPES

dpdata.plugins.deepmd module
class dpdata.plugins.deepmd.DPDriver(dp: str)[source]

Bases: Driver

DeePMD-kit driver.

Parameters:
dpdeepmd.DeepPot or str

The deepmd-kit potential class or the filename of the model.

Examples

>>> DPDriver("frozen_model.pb")
Attributes:
ase_calculator

Returns an ase calculator based on this driver.

Methods

get_driver(key)

Get a driver plugin.

get_drivers()

Get all driver plugins.

label(data)

Label a system data by deepmd-kit.

register(key)

Register a driver plugin.

label(data: dict) dict[source]

Label a system data by deepmd-kit. Returns new data with energy, forces, and virials.

Parameters:
datadict

data with coordinates and atom types

Returns:
dict

labeled data with energies and forces

class dpdata.plugins.deepmd.DeePMDCompFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name[, type_map])

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name[, type_map])

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, file_name[, set_size, prec])

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

MultiMode = 1
from_labeled_system(file_name, type_map=None, **kwargs)[source]

Implement LabeledSystem.from that converts from this format to LabeledSystem.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in LabeledSystem.DTYPES

from_system(file_name, type_map=None, **kwargs)[source]

Implement System.from that converts from this format to System.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in System.DTYPES

to_system(data, file_name, set_size=5000, prec=<class 'numpy.float64'>, **kwargs)[source]

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

The frames are firstly split to sets, then dumped to seperated subfolders named as folder/set.000, folder/set.001, ….

Each set contains set_size frames. The last set may have less frames than set_size.

Parameters:
datadict

System data

file_namestr

The output folder

set_sizeint

The size of each set.

prec{numpy.float32, numpy.float64}

The floating point precision of the compressed data

**kwargsdict

other parameters

class dpdata.plugins.deepmd.DeePMDHDF5Format[source]

Bases: Format

HDF5 format for DeePMD-kit.

Examples

Dump a MultiSystems to a HDF5 file:

>>> import dpdata
>>> dpdata.MultiSystems().from_deepmd_npy("data").to_deepmd_hdf5("data.hdf5")

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name[, type_map])

Convert HDF5 file to LabeledSystem data.

from_multi_systems(directory, **kwargs)

Generate HDF5 groups from a HDF5 file, which will be passed to from_system.

from_system(file_name[, type_map])

Convert HDF5 file to System data.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Generate HDF5 groups, which will be passed to to_system.

to_system(data, file_name[, set_size, comp_prec])

Convert System data to HDF5 file.

from_labeled_system(file_name: str | Group | File, type_map: list[str] | None = None, **kwargs) dict[source]

Convert HDF5 file to LabeledSystem data.

Parameters:
file_namestr or h5py.Group or h5py.File

file name of the HDF5 file or HDF5 object. If it is a string, hashtag is used to split path to the HDF5 file and the HDF5 group

type_mapdict[str]

type map

**kwargsdict

other parameters

Returns:
dict

LabeledSystem data

Raises:
TypeError

file_name is not str or h5py.Group or h5py.File

from_multi_systems(directory: str, **kwargs) Group[source]

Generate HDF5 groups from a HDF5 file, which will be passed to from_system.

Parameters:
directorystr

HDF5 file name

**kwargsdict

other parameters

Yields:
h5py.Group

a HDF5 group in the HDF5 file

from_system(file_name: str | Group | File, type_map: list[str] | None = None, **kwargs) dict[source]

Convert HDF5 file to System data.

Parameters:
file_namestr or h5py.Group or h5py.File

file name of the HDF5 file or HDF5 object. If it is a string, hashtag is used to split path to the HDF5 file and the HDF5 group

type_mapdict[str]

type map

**kwargsdict

other parameters

Returns:
dict

System data

Raises:
TypeError

file_name is not str or h5py.Group or h5py.File

to_multi_systems(formulas: list[str], directory: str, **kwargs) Group[source]

Generate HDF5 groups, which will be passed to to_system.

Parameters:
formulaslist[str]

formulas of MultiSystems

directorystr

HDF5 file name

**kwargsdict

other parameters

Yields:
h5py.Group

a HDF5 group with the name of formula

to_system(data: dict, file_name: str | ~h5py._hl.group.Group | ~h5py._hl.files.File, set_size: int = 5000, comp_prec: ~numpy.dtype = <class 'numpy.float64'>, **kwargs)[source]

Convert System data to HDF5 file.

Parameters:
datadict

data dict

file_namestr or h5py.Group or h5py.File

file name of the HDF5 file or HDF5 object. If it is a string, hashtag is used to split path to the HDF5 file and the HDF5 group

set_sizeint, default=5000

set size

comp_precnp.dtype

data precision

**kwargsdict

other parameters

class dpdata.plugins.deepmd.DeePMDMixedFormat[source]

Bases: Format

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")

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, file_name[, set_size, prec])

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

from_labeled_system_mix

from_system_mix

MultiMode = 1
from_labeled_system_mix(file_name, type_map=None, **kwargs)[source]
from_multi_systems(directory, **kwargs)[source]

Implement MultiSystems.from that converts from this format to MultiSystems.

By default, this method follows MultiMode to implement the conversion.

Parameters:
directorystr

directory of system

**kwargsdict

keyword arguments that will be passed from the method

Returns:
filenames: list[str]

list of filenames

from_system_mix(file_name, type_map=None, **kwargs)[source]
mix_system(*system, type_map, **kwargs)[source]

Mix the systems into mixed_type ones according to the unified given type_map.

Parameters:
*systemSystem

The systems to mix

type_maplist of str

Maps atom type to name

**kwargsdict

other parameters

Returns:
mixed_systems: dict

dict of mixed system with key ‘atom_numbs’

to_system(data, file_name, set_size: int = 2000, prec=<class 'numpy.float64'>, **kwargs)[source]

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:
datadict

System data

file_namestr

The output folder

set_sizeint, default=2000

set size

prec{numpy.float32, numpy.float64}

The floating point precision of the compressed data

**kwargsdict

other parameters

class dpdata.plugins.deepmd.DeePMDRawFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name[, type_map])

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name[, type_map])

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, file_name, **kwargs)

Dump the system in deepmd raw format to directory file_name.

MultiMode = 1
from_labeled_system(file_name, type_map=None, **kwargs)[source]

Implement LabeledSystem.from that converts from this format to LabeledSystem.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in LabeledSystem.DTYPES

from_system(file_name, type_map=None, **kwargs)[source]

Implement System.from that converts from this format to System.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in System.DTYPES

to_system(data, file_name, **kwargs)[source]

Dump the system in deepmd raw format to directory file_name.

dpdata.plugins.dftbplus module
class dpdata.plugins.dftbplus.DFTBplusFormat[source]

Bases: Format

The DFTBplusFormat class handles files in the DFTB+ format.

This class provides a method to read DFTB+ files from a labeled system and returns a dictionary containing various properties of the system.For more information, please refer to the official documentation at the following URL: https://dftbplus.org/documentation

Attributes:
None

Methods

from_labeled_system(file_paths, **kwargs): Reads system information from files.

from_labeled_system(file_paths, **kwargs)[source]

Reads system information from the given DFTB+ file paths.

Parameters:
file_pathstuple

A tuple containing the input and output file paths. - Input file (file_in): Contains information about symbols and coord. - Output file (file_out): Contains information about energy and force.

**kwargsdict

other parameters

dpdata.plugins.fhi_aims module
class dpdata.plugins.fhi_aims.FhiMDFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name[, md, begin, ...])

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, *args, **kwargs)

Implement System.to that converts from System to this format.

from_labeled_system(file_name, md=True, begin=0, step=1, convergence_check=True, **kwargs)[source]

Implement LabeledSystem.from that converts from this format to LabeledSystem.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in LabeledSystem.DTYPES

class dpdata.plugins.fhi_aims.FhiSCFFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, *args, **kwargs)

Implement System.to that converts from System to this format.

from_labeled_system(file_name, **kwargs)[source]

Implement LabeledSystem.from that converts from this format to LabeledSystem.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in LabeledSystem.DTYPES

dpdata.plugins.gaussian module
class dpdata.plugins.gaussian.GaussiaGJFFormat[source]

Bases: Format

Gaussian input file.

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Read Gaussian input file.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, file_name, **kwargs)

Generate Gaussian input file.

from_system(file_name: str, **kwargs)[source]

Read Gaussian input file.

Parameters:
file_namestr

file name

**kwargsdict

keyword arguments

to_system(data: dict, file_name: str, **kwargs)[source]

Generate Gaussian input file.

Parameters:
datadict

system data

file_namestr

file name

**kwargsdict

Other parameters to make input files. See dpdata.gaussian.gjf.make_gaussian_input()

class dpdata.plugins.gaussian.GaussianDriver(gaussian_exec: str = 'g16', **kwargs: dict)[source]

Bases: Driver

Gaussian driver.

Note that “force” keyword must be added. If the number of atoms is large, “Geom=PrintInputOrient” should be added.

Parameters:
gaussian_execstr, default=g16

path to gaussian program

**kwargsdict

other arguments to make input files. See dpdata.gaussian.gjf.make_gaussian_input()

Examples

Use B3LYP method to calculate potential energy of a methane molecule:

>>> labeled_system = system.predict(keywords="force b3lyp/6-31g**", driver="gaussian")
>>> labeled_system['energies'][0]
-1102.714590995794
Attributes:
ase_calculator

Returns an ase calculator based on this driver.

Methods

get_driver(key)

Get a driver plugin.

get_drivers()

Get all driver plugins.

label(data)

Label a system data.

register(key)

Register a driver plugin.

label(data: dict) dict[source]

Label a system data. Returns new data with energy, forces, and virials.

Parameters:
datadict

data with coordinates and atom types

Returns:
dict

labeled data with energies and forces

class dpdata.plugins.gaussian.GaussianLogFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name[, md])

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, *args, **kwargs)

Implement System.to that converts from System to this format.

from_labeled_system(file_name, md=False, **kwargs)[source]

Implement LabeledSystem.from that converts from this format to LabeledSystem.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in LabeledSystem.DTYPES

class dpdata.plugins.gaussian.GaussianMDFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, *args, **kwargs)

Implement System.to that converts from System to this format.

from_labeled_system(file_name, **kwargs)[source]

Implement LabeledSystem.from that converts from this format to LabeledSystem.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in LabeledSystem.DTYPES

dpdata.plugins.gromacs module
class dpdata.plugins.gromacs.GromacsGroFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name[, format_atom_name])

Load gromacs .gro file.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data[, file_name, frame_idx])

Dump the system in gromacs .gro format.

from_system(file_name, format_atom_name=True, **kwargs)[source]

Load gromacs .gro file.

Parameters:
file_namestr

The input file name

format_atom_namebool

Whether to format the atom name

**kwargsdict

other parameters

to_system(data, file_name=None, frame_idx=-1, **kwargs)[source]

Dump the system in gromacs .gro format.

Parameters:
datadict

System data

file_namestr or None

The output file name. If None, return the file content as a string

frame_idxint

The index of the frame to dump

**kwargsdict

other parameters

dpdata.plugins.lammps module
class dpdata.plugins.lammps.LAMMPSDumpFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name[, type_map, begin, ...])

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, *args, **kwargs)

Implement System.to that converts from System to this format.

from_system(file_name, type_map=None, begin=0, step=1, unwrap=False, **kwargs)[source]

Implement System.from that converts from this format to System.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in System.DTYPES

class dpdata.plugins.lammps.LAMMPSLmpFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name[, type_map])

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, file_name[, frame_idx])

Dump the system in lammps data format.

from_system(file_name, type_map=None, **kwargs)[source]

Implement System.from that converts from this format to System.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in System.DTYPES

to_system(data, file_name, frame_idx=0, **kwargs)[source]

Dump the system in lammps data format.

Parameters:
datadict

System data

file_namestr

The output file name

frame_idxint

The index of the frame to dump

**kwargsdict

other parameters

dpdata.plugins.list module
class dpdata.plugins.list.ListFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, **kwargs)

Convert system to list, usefull for data collection.

to_system(data, **kwargs)[source]

Convert system to list, usefull for data collection.

dpdata.plugins.n2p2 module
class dpdata.plugins.n2p2.N2P2Format[source]

Bases: Format

n2p2.

This class support the conversion from and to the training data of n2p2 format. For more information about the n2p2 format, please refer to https://compphysvienna.github.io/n2p2/topics/cfg_file.html

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Read from n2p2 format.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, file_name, **kwargs)

Write n2p2 format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, *args, **kwargs)

Implement System.to that converts from System to this format.

from_labeled_system(file_name, **kwargs)[source]

Read from n2p2 format.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in LabeledSystem.DTYPES

to_labeled_system(data, file_name, **kwargs)[source]

Write n2p2 format.

By default, LabeledSystem.to will fallback to System.to.

Parameters:
datadict

system data, whose keys are defined in LabeledSystem.DTYPES

file_namestr

file name, where the data will be written

*argslist

arguments that will be passed from the method

**kwargsdict

keyword arguments that will be passed from the method

dpdata.plugins.n2p2.match_indices(atype1, atype2)[source]
dpdata.plugins.openmx module
class dpdata.plugins.openmx.OPENMXFormat[source]

Bases: Format

Format for the OpenMX <https://www.openmx-square.org/>.

OpenMX (Open source package for Material eXplorer) is a nano-scale material simulation package based on DFT, norm-conserving pseudopotentials, and pseudo-atomic localized basis functions.

Note that two output files, System.Name.dat and System.Name.md, are required.

Use the openmx/md keyword argument to supply this format.

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Read from OpenMX output.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Read from OpenMX output.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, *args, **kwargs)

Implement System.to that converts from System to this format.

from_labeled_system(file_name: str, **kwargs) dict[source]

Read from OpenMX output.

Parameters:
file_namestr

file name, which is specified by a input file, i.e. System.Name.dat

**kwargsdict

other parameters

Returns:
dict

data dict

from_system(file_name: str, **kwargs) dict[source]

Read from OpenMX output.

Parameters:
file_namestr

file name, which is specified by a input file, i.e. System.Name.dat

**kwargsdict

other parameters

Returns:
dict

data dict

dpdata.plugins.orca module
class dpdata.plugins.orca.ORCASPOutFormat[source]

Bases: Format

ORCA single point energy output.

Note that both the energy and the gradient should be printed into the output file.

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Read from ORCA single point energy output.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, *args, **kwargs)

Implement System.to that converts from System to this format.

from_labeled_system(file_name: str, **kwargs) dict[source]

Read from ORCA single point energy output.

Parameters:
file_namestr

file name

**kwargs

keyword arguments

Returns:
dict

system data

dpdata.plugins.psi4 module
class dpdata.plugins.psi4.PSI4InputFormat[source]

Bases: Format

Psi4 input file.

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, file_name, method, basis[, ...])

Write PSI4 input.

to_system(data: dict, file_name: str, method: str, basis: str, charge: int = 0, multiplicity: int = 1, frame_idx=0, **kwargs)[source]

Write PSI4 input.

Parameters:
datadict

system data

file_namestr

file name

methodstr

computational method

basisstr

basis set; see https://psicode.org/psi4manual/master/basissets_tables.html

chargeint, default=0

charge of system

multiplicityint, default=1

multiplicity of system

frame_idxint, default=0

The index of the frame to dump

**kwargs

keyword arguments

class dpdata.plugins.psi4.PSI4OutFormat[source]

Bases: Format

Psi4 output.

Note that both the energy and the gradient should be printed into the output file.

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Read from Psi4 output.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, *args, **kwargs)

Implement System.to that converts from System to this format.

from_labeled_system(file_name: str, **kwargs) dict[source]

Read from Psi4 output.

Parameters:
file_namestr

file name

**kwargs

keyword arguments

Returns:
dict

system data

dpdata.plugins.pwmat module
class dpdata.plugins.pwmat.PwmatAtomconfigFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, file_name[, frame_idx])

Dump the system in pwmat atom.config format.

from_system(file_name, **kwargs)[source]

Implement System.from that converts from this format to System.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in System.DTYPES

to_system(data, file_name, frame_idx=0, *args, **kwargs)[source]

Dump the system in pwmat atom.config format.

Parameters:
datadict

The system data

file_namestr

The output file name

frame_idxint

The index of the frame to dump

*argslist

other parameters

**kwargsdict

other parameters

class dpdata.plugins.pwmat.PwmatOutputFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name[, begin, ...])

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, *args, **kwargs)

Implement System.to that converts from System to this format.

from_labeled_system(file_name, begin=0, step=1, convergence_check=True, **kwargs)[source]

Implement LabeledSystem.from that converts from this format to LabeledSystem.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in LabeledSystem.DTYPES

dpdata.plugins.pymatgen module
class dpdata.plugins.pymatgen.PyMatgenCSEFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Convert System to Pymagen ComputedStructureEntry obj.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, *args, **kwargs)

Implement System.to that converts from System to this format.

to_labeled_system(data, *args, **kwargs)[source]

Convert System to Pymagen ComputedStructureEntry obj.

class dpdata.plugins.pymatgen.PyMatgenMoleculeFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, **kwargs)

Convert System to Pymatgen Molecule obj.

from_system(file_name, **kwargs)[source]

Implement System.from that converts from this format to System.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in System.DTYPES

to_system(data, **kwargs)[source]

Convert System to Pymatgen Molecule obj.

class dpdata.plugins.pymatgen.PyMatgenStructureFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(structure, **kwargs)

Convert pymatgen.core.Structure to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, **kwargs)

Convert System to Pymatgen Structure obj.

from_system(structure, **kwargs) dict[source]

Convert pymatgen.core.Structure to System.

Parameters:
structurepymatgen.core.Structure

a Pymatgen Structure, containing a structure

**kwargsdict

other parameters

Returns:
dict

data dict

to_system(data, **kwargs)[source]

Convert System to Pymatgen Structure obj.

dpdata.plugins.qe module
class dpdata.plugins.qe.QECPPWSCFFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, *args, **kwargs)

Implement System.to that converts from System to this format.

from_labeled_system(file_name, **kwargs)[source]

Implement LabeledSystem.from that converts from this format to LabeledSystem.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in LabeledSystem.DTYPES

class dpdata.plugins.qe.QECPTrajFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name[, begin, step])

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name[, begin, step])

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, *args, **kwargs)

Implement System.to that converts from System to this format.

from_labeled_system(file_name, begin=0, step=1, **kwargs)[source]

Implement LabeledSystem.from that converts from this format to LabeledSystem.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in LabeledSystem.DTYPES

from_system(file_name, begin=0, step=1, **kwargs)[source]

Implement System.from that converts from this format to System.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in System.DTYPES

dpdata.plugins.rdkit module
class dpdata.plugins.rdkit.MolFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, mol, file_name[, ...])

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, *args, **kwargs)

Implement System.to that converts from System to this format.

from_bond_order_system(file_name, **kwargs)[source]

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data

to_bond_order_system(data, mol, file_name, frame_idx=0, **kwargs)[source]

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

By default, BondOrderSystem.to will fallback to LabeledSystem.to.

Parameters:
datadict

system data

rdkit_molrdkit.Chem.rdchem.Mol

rdkit mol object

*argslist

arguments that will be passed from the method

**kwargsdict

keyword arguments that will be passed from the method

class dpdata.plugins.rdkit.SdfFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Note that it requires all molecules in .sdf file must be of the same topology.

from_labeled_system(file_name, **kwargs)

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, mol, file_name[, ...])

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, *args, **kwargs)

Implement System.to that converts from System to this format.

from_bond_order_system(file_name, **kwargs)[source]

Note that it requires all molecules in .sdf file must be of the same topology.

to_bond_order_system(data, mol, file_name, frame_idx=-1, **kwargs)[source]

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

By default, BondOrderSystem.to will fallback to LabeledSystem.to.

Parameters:
datadict

system data

rdkit_molrdkit.Chem.rdchem.Mol

rdkit mol object

*argslist

arguments that will be passed from the method

**kwargsdict

keyword arguments that will be passed from the method

dpdata.plugins.siesta module
class dpdata.plugins.siesta.SiestaAIMDOutputFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, *args, **kwargs)

Implement System.to that converts from System to this format.

from_labeled_system(file_name, **kwargs)[source]

Implement LabeledSystem.from that converts from this format to LabeledSystem.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in LabeledSystem.DTYPES

from_system(file_name, **kwargs)[source]

Implement System.from that converts from this format to System.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in System.DTYPES

class dpdata.plugins.siesta.SiestaOutputFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, *args, **kwargs)

Implement System.to that converts from System to this format.

from_labeled_system(file_name, **kwargs)[source]

Implement LabeledSystem.from that converts from this format to LabeledSystem.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in LabeledSystem.DTYPES

from_system(file_name, **kwargs)[source]

Implement System.from that converts from this format to System.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in System.DTYPES

dpdata.plugins.vasp module
class dpdata.plugins.vasp.VASPOutcarFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name[, begin, ...])

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, *args, **kwargs)

Implement System.to that converts from System to this format.

from_labeled_system(file_name, begin=0, step=1, convergence_check=True, **kwargs)[source]

Implement LabeledSystem.from that converts from this format to LabeledSystem.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in LabeledSystem.DTYPES

class dpdata.plugins.vasp.VASPPoscarFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, file_name[, frame_idx])

Dump the system in vasp POSCAR format.

from_system(file_name, **kwargs)[source]

Implement System.from that converts from this format to System.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in System.DTYPES

to_system(data, file_name, frame_idx=0, **kwargs)[source]

Dump the system in vasp POSCAR format.

Parameters:
datadict

The system data

file_namestr

The output file name

frame_idxint

The index of the frame to dump

**kwargsdict

other parameters

class dpdata.plugins.vasp.VASPStringFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data[, frame_idx])

Dump the system in vasp POSCAR format string.

to_system(data, frame_idx=0, **kwargs)[source]

Dump the system in vasp POSCAR format string.

Parameters:
datadict

The system data

frame_idxint

The index of the frame to dump

**kwargsdict

other parameters

class dpdata.plugins.vasp.VASPXMLFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name[, begin, step])

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, *args, **kwargs)

Implement System.to that converts from System to this format.

from_labeled_system(file_name, begin=0, step=1, **kwargs)[source]

Implement LabeledSystem.from that converts from this format to LabeledSystem.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in LabeledSystem.DTYPES

dpdata.plugins.xyz module
class dpdata.plugins.xyz.QuipGapXYZFormat[source]

Bases: Format

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(data, **kwargs)

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(file_name, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, *args, **kwargs)

Implement System.to that converts from System to this format.

from_labeled_system(data, **kwargs)[source]

Implement LabeledSystem.from that converts from this format to LabeledSystem.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in LabeledSystem.DTYPES

from_multi_systems(file_name, **kwargs)[source]

Implement MultiSystems.from that converts from this format to MultiSystems.

By default, this method follows MultiMode to implement the conversion.

Parameters:
directorystr

directory of system

**kwargsdict

keyword arguments that will be passed from the method

Returns:
filenames: list[str]

list of filenames

class dpdata.plugins.xyz.XYZFormat[source]

Bases: Format

XYZ foramt.

Examples

>>> s.to("xyz", "a.xyz")

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, file_name, **kwargs)

Implement System.to that converts from System to this format.

from_system(file_name, **kwargs)[source]

Implement System.from that converts from this format to System.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in System.DTYPES

to_system(data, file_name, **kwargs)[source]

Implement System.to that converts from System to this format.

Parameters:
datadict

system data, whose keys are defined in System.DTYPES

*argslist

arguments that will be passed from the method

**kwargsdict

keyword arguments that will be passed from the method

dpdata.psi4 package
Submodules
dpdata.psi4.input module
dpdata.psi4.input.write_psi4_input(types: ndarray, coords: ndarray, method: str, basis: str, charge: int = 0, multiplicity: int = 1) str[source]

Write Psi4 input file.

Parameters:
typesnp.ndarray

atomic symbols

coordsnp.ndarray

atomic coordinates

methodstr

computational method

basisstr

basis set; see https://psicode.org/psi4manual/master/basissets_tables.html

chargeint, default=0

charge of system

multiplicityint, default=1

multiplicity of system

Returns:
str

content of Psi4 input file

dpdata.psi4.output module
dpdata.psi4.output.read_psi4_output(fn: str) Tuple[str, ndarray, float, ndarray][source]

Read from Psi4 output.

Note that both the energy and the gradient should be printed.

Parameters:
fnstr

file name

Returns:
str

atomic symbols

np.ndarray

atomic coordinates

float

total potential energy

np.ndarray

atomic forces

dpdata.pwmat package
Submodules
dpdata.pwmat.atomconfig module
dpdata.pwmat.atomconfig.from_system_data(system, f_idx=0, skip_zeros=True)[source]
dpdata.pwmat.atomconfig.to_system_data(lines)[source]
dpdata.pwmat.movement module
dpdata.pwmat.movement.analyze_block(lines, ntot, nelm)[source]
dpdata.pwmat.movement.get_frames(fname, begin=0, step=1, convergence_check=True)[source]
dpdata.pwmat.movement.get_movement_block(fp)[source]
dpdata.pwmat.movement.system_info(lines, type_idx_zero=False)[source]
dpdata.pymatgen package
Submodules
dpdata.pymatgen.molecule module
dpdata.pymatgen.molecule.to_system_data(file_name, protect_layer=9)[source]
dpdata.pymatgen.structure module
dpdata.pymatgen.structure.from_system_data(structure) dict[source]
dpdata.qe package
Submodules
dpdata.qe.scf module
dpdata.qe.scf.get_block(lines, keyword, skip=0)[source]
dpdata.qe.scf.get_cell(lines)[source]
dpdata.qe.scf.get_coords(lines, cell)[source]
dpdata.qe.scf.get_energy(lines)[source]
dpdata.qe.scf.get_force(lines, natoms)[source]
dpdata.qe.scf.get_frame(fname)[source]
dpdata.qe.scf.get_stress(lines)[source]
dpdata.qe.traj module
dpdata.qe.traj.convert_celldm(ibrav, celldm)[source]
dpdata.qe.traj.load_atom_names(lines, ntypes)[source]
dpdata.qe.traj.load_atom_types(lines, natoms, atom_names)[source]
dpdata.qe.traj.load_block(lines, key, nlines)[source]
dpdata.qe.traj.load_cell_parameters(lines)[source]
dpdata.qe.traj.load_celldm(lines)[source]
dpdata.qe.traj.load_data(fname, natoms, begin=0, step=1, convert=1.0)[source]
dpdata.qe.traj.load_energy(fname, begin=0, step=1)[source]
dpdata.qe.traj.load_key(lines, key)[source]
dpdata.qe.traj.load_param_file(fname)[source]
dpdata.qe.traj.to_system_data(input_name, prefix, begin=0, step=1)[source]
dpdata.qe.traj.to_system_label(input_name, prefix, begin=0, step=1)[source]
dpdata.rdkit package
Submodules
dpdata.rdkit.sanitize module
exception dpdata.rdkit.sanitize.SanitizeError(content='Sanitization Failed.')[source]

Bases: Exception

class dpdata.rdkit.sanitize.Sanitizer(level='medium', raise_errors=True, verbose=False)[source]

Bases: object

Methods

sanitize(mol)

Sanitize mol according to self.level.

sanitize(mol)[source]

Sanitize mol according to self.level. If failed, return None.

dpdata.rdkit.sanitize.assign_formal_charge_for_atom(atom, verbose=False)[source]

Assigen formal charge according to 8-electron rule for element B,C,N,O,S,P,As.

dpdata.rdkit.sanitize.contain_hetero_aromatic(mol)[source]
dpdata.rdkit.sanitize.convert_by_obabel(mol, cache_dir='/home/docs/checkouts/readthedocs.org/user_builds/dpdata/checkouts/latest/docs/.cache', obabel_path='obabel')[source]
dpdata.rdkit.sanitize.get_explicit_valence(atom, verbose=False)[source]
dpdata.rdkit.sanitize.get_terminal_NR2s(atom)[source]
dpdata.rdkit.sanitize.get_terminal_oxygens(atom)[source]
dpdata.rdkit.sanitize.is_terminal_NR2(N_atom)[source]
dpdata.rdkit.sanitize.is_terminal_nitrogen(N_atom)[source]
dpdata.rdkit.sanitize.is_terminal_oxygen(O_atom)[source]
dpdata.rdkit.sanitize.kekulize_aromatic_heterocycles(mol_in, assign_formal_charge=True, sanitize=True)[source]
dpdata.rdkit.sanitize.mol_edit_log(mol, i, j)[source]
dpdata.rdkit.sanitize.print_atoms(mol)[source]
dpdata.rdkit.sanitize.print_bonds(mol)[source]
dpdata.rdkit.sanitize.regularize_carbon_bond_order(atom, verbose=True)[source]
dpdata.rdkit.sanitize.regularize_formal_charges(mol, sanitize=True, verbose=False)[source]

Regularize formal charges of atoms.

dpdata.rdkit.sanitize.regularize_nitrogen_bond_order(atom, verbose=True)[source]
dpdata.rdkit.sanitize.sanitize_carboxyl(mol)[source]
dpdata.rdkit.sanitize.sanitize_carboxyl_Catom(C_atom, verbose=True)[source]
dpdata.rdkit.sanitize.sanitize_guanidine(mol)[source]
dpdata.rdkit.sanitize.sanitize_guanidine_Catom(C_atom, verbose=True)[source]
dpdata.rdkit.sanitize.sanitize_mol(mol, verbose=False)[source]
dpdata.rdkit.sanitize.sanitize_nitrine_Natom(atom, verbose=True)[source]
dpdata.rdkit.sanitize.sanitize_nitro(mol)[source]
dpdata.rdkit.sanitize.sanitize_nitro_Natom(N_atom, verbose=True)[source]
dpdata.rdkit.sanitize.sanitize_phosphate(mol)[source]
dpdata.rdkit.sanitize.sanitize_phosphate_Patom(P_atom, verbose=True)[source]
dpdata.rdkit.sanitize.sanitize_sulfate(mol)[source]
dpdata.rdkit.sanitize.sanitize_sulfate_Satom(S_atom, verbose=True)[source]
dpdata.rdkit.sanitize.super_sanitize_mol(mol, name=None, verbose=True)[source]
dpdata.rdkit.utils module
dpdata.rdkit.utils.check_molecule_list(mols)[source]
dpdata.rdkit.utils.check_same_atom(atom_1, atom_2)[source]
dpdata.rdkit.utils.check_same_molecule(mol_1, mol_2)[source]
dpdata.rdkit.utils.combine_molecules(mols)[source]
dpdata.rdkit.utils.mol_to_system_data(mol)[source]
dpdata.rdkit.utils.system_data_to_mol(data)[source]
dpdata.siesta package
Submodules
dpdata.siesta.aiMD_output module
dpdata.siesta.aiMD_output.covert_dimension(arr, num)[source]
dpdata.siesta.aiMD_output.extract_keyword(fout, keyword, down_line_num, begin_column, read_column_num, is_repeated_read, column_num)[source]
dpdata.siesta.aiMD_output.get_aiMD_frame(fname)[source]
dpdata.siesta.aiMD_output.get_atom_name(fout)[source]
dpdata.siesta.aiMD_output.get_atom_numbs(atomtypes)[source]
dpdata.siesta.aiMD_output.get_atom_types(fout, atomnums)[source]
dpdata.siesta.aiMD_output.get_single_line_tail(fin, keyword, num=1)[source]
dpdata.siesta.aiMD_output.get_virial(fout, cell)[source]
dpdata.siesta.aiMD_output.obtain_nframe(fname)[source]
dpdata.siesta.output module
dpdata.siesta.output.extract_keyword(fout, keyword, down_line_num, begin_column, column_num)[source]
dpdata.siesta.output.get_atom_name(fout)[source]
dpdata.siesta.output.get_atom_numbs(atomtypes)[source]
dpdata.siesta.output.get_atom_types(fout, atomnums)[source]
dpdata.siesta.output.get_single_line_tail(fin, keyword, num=1)[source]
dpdata.siesta.output.get_virial(fout, cells)[source]
dpdata.siesta.output.obtain_frame(fname)[source]
dpdata.vasp package
Submodules
dpdata.vasp.outcar module
dpdata.vasp.outcar.analyze_block(lines, ntot, nelm, ml=False)[source]
dpdata.vasp.outcar.get_frames(fname, begin=0, step=1, ml=False, convergence_check=True)[source]
dpdata.vasp.outcar.get_outcar_block(fp, ml=False)[source]
dpdata.vasp.outcar.system_info(lines, type_idx_zero=False)[source]
dpdata.vasp.poscar module
dpdata.vasp.poscar.from_system_data(system, f_idx=0, skip_zeros=True)[source]
dpdata.vasp.poscar.to_system_data(lines)[source]
dpdata.vasp.xml module
dpdata.vasp.xml.analyze(fname, type_idx_zero=False, begin=0, step=1)[source]

Deal with broken xml file.

dpdata.vasp.xml.analyze_atominfo(atominfo_xml)[source]
dpdata.vasp.xml.analyze_calculation(cc)[source]
dpdata.vasp.xml.check_name(item, name)[source]
dpdata.vasp.xml.formulate_config(eles, types, posi, cell, ener, forc, strs_)[source]
dpdata.vasp.xml.get_varray(varray)[source]
dpdata.xyz package
Submodules
dpdata.xyz.quip_gap_xyz module
class dpdata.xyz.quip_gap_xyz.QuipGapxyzSystems(file_name)[source]

Bases: object

deal with QuipGapxyzFile.

Methods

get_block_generator

handle_single_xyz_frame

get_block_generator()[source]
static handle_single_xyz_frame(lines)[source]
dpdata.xyz.xyz module
dpdata.xyz.xyz.coord_to_xyz(coord: ndarray, types: list) str[source]

Convert coordinates and types to xyz format.

Parameters:
coordnp.ndarray

coordinates, Nx3 array

typeslist

list of types

Returns:
str

xyz format string

Examples

>>> coord_to_xyz(np.ones((1,3)), ["C"])
1

C 1.000000 1.000000 1.000000

dpdata.xyz.xyz.xyz_to_coord(xyz: str) Tuple[ndarray, list][source]

Convert xyz format to coordinates and types.

Parameters:
xyzstr

xyz format string

Returns:
coordsnp.ndarray

coordinates, Nx3 array

typeslist

list of types

Submodules

dpdata.ase_calculator module

dpdata.bond_order_system module

class dpdata.bond_order_system.BondOrderSystem(file_name=None, fmt='auto', type_map=None, begin=0, step=1, data=None, rdkit_mol=None, sanitize_level='medium', raise_errors=True, verbose=False, **kwargs)[source]

Bases: System

The system with chemical bond and formal charges information.

For example, a labeled methane system named d_example has one molecule (5 atoms, 4 bonds) and n_frames frames. The bond order and formal charge information can be accessed by
  • d_example[‘bonds’]a numpy array of size 4 x 3, and

    the first column represents the index of begin atom, the second column represents the index of end atom, the third columen represents the bond order:

    1 - single bond, 2 - double bond, 3 - triple bond, 1.5 - aromatic bond

  • d_example[‘formal_charges’] : a numpy array of size 5 x 1

Attributes:
formula

Return the formula of this system, like C3H5O2.

formula_hash

Return the hash of the formula of this system.

nopbc
short_formula

Return the short formula of this system.

short_name

Return the short name of this system (no more than 255 bytes), in the following order: - formula - short_formula - formula_hash.

uniq_formula

Return the uniq_formula of this system.

Methods

add_atom_names(atom_names)

Add atom_names that do not exist.

append(system)

Append a system to this system.

apply_pbc()

Append periodic boundary condition.

as_dict()

Returns data dict of System instance.

check_data()

Check if data is correct.

check_type_map(type_map)

Assign atom_names to type_map if type_map is given and different from atom_names.

convert_to_mixed_type([type_map])

Convert the data dict to mixed type format structure, in order to append systems with different formula but the same number of atoms.

copy()

Returns a copy of the system.

dump(filename[, indent])

Dump .json or .yaml file.

extend(systems)

Extend a system list to this system.

from_3dmol(file_name, **kwargs)

Read data from dpdata.plugins.3dmol.Py3DMolFormat format.

from_abacus_lcao_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_lcao_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_lcao_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_pw_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_pw_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_pw_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_stru(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSTRUFormat format.

from_amber_md(file_name, **kwargs)

Read data from dpdata.plugins.amber.AmberMDFormat format.

from_ase_structure(file_name, **kwargs)

Read data from dpdata.plugins.ase.ASEStructureFormat format.

from_ase_traj(file_name, **kwargs)

Read data from dpdata.plugins.ase.ASETrajFormat format.

from_atomconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_contcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_cp2k_aimd_output(file_name, **kwargs)

Read data from dpdata.plugins.cp2k.CP2KAIMDOutputFormat format.

from_cp2k_output(file_name, **kwargs)

Read data from dpdata.plugins.cp2k.CP2KOutputFormat format.

from_deepmd(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDRawFormat format.

from_deepmd_comp(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDCompFormat format.

from_deepmd_hdf5(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDHDF5Format format.

from_deepmd_npy(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDCompFormat format.

from_deepmd_npy_mixed(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDMixedFormat format.

from_deepmd_raw(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDRawFormat format.

from_dftbplus(file_name, **kwargs)

Read data from dpdata.plugins.dftbplus.DFTBplusFormat format.

from_dict(d)

param d:

Dict representation.

from_dump(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSDumpFormat format.

from_fhi_aims_md(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiMDFormat format.

from_fhi_aims_output(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiMDFormat format.

from_fhi_aims_scf(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiSCFFormat format.

from_finalconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_gaussian_gjf(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussiaGJFFormat format.

from_gaussian_log(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussianLogFormat format.

from_gaussian_md(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussianMDFormat format.

from_gro(file_name, **kwargs)

Read data from dpdata.plugins.gromacs.GromacsGroFormat format.

from_gromacs_gro(file_name, **kwargs)

Read data from dpdata.plugins.gromacs.GromacsGroFormat format.

from_lammps_dump(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSDumpFormat format.

from_lammps_lmp(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSLmpFormat format.

from_list(file_name, **kwargs)

Read data from dpdata.plugins.list.ListFormat format.

from_lmp(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSLmpFormat format.

from_mlmd(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_mol(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.MolFormat format.

from_mol_file(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.MolFormat format.

from_movement(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_n2p2(file_name, **kwargs)

Read data from dpdata.plugins.n2p2.N2P2Format format.

from_openmx_md(file_name, **kwargs)

Read data from dpdata.plugins.openmx.OPENMXFormat format.

from_orca_spout(file_name, **kwargs)

Read data from dpdata.plugins.orca.ORCASPOutFormat format.

from_outcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPOutcarFormat format.

from_poscar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_psi4_inp(file_name, **kwargs)

Read data from dpdata.plugins.psi4.PSI4InputFormat format.

from_psi4_out(file_name, **kwargs)

Read data from dpdata.plugins.psi4.PSI4OutFormat format.

from_pwmat_atomconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_pwmat_finalconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_pwmat_mlmd(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pwmat_movement(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pwmat_output(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pymatgen_computedstructureentry(...)

Read data from dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

from_pymatgen_molecule(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenMoleculeFormat format.

from_pymatgen_structure(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenStructureFormat format.

from_qe_cp_traj(file_name, **kwargs)

Read data from dpdata.plugins.qe.QECPTrajFormat format.

from_qe_pw_scf(file_name, **kwargs)

Read data from dpdata.plugins.qe.QECPPWSCFFormat format.

from_quip_gap_xyz(file_name, **kwargs)

Read data from dpdata.plugins.xyz.QuipGapXYZFormat format.

from_quip_gap_xyz_file(file_name, **kwargs)

Read data from dpdata.plugins.xyz.QuipGapXYZFormat format.

from_rdkit_mol(rdkit_mol)

Initialize from a rdkit.Chem.rdchem.Mol object.

from_sdf(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.SdfFormat format.

from_sdf_file(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.SdfFormat format.

from_siesta_aiMD_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

from_siesta_aimd_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

from_siesta_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaOutputFormat format.

from_sqm_in(file_name, **kwargs)

Read data from dpdata.plugins.amber.SQMINFormat format.

from_sqm_out(file_name, **kwargs)

Read data from dpdata.plugins.amber.SQMOutFormat format.

from_stru(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSTRUFormat format.

from_vasp_contcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_vasp_outcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPOutcarFormat format.

from_vasp_poscar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_vasp_string(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPStringFormat format.

from_vasp_xml(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPXMLFormat format.

from_xml(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPXMLFormat format.

from_xyz(file_name, **kwargs)

Read data from dpdata.plugins.xyz.XYZFormat format.

get_atom_names()

Returns name of atoms.

get_atom_numbs()

Returns number of atoms.

get_atom_types()

Returns type of atoms.

get_bond_order(begin_atom_idx, end_atom_idx)

Return the bond order between given atoms.

get_charge()

Return the total formal charge of the moleclue.

get_formal_charges()

Return the formal charges on each atom.

get_mol()

Return the rdkit.Mol object.

get_natoms()

Returns total number of atoms in the system.

get_nbonds()

Return the number of bonds.

get_nframes()

Returns number of frames in the system.

get_ntypes()

Returns total number of atom types in the system.

load(filename)

Rebuild System obj.

map_atom_types([type_map])

Map the atom types of the system.

minimize(*args, minimizer, **kwargs)

Minimize the geometry.

perturb(pert_num, cell_pert_fraction, ...[, ...])

Perturb each frame in the system randomly.

pick_atom_idx(idx[, nopbc])

Pick atom index.

pick_by_amber_mask(param, maskstr[, ...])

Pick atoms by amber mask.

predict(*args[, driver])

Predict energies and forces by a driver.

register_data_type(*data_type)

Register data type.

remove_atom_names(atom_names)

Remove atom names and all such atoms.

remove_pbc([protect_layer])

This method does NOT delete the definition of the cells, it (1) revises the cell to a cubic cell and ensures that the cell boundary to any atom in the system is no less than protect_layer (2) translates the system such that the center-of-geometry of the system locates at the center of the cell.

replicate(ncopy)

Replicate the each frame in the system in 3 dimensions.

shuffle()

Shuffle frames randomly.

sort_atom_names([type_map])

Sort atom_names of the system and reorder atom_numbs and atom_types accoarding to atom_names.

sort_atom_types()

Sort atom types.

sub_system(f_idx)

Construct a subsystem from the system.

to(fmt, *args, **kwargs)

Dump systems to the specific format.

to_3dmol(*args, **kwargs)

Dump data to dpdata.plugins.3dmol.Py3DMolFormat format.

to_abacus_lcao_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_lcao_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_lcao_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_pw_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_pw_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_pw_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_stru(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSTRUFormat format.

to_amber_md(*args, **kwargs)

Dump data to dpdata.plugins.amber.AmberMDFormat format.

to_ase_structure(*args, **kwargs)

Dump data to dpdata.plugins.ase.ASEStructureFormat format.

to_ase_traj(*args, **kwargs)

Dump data to dpdata.plugins.ase.ASETrajFormat format.

to_atomconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_contcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_cp2k_aimd_output(*args, **kwargs)

Dump data to dpdata.plugins.cp2k.CP2KAIMDOutputFormat format.

to_cp2k_output(*args, **kwargs)

Dump data to dpdata.plugins.cp2k.CP2KOutputFormat format.

to_deepmd(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDRawFormat format.

to_deepmd_comp(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDCompFormat format.

to_deepmd_hdf5(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDHDF5Format format.

to_deepmd_npy(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDCompFormat format.

to_deepmd_npy_mixed(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDMixedFormat format.

to_deepmd_raw(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDRawFormat format.

to_dftbplus(*args, **kwargs)

Dump data to dpdata.plugins.dftbplus.DFTBplusFormat format.

to_dump(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSDumpFormat format.

to_fhi_aims_md(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiMDFormat format.

to_fhi_aims_output(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiMDFormat format.

to_fhi_aims_scf(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiSCFFormat format.

to_finalconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_gaussian_gjf(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussiaGJFFormat format.

to_gaussian_log(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussianLogFormat format.

to_gaussian_md(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussianMDFormat format.

to_gro(*args, **kwargs)

Dump data to dpdata.plugins.gromacs.GromacsGroFormat format.

to_gromacs_gro(*args, **kwargs)

Dump data to dpdata.plugins.gromacs.GromacsGroFormat format.

to_json()

Returns a json string representation of the MSONable object.

to_lammps_dump(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSDumpFormat format.

to_lammps_lmp(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSLmpFormat format.

to_list(*args, **kwargs)

Dump data to dpdata.plugins.list.ListFormat format.

to_lmp(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSLmpFormat format.

to_mlmd(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_mol(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.MolFormat format.

to_mol_file(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.MolFormat format.

to_movement(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_n2p2(*args, **kwargs)

Dump data to dpdata.plugins.n2p2.N2P2Format format.

to_openmx_md(*args, **kwargs)

Dump data to dpdata.plugins.openmx.OPENMXFormat format.

to_orca_spout(*args, **kwargs)

Dump data to dpdata.plugins.orca.ORCASPOutFormat format.

to_outcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPOutcarFormat format.

to_poscar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_psi4_inp(*args, **kwargs)

Dump data to dpdata.plugins.psi4.PSI4InputFormat format.

to_psi4_out(*args, **kwargs)

Dump data to dpdata.plugins.psi4.PSI4OutFormat format.

to_pwmat_atomconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_pwmat_finalconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_pwmat_mlmd(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pwmat_movement(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pwmat_output(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pymatgen_ComputedStructureEntry(*args, ...)

Dump data to dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

to_pymatgen_computedstructureentry(*args, ...)

Dump data to dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

to_pymatgen_molecule(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenMoleculeFormat format.

to_pymatgen_structure(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenStructureFormat format.

to_qe_cp_traj(*args, **kwargs)

Dump data to dpdata.plugins.qe.QECPTrajFormat format.

to_qe_pw_scf(*args, **kwargs)

Dump data to dpdata.plugins.qe.QECPPWSCFFormat format.

to_quip_gap_xyz(*args, **kwargs)

Dump data to dpdata.plugins.xyz.QuipGapXYZFormat format.

to_quip_gap_xyz_file(*args, **kwargs)

Dump data to dpdata.plugins.xyz.QuipGapXYZFormat format.

to_sdf(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.SdfFormat format.

to_sdf_file(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.SdfFormat format.

to_siesta_aimd_output(*args, **kwargs)

Dump data to dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

to_siesta_output(*args, **kwargs)

Dump data to dpdata.plugins.siesta.SiestaOutputFormat format.

to_sqm_in(*args, **kwargs)

Dump data to dpdata.plugins.amber.SQMINFormat format.

to_sqm_out(*args, **kwargs)

Dump data to dpdata.plugins.amber.SQMOutFormat format.

to_stru(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSTRUFormat format.

to_vasp_contcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_vasp_outcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPOutcarFormat format.

to_vasp_poscar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_vasp_string(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPStringFormat format.

to_vasp_xml(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPXMLFormat format.

to_xml(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPXMLFormat format.

to_xyz(*args, **kwargs)

Dump data to dpdata.plugins.xyz.XYZFormat format.

unsafe_hash()

Returns an hash of the current object.

validate_monty_v1(_MSONable__input_value)

Pydantic validator with correct signature for pydantic v1.x

validate_monty_v2(_MSONable__input_value, _)

Pydantic validator with correct signature for pydantic v2.x

affine_map

apply_type_map

from_fmt

from_fmt_obj

replace

rot_frame_lower_triangular

rot_lower_triangular

to_fmt_obj

DTYPES = (<dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>)
copy()[source]

Returns a copy of the system.

from_fmt_obj(fmtobj, file_name, **kwargs)[source]
from_rdkit_mol(rdkit_mol)[source]

Initialize from a rdkit.Chem.rdchem.Mol object.

get_bond_order(begin_atom_idx, end_atom_idx)[source]

Return the bond order between given atoms.

get_charge()[source]

Return the total formal charge of the moleclue.

get_formal_charges()[source]

Return the formal charges on each atom.

get_mol()[source]

Return the rdkit.Mol object.

get_nbonds()[source]

Return the number of bonds.

to_fmt_obj(fmtobj, *args, **kwargs)[source]

dpdata.cli module

Command line interface for dpdata.

dpdata.cli.convert(*, from_file: str, from_format: str = 'auto', to_file: str | None = None, to_format: str | None = None, no_labeled: bool = False, multi: bool = False, type_map: list | None = None, **kwargs)[source]

Convert files from one format to another one.

Parameters:
from_filestr

read data from a file

from_formatstr

the format of from_file

to_filestr

dump data to a file

to_formatstr

the format of to_file

no_labeledbool

labels aren’t provided

multibool

the system contains multiple directories

type_maplist

type map

**kwargsdict

Additional arguments for the format.

dpdata.cli.dpdata_cli()[source]

Dpdata cli.

Examples

$ dpdata -iposcar POSCAR -odeepmd/npy -O data -n
dpdata.cli.dpdata_parser() ArgumentParser[source]

Returns dpdata cli parser.

Returns:
argparse.ArgumentParser

dpdata cli parser

dpdata.data_type module

class dpdata.data_type.AnyInt[source]

Bases: int

AnyInt equals to any other integer.

Attributes:
denominator

the denominator of a rational number in lowest terms

imag

the imaginary part of a complex number

numerator

the numerator of a rational number in lowest terms

real

the real part of a complex number

Methods

as_integer_ratio(/)

Return integer ratio.

bit_count(/)

Number of ones in the binary representation of the absolute value of self.

bit_length(/)

Number of bits necessary to represent self in binary.

conjugate

Returns self, the complex conjugate of any int.

from_bytes(/, bytes[, byteorder, signed])

Return the integer represented by the given array of bytes.

to_bytes(/[, length, byteorder, signed])

Return an array of bytes representing an integer.

class dpdata.data_type.Axis(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

Data axis.

NATOMS = 'natoms'
NBONDS = 'nbonds'
NFRAMES = 'nframes'
NTYPES = 'ntypes'
exception dpdata.data_type.DataError[source]

Bases: Exception

Data is not correct.

class dpdata.data_type.DataType(name: str, dtype: type, shape: Tuple[int, Axis] = None, required: bool = True)[source]

Bases: object

DataType represents a type of data, like coordinates, energies, etc.

Parameters:
namestr

name of data

dtypetype or tuple[type]

data type, e.g. np.ndarray

shapetuple[int], optional

shape of data. Used when data is list or np.ndarray. Use Axis to represents numbers

requiredbool, default=True

whether this data is required

Methods

check(system)

Check if a system has correct data of this type.

real_shape(system)

Returns expected real shape of a system.

check(system: System)[source]

Check if a system has correct data of this type.

Parameters:
systemSystem

checked system

Raises:
DataError

type or shape of data is not correct

real_shape(system: System) Tuple[int][source]

Returns expected real shape of a system.

dpdata.data_type.get_data_types(labeled: bool)[source]

Get all registered data types.

Parameters:
labeledbool

whether this data type is for LabeledSystem

dpdata.data_type.register_data_type(data_type: DataType, labeled: bool)[source]

Register a data type.

Parameters:
data_typeDataType

data type to be registered

labeledbool

whether this data type is for LabeledSystem

dpdata.driver module

Driver plugin system.

class dpdata.driver.Driver(*args, **kwargs)[source]

Bases: ABC

The base class for a driver plugin. A driver can label a pure System to generate the LabeledSystem.

See also

dpdata.plugins.deepmd.DPDriver

an example of Driver

Attributes:
ase_calculator

Returns an ase calculator based on this driver.

Methods

get_driver(key)

Get a driver plugin.

get_drivers()

Get all driver plugins.

label(data)

Label a system data.

register(key)

Register a driver plugin.

property ase_calculator: ase.calculators.calculator.Calculator

Returns an ase calculator based on this driver.

static get_driver(key: str) Driver[source]

Get a driver plugin.

Parameters:
keystr

key of the plugin.

Returns:
Driver

the specific driver class

Raises:
RuntimeError

if the requested driver is not implemented

static get_drivers() dict[source]

Get all driver plugins.

Returns:
dict

dict for all driver plugisn

abstract label(data: dict) dict[source]

Label a system data. Returns new data with energy, forces, and virials.

Parameters:
datadict

data with coordinates and atom types

Returns:
dict

labeled data with energies and forces

static register(key: str) Callable[source]

Register a driver plugin. Used as decorators.

Parameters:
keystr

key of the plugin.

Returns:
Callable

decorator of a class

Examples

>>> @Driver.register("some_driver")
... class SomeDriver(Driver):
...     pass
class dpdata.driver.HybridDriver(drivers: List[dict | Driver])[source]

Bases: Driver

Hybrid driver, with mixed drivers.

Parameters:
driverslist[dict, Driver]

list of drivers or drivers dict. For a dict, it should contain type as the name of the driver, and others are arguments of the driver.

Raises:
TypeError

The value of drivers is not a dict or Driver.

Examples

>>> driver = HybridDriver([
...     {"type": "sqm", "qm_theory": "DFTB3"},
...     {"type": "dp", "dp": "frozen_model.pb"},
... ])

This driver is the hybrid of SQM and DP.

Attributes:
ase_calculator

Returns an ase calculator based on this driver.

Methods

get_driver(key)

Get a driver plugin.

get_drivers()

Get all driver plugins.

label(data)

Label a system data.

register(key)

Register a driver plugin.

label(data: dict) dict[source]

Label a system data.

Energies and forces are the sum of those of each driver.

Parameters:
datadict

data with coordinates and atom types

Returns:
dict

labeled data with energies and forces

class dpdata.driver.Minimizer(*args, **kwargs)[source]

Bases: ABC

The base class for a minimizer plugin. A minimizer can minimize geometry.

Methods

get_minimizer(key)

Get a minimizer plugin.

get_minimizers()

Get all minimizer plugins.

minimize(data)

Minimize the geometry.

register(key)

Register a minimizer plugin.

static get_minimizer(key: str) Minimizer[source]

Get a minimizer plugin.

Parameters:
keystr

key of the plugin.

Returns:
Minimizer

the specific minimizer class

Raises:
RuntimeError

if the requested minimizer is not implemented

static get_minimizers() dict[source]

Get all minimizer plugins.

Returns:
dict

dict for all minimizer plugisn

abstract minimize(data: dict) dict[source]

Minimize the geometry.

Parameters:
datadict

data with coordinates and atom types

Returns:
dict

labeled data with minimized coordinates, energies, and forces

static register(key: str) Callable[source]

Register a minimizer plugin. Used as decorators.

Parameters:
keystr

key of the plugin.

Returns:
Callable

decorator of a class

Examples

>>> @Minimizer.register("some_minimizer")
... class SomeMinimizer(Minimizer):
...     pass

dpdata.format module

Implement the format plugin system.

class dpdata.format.Format[source]

Bases: ABC

The abstract base class for all formats.

To add a new format, one should create a new class inherited from this class, and then

  • implement several methods, such as from_system();

  • register the format with a key;

  • add documentation in the class docstring;

The new format can be either insider or outside the package.

Methods

MultiModes()

File mode for MultiSystems.

from_bond_order_system(file_name, **kwargs)

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

from_labeled_system(file_name, **kwargs)

Implement LabeledSystem.from that converts from this format to LabeledSystem.

from_multi_systems(directory, **kwargs)

Implement MultiSystems.from that converts from this format to MultiSystems.

from_system(file_name, **kwargs)

Implement System.from that converts from this format to System.

get_formats()

Get all registered formats.

get_from_methods()

Get all registered from methods.

get_to_methods()

Get all registered to methods.

mix_system(*system, type_map, **kwargs)

Mix the systems into mixed_type ones according to the unified given type_map.

post(func_name)

Register a post function for from method.

register(key)

Register a format plugin.

register_from(key)

Register a from method if the target method name is not default.

register_to(key)

Register a to method if the target method name is not default.

to_bond_order_system(data, rdkit_mol, *args, ...)

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

to_labeled_system(data, *args, **kwargs)

Implement LabeledSystem.to that converts from LabeledSystem to this format.

to_multi_systems(formulas, directory, **kwargs)

Implement MultiSystems.to that converts from MultiSystems to this format.

to_system(data, *args, **kwargs)

Implement System.to that converts from System to this format.

MultiMode = 0
class MultiModes[source]

Bases: object

File mode for MultiSystems.

The current implemented modes are:

  • 0 (default): not implemented

  • 1: every directory under the top-level directory is a system.

Directory = 1
NotImplemented = 0
from_bond_order_system(file_name, **kwargs)[source]

Implement BondOrderSystem.from that converts from this format to BondOrderSystem.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data

from_labeled_system(file_name, **kwargs)[source]

Implement LabeledSystem.from that converts from this format to LabeledSystem.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in LabeledSystem.DTYPES

from_multi_systems(directory, **kwargs)[source]

Implement MultiSystems.from that converts from this format to MultiSystems.

By default, this method follows MultiMode to implement the conversion.

Parameters:
directorystr

directory of system

**kwargsdict

keyword arguments that will be passed from the method

Returns:
filenames: list[str]

list of filenames

from_system(file_name, **kwargs)[source]

Implement System.from that converts from this format to System.

Parameters:
file_namestr

file name, i.e. the first argument

**kwargsdict

keyword arguments that will be passed from the method

Returns:
datadict

system data, whose keys are defined in System.DTYPES

static get_formats()[source]

Get all registered formats.

static get_from_methods()[source]

Get all registered from methods.

static get_to_methods()[source]

Get all registered to methods.

mix_system(*system, type_map, **kwargs)[source]

Mix the systems into mixed_type ones according to the unified given type_map.

Parameters:
*systemSystem

The systems to mix

type_maplist of str

Maps atom type to name

**kwargsdict

keyword arguments that will be passed from the method

Returns:
mixed_systems: dict

dict of mixed system with key ‘atom_numbs’

static post(func_name)[source]

Register a post function for from method.

Such function will be called after the “from” method is called.

Parameters:
func_namestr or list of str

The name of the post function.

Returns:
function

The decorator function.

Examples

Register a post function:

>>> @Format.post('remove_pbc')
... @Format.register('test')
... class TestFormat(Format):
...     pass
static register(key)[source]

Register a format plugin.

By default, after a format plugin is registered, the following methods will be registered as well for System(), LabeledSystem(), MultiSystems(), and BondOrderSystem():

  • from_{key.replace(‘/’, ‘_’)}

  • to_{key.replace(‘/’, ‘_’)}

  • from({key}, …)

  • to({key}, …)

The decorator should be explicitly executed before dpdata.system is imported. A module will be imported automatically if it

  • is a submodule of dpdata.plugins;

  • is registered at the dpdata.plugins entry point

Parameters:
keystr

The key to register the plugin.

Returns:
function

The decorator function.

Examples

Register a format plugin:

>>> @Format.register('test')
... @Format.register('test2')
... class TestFormat(Format):
...     pass
static register_from(key)[source]

Register a from method if the target method name is not default.

Parameters:
keystr

The key to register the plugin.

Returns:
function

The decorator function.

Examples

Register a from method:

>>> @Format.register_from('from_test_haha')
... @Format.register('test)
... class TestFormat(Format):
...     pass

This will register a from method named from_test_haha, although the format name is test.

static register_to(key)[source]

Register a to method if the target method name is not default.

Parameters:
keystr

The key to register the plugin.

Returns:
function

The decorator function.

Examples

Register a to method:

>>> @Format.register_to('to_test_haha')
... @Format.register('test')
... class TestFormat(Format):
...     pass

This will register a to method named to_test_haha, although the format name is test.

to_bond_order_system(data, rdkit_mol, *args, **kwargs)[source]

Implement BondOrderSystem.to that converts from BondOrderSystem to this format.

By default, BondOrderSystem.to will fallback to LabeledSystem.to.

Parameters:
datadict

system data

rdkit_molrdkit.Chem.rdchem.Mol

rdkit mol object

*argslist

arguments that will be passed from the method

**kwargsdict

keyword arguments that will be passed from the method

to_labeled_system(data, *args, **kwargs)[source]

Implement LabeledSystem.to that converts from LabeledSystem to this format.

By default, LabeledSystem.to will fallback to System.to.

Parameters:
datadict

system data, whose keys are defined in LabeledSystem.DTYPES

*argslist

arguments that will be passed from the method

**kwargsdict

keyword arguments that will be passed from the method

to_multi_systems(formulas, directory, **kwargs)[source]

Implement MultiSystems.to that converts from MultiSystems to this format.

By default, this method follows MultiMode to implement the conversion.

Parameters:
formulaslist[str]

list of formulas

directorystr

directory of system

**kwargsdict

keyword arguments that will be passed from the method

to_system(data, *args, **kwargs)[source]

Implement System.to that converts from System to this format.

Parameters:
datadict

system data, whose keys are defined in System.DTYPES

*argslist

arguments that will be passed from the method

**kwargsdict

keyword arguments that will be passed from the method

dpdata.periodic_table module

class dpdata.periodic_table.Element(symbol: str)[source]

Bases: object

Attributes:
X
Z
calculated_radius
mass
name
radius

Methods

from_Z

property X
property Z
property calculated_radius
classmethod from_Z(Z)[source]
property mass
property name
property radius

dpdata.plugin module

Base of plugin systems.

class dpdata.plugin.Plugin[source]

Bases: object

A class to register plugins.

Examples

>>> example_plugin = Plugin()
>>> @example_plugin.register("xx")
    def xxx():
        pass
>>> print(example_plugin.plugins['xx'])

Methods

register(key)

Register a plugin.

get_plugin

get_plugin(key)[source]
register(key)[source]

Register a plugin.

Parameters:
keystr

Key of the plugin.

dpdata.stat module

class dpdata.stat.Errors(system_1: object, system_2: object)[source]

Bases: ErrorsBase

Compute errors (deviations) between two LabeledSystems.

Parameters:
system_1object

system 1

system_2object

system 2

Examples

Get errors between referenced system and predicted system:

>>> e = dpdata.stat.Errors(system_1, system_2)
>>> print("%.4f %.4f %.4f %.4f" % (e.e_mae, e.e_rmse, e.f_mae, e.f_rmse))
Attributes:
e_errors

Energy errors.

e_mae

Energy MAE.

e_rmse

Energy RMSE.

f_errors

Force errors.

f_mae

Force MAE.

f_rmse

Force RMSE.

Methods

SYSTEM_TYPE

alias of LabeledSystem

SYSTEM_TYPE

alias of LabeledSystem

property e_errors: ndarray

Energy errors.

property f_errors: ndarray

Force errors.

class dpdata.stat.ErrorsBase(system_1: object, system_2: object)[source]

Bases: object

Compute errors (deviations) between two systems. The type of system is assigned by SYSTEM_TYPE.

Parameters:
system_1object

system 1

system_2object

system 2

Attributes:
e_errors

Energy errors.

e_mae

Energy MAE.

e_rmse

Energy RMSE.

f_errors

Force errors.

f_mae

Force MAE.

f_rmse

Force RMSE.

Methods

SYSTEM_TYPE

alias of object

SYSTEM_TYPE

alias of object

abstract property e_errors: ndarray

Energy errors.

property e_mae: float64

Energy MAE.

property e_rmse: float64

Energy RMSE.

abstract property f_errors: ndarray

Force errors.

property f_mae: float64

Force MAE.

property f_rmse: float64

Force RMSE.

class dpdata.stat.MultiErrors(system_1: object, system_2: object)[source]

Bases: ErrorsBase

Compute errors (deviations) between two MultiSystems.

Parameters:
system_1object

system 1

system_2object

system 2

Examples

Get errors between referenced system and predicted system:

>>> e = dpdata.stat.MultiErrors(system_1, system_2)
>>> print("%.4f %.4f %.4f %.4f" % (e.e_mae, e.e_rmse, e.f_mae, e.f_rmse))
Attributes:
e_errors

Energy errors.

e_mae

Energy MAE.

e_rmse

Energy RMSE.

f_errors

Force errors.

f_mae

Force MAE.

f_rmse

Force RMSE.

Methods

SYSTEM_TYPE

alias of MultiSystems

SYSTEM_TYPE

alias of MultiSystems

property e_errors: ndarray

Energy errors.

property f_errors: ndarray

Force errors.

dpdata.stat.mae(errors: ndarray) float64[source]

Compute the mean absolute error (MAE).

Parameters:
errorsnp.ndarray

errors between two values

Returns:
np.float64

mean absolute error (MAE)

dpdata.stat.rmse(errors: ndarray) float64[source]

Compute the root mean squared error (RMSE).

Parameters:
errorsnp.ndarray

errors between two values

Returns:
np.float64

root mean squared error (RMSE)

dpdata.system module

class dpdata.system.LabeledSystem(file_name=None, fmt='auto', type_map=None, begin=0, step=1, data=None, convergence_check=True, **kwargs)[source]

Bases: System

The labeled data System.

For example, a labeled water system named d_example has two molecules (6 atoms) and nframes frames. The labels can be accessed by
  • d_example[‘energies’] : a numpy array of size nframes

  • d_example[‘forces’] : a numpy array of size nframes x 6 x 3

  • d_example[‘virials’] : optional, a numpy array of size nframes x 3 x 3

It is noted that
  • The order of frames stored in ‘energies’, ‘forces’ and ‘virials’ should be consistent with ‘atom_types’, ‘cells’ and ‘coords’.

  • The order of atoms in every frame of ‘forces’ should be consistent with ‘coords’ and ‘atom_types’.

Parameters:
file_namestr

The file to load the system

fmtstr
Format of the file, supported formats are
  • auto: infered from file_name’s extension

  • vasp/xml: vasp xml

  • vasp/outcar: vasp OUTCAR

  • deepmd/raw: deepmd-kit raw

  • deepmd/npy: deepmd-kit compressed format (numpy binary)

  • qe/cp/traj: Quantum Espresso CP trajectory files. should have: file_name+’.in’, file_name+’.pos’, file_name+’.evp’ and file_name+’.for’

  • qe/pw/scf: Quantum Espresso PW single point calculations. Both input and output files are required. If file_name is a string, it denotes the output file name. Input file name is obtained by replacing ‘out’ by ‘in’ from file_name. Or file_name is a list, with the first element being the input file name and the second element being the output filename.

  • siesta/output: siesta SCF output file

  • siesta/aimd_output: siesta aimd output file

  • gaussian/log: gaussian logs

  • gaussian/md: gaussian ab initio molecular dynamics

  • cp2k/output: cp2k output file

  • cp2k/aimd_output: cp2k aimd output dir(contains pos.xyz and *.log file); optional restart=True if it is a cp2k restarted task.

  • pwmat/movement: pwmat md output file

  • pwmat/out.mlmd: pwmat scf output file

type_maplist of str

Maps atom type to name. The atom with type ii is mapped to type_map[ii]. If not provided the atom names are assigned to ‘Type_1’, ‘Type_2’, ‘Type_3’

beginint

The beginning frame when loading MD trajectory.

stepint

The number of skipped frames when loading MD trajectory.

Attributes:
formula

Return the formula of this system, like C3H5O2.

formula_hash

Return the hash of the formula of this system.

nopbc
short_formula

Return the short formula of this system.

short_name

Return the short name of this system (no more than 255 bytes), in the following order: - formula - short_formula - formula_hash.

uniq_formula

Return the uniq_formula of this system.

Methods

add_atom_names(atom_names)

Add atom_names that do not exist.

append(system)

Append a system to this system.

apply_pbc()

Append periodic boundary condition.

as_dict()

Returns data dict of System instance.

check_data()

Check if data is correct.

check_type_map(type_map)

Assign atom_names to type_map if type_map is given and different from atom_names.

convert_to_mixed_type([type_map])

Convert the data dict to mixed type format structure, in order to append systems with different formula but the same number of atoms.

copy()

Returns a copy of the system.

correction(hl_sys)

Get energy and force correction between self and a high-level LabeledSystem.

dump(filename[, indent])

Dump .json or .yaml file.

extend(systems)

Extend a system list to this system.

from_3dmol(file_name, **kwargs)

Read data from dpdata.plugins.3dmol.Py3DMolFormat format.

from_abacus_lcao_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_lcao_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_lcao_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_pw_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_pw_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_pw_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_stru(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSTRUFormat format.

from_amber_md(file_name, **kwargs)

Read data from dpdata.plugins.amber.AmberMDFormat format.

from_ase_structure(file_name, **kwargs)

Read data from dpdata.plugins.ase.ASEStructureFormat format.

from_ase_traj(file_name, **kwargs)

Read data from dpdata.plugins.ase.ASETrajFormat format.

from_atomconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_contcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_cp2k_aimd_output(file_name, **kwargs)

Read data from dpdata.plugins.cp2k.CP2KAIMDOutputFormat format.

from_cp2k_output(file_name, **kwargs)

Read data from dpdata.plugins.cp2k.CP2KOutputFormat format.

from_deepmd(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDRawFormat format.

from_deepmd_comp(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDCompFormat format.

from_deepmd_hdf5(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDHDF5Format format.

from_deepmd_npy(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDCompFormat format.

from_deepmd_npy_mixed(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDMixedFormat format.

from_deepmd_raw(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDRawFormat format.

from_dftbplus(file_name, **kwargs)

Read data from dpdata.plugins.dftbplus.DFTBplusFormat format.

from_dict(d)

param d:

Dict representation.

from_dump(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSDumpFormat format.

from_fhi_aims_md(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiMDFormat format.

from_fhi_aims_output(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiMDFormat format.

from_fhi_aims_scf(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiSCFFormat format.

from_finalconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_gaussian_gjf(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussiaGJFFormat format.

from_gaussian_log(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussianLogFormat format.

from_gaussian_md(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussianMDFormat format.

from_gro(file_name, **kwargs)

Read data from dpdata.plugins.gromacs.GromacsGroFormat format.

from_gromacs_gro(file_name, **kwargs)

Read data from dpdata.plugins.gromacs.GromacsGroFormat format.

from_lammps_dump(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSDumpFormat format.

from_lammps_lmp(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSLmpFormat format.

from_list(file_name, **kwargs)

Read data from dpdata.plugins.list.ListFormat format.

from_lmp(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSLmpFormat format.

from_mlmd(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_mol(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.MolFormat format.

from_mol_file(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.MolFormat format.

from_movement(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_n2p2(file_name, **kwargs)

Read data from dpdata.plugins.n2p2.N2P2Format format.

from_openmx_md(file_name, **kwargs)

Read data from dpdata.plugins.openmx.OPENMXFormat format.

from_orca_spout(file_name, **kwargs)

Read data from dpdata.plugins.orca.ORCASPOutFormat format.

from_outcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPOutcarFormat format.

from_poscar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_psi4_inp(file_name, **kwargs)

Read data from dpdata.plugins.psi4.PSI4InputFormat format.

from_psi4_out(file_name, **kwargs)

Read data from dpdata.plugins.psi4.PSI4OutFormat format.

from_pwmat_atomconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_pwmat_finalconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_pwmat_mlmd(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pwmat_movement(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pwmat_output(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pymatgen_computedstructureentry(...)

Read data from dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

from_pymatgen_molecule(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenMoleculeFormat format.

from_pymatgen_structure(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenStructureFormat format.

from_qe_cp_traj(file_name, **kwargs)

Read data from dpdata.plugins.qe.QECPTrajFormat format.

from_qe_pw_scf(file_name, **kwargs)

Read data from dpdata.plugins.qe.QECPPWSCFFormat format.

from_quip_gap_xyz(file_name, **kwargs)

Read data from dpdata.plugins.xyz.QuipGapXYZFormat format.

from_quip_gap_xyz_file(file_name, **kwargs)

Read data from dpdata.plugins.xyz.QuipGapXYZFormat format.

from_sdf(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.SdfFormat format.

from_sdf_file(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.SdfFormat format.

from_siesta_aiMD_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

from_siesta_aimd_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

from_siesta_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaOutputFormat format.

from_sqm_in(file_name, **kwargs)

Read data from dpdata.plugins.amber.SQMINFormat format.

from_sqm_out(file_name, **kwargs)

Read data from dpdata.plugins.amber.SQMOutFormat format.

from_stru(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSTRUFormat format.

from_vasp_contcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_vasp_outcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPOutcarFormat format.

from_vasp_poscar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_vasp_string(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPStringFormat format.

from_vasp_xml(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPXMLFormat format.

from_xml(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPXMLFormat format.

from_xyz(file_name, **kwargs)

Read data from dpdata.plugins.xyz.XYZFormat format.

get_atom_names()

Returns name of atoms.

get_atom_numbs()

Returns number of atoms.

get_atom_types()

Returns type of atoms.

get_natoms()

Returns total number of atoms in the system.

get_nframes()

Returns number of frames in the system.

get_ntypes()

Returns total number of atom types in the system.

load(filename)

Rebuild System obj.

map_atom_types([type_map])

Map the atom types of the system.

minimize(*args, minimizer, **kwargs)

Minimize the geometry.

perturb(pert_num, cell_pert_fraction, ...[, ...])

Perturb each frame in the system randomly.

pick_atom_idx(idx[, nopbc])

Pick atom index.

pick_by_amber_mask(param, maskstr[, ...])

Pick atoms by amber mask.

predict(*args[, driver])

Predict energies and forces by a driver.

register_data_type(*data_type)

Register data type.

remove_atom_names(atom_names)

Remove atom names and all such atoms.

remove_outlier([threshold])

Remove outlier frames from the system.

remove_pbc([protect_layer])

This method does NOT delete the definition of the cells, it (1) revises the cell to a cubic cell and ensures that the cell boundary to any atom in the system is no less than protect_layer (2) translates the system such that the center-of-geometry of the system locates at the center of the cell.

replicate(ncopy)

Replicate the each frame in the system in 3 dimensions.

shuffle()

Shuffle frames randomly.

sort_atom_names([type_map])

Sort atom_names of the system and reorder atom_numbs and atom_types accoarding to atom_names.

sort_atom_types()

Sort atom types.

sub_system(f_idx)

Construct a subsystem from the system.

to(fmt, *args, **kwargs)

Dump systems to the specific format.

to_3dmol(*args, **kwargs)

Dump data to dpdata.plugins.3dmol.Py3DMolFormat format.

to_abacus_lcao_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_lcao_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_lcao_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_pw_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_pw_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_pw_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_stru(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSTRUFormat format.

to_amber_md(*args, **kwargs)

Dump data to dpdata.plugins.amber.AmberMDFormat format.

to_ase_structure(*args, **kwargs)

Dump data to dpdata.plugins.ase.ASEStructureFormat format.

to_ase_traj(*args, **kwargs)

Dump data to dpdata.plugins.ase.ASETrajFormat format.

to_atomconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_contcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_cp2k_aimd_output(*args, **kwargs)

Dump data to dpdata.plugins.cp2k.CP2KAIMDOutputFormat format.

to_cp2k_output(*args, **kwargs)

Dump data to dpdata.plugins.cp2k.CP2KOutputFormat format.

to_deepmd(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDRawFormat format.

to_deepmd_comp(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDCompFormat format.

to_deepmd_hdf5(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDHDF5Format format.

to_deepmd_npy(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDCompFormat format.

to_deepmd_npy_mixed(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDMixedFormat format.

to_deepmd_raw(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDRawFormat format.

to_dftbplus(*args, **kwargs)

Dump data to dpdata.plugins.dftbplus.DFTBplusFormat format.

to_dump(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSDumpFormat format.

to_fhi_aims_md(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiMDFormat format.

to_fhi_aims_output(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiMDFormat format.

to_fhi_aims_scf(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiSCFFormat format.

to_finalconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_gaussian_gjf(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussiaGJFFormat format.

to_gaussian_log(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussianLogFormat format.

to_gaussian_md(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussianMDFormat format.

to_gro(*args, **kwargs)

Dump data to dpdata.plugins.gromacs.GromacsGroFormat format.

to_gromacs_gro(*args, **kwargs)

Dump data to dpdata.plugins.gromacs.GromacsGroFormat format.

to_json()

Returns a json string representation of the MSONable object.

to_lammps_dump(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSDumpFormat format.

to_lammps_lmp(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSLmpFormat format.

to_list(*args, **kwargs)

Dump data to dpdata.plugins.list.ListFormat format.

to_lmp(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSLmpFormat format.

to_mlmd(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_mol(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.MolFormat format.

to_mol_file(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.MolFormat format.

to_movement(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_n2p2(*args, **kwargs)

Dump data to dpdata.plugins.n2p2.N2P2Format format.

to_openmx_md(*args, **kwargs)

Dump data to dpdata.plugins.openmx.OPENMXFormat format.

to_orca_spout(*args, **kwargs)

Dump data to dpdata.plugins.orca.ORCASPOutFormat format.

to_outcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPOutcarFormat format.

to_poscar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_psi4_inp(*args, **kwargs)

Dump data to dpdata.plugins.psi4.PSI4InputFormat format.

to_psi4_out(*args, **kwargs)

Dump data to dpdata.plugins.psi4.PSI4OutFormat format.

to_pwmat_atomconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_pwmat_finalconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_pwmat_mlmd(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pwmat_movement(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pwmat_output(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pymatgen_ComputedStructureEntry(*args, ...)

Dump data to dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

to_pymatgen_computedstructureentry(*args, ...)

Dump data to dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

to_pymatgen_molecule(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenMoleculeFormat format.

to_pymatgen_structure(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenStructureFormat format.

to_qe_cp_traj(*args, **kwargs)

Dump data to dpdata.plugins.qe.QECPTrajFormat format.

to_qe_pw_scf(*args, **kwargs)

Dump data to dpdata.plugins.qe.QECPPWSCFFormat format.

to_quip_gap_xyz(*args, **kwargs)

Dump data to dpdata.plugins.xyz.QuipGapXYZFormat format.

to_quip_gap_xyz_file(*args, **kwargs)

Dump data to dpdata.plugins.xyz.QuipGapXYZFormat format.

to_sdf(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.SdfFormat format.

to_sdf_file(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.SdfFormat format.

to_siesta_aimd_output(*args, **kwargs)

Dump data to dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

to_siesta_output(*args, **kwargs)

Dump data to dpdata.plugins.siesta.SiestaOutputFormat format.

to_sqm_in(*args, **kwargs)

Dump data to dpdata.plugins.amber.SQMINFormat format.

to_sqm_out(*args, **kwargs)

Dump data to dpdata.plugins.amber.SQMOutFormat format.

to_stru(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSTRUFormat format.

to_vasp_contcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_vasp_outcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPOutcarFormat format.

to_vasp_poscar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_vasp_string(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPStringFormat format.

to_vasp_xml(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPXMLFormat format.

to_xml(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPXMLFormat format.

to_xyz(*args, **kwargs)

Dump data to dpdata.plugins.xyz.XYZFormat format.

unsafe_hash()

Returns an hash of the current object.

validate_monty_v1(_MSONable__input_value)

Pydantic validator with correct signature for pydantic v1.x

validate_monty_v2(_MSONable__input_value, _)

Pydantic validator with correct signature for pydantic v2.x

affine_map

affine_map_fv

apply_type_map

from_fmt

from_fmt_obj

has_virial

replace

rot_frame_lower_triangular

rot_lower_triangular

to_fmt_obj

DTYPES = (<dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>)
affine_map_fv(trans, f_idx)[source]
correction(hl_sys)[source]

Get energy and force correction between self and a high-level LabeledSystem. The self’s coordinates will be kept, but energy and forces will be replaced by the correction between these two systems.

Note: The function will not check whether coordinates and elements of two systems are the same. The user should make sure by itself.

Parameters:
hl_sysLabeledSystem

high-level LabeledSystem

Returns:
corrected_sys: LabeledSystem

Corrected LabeledSystem

from_3dmol(file_name, **kwargs)

Read data from dpdata.plugins.3dmol.Py3DMolFormat format.

from_abacus_lcao_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_lcao_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_lcao_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_pw_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_pw_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_pw_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_stru(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSTRUFormat format.

from_amber_md(file_name, **kwargs)

Read data from dpdata.plugins.amber.AmberMDFormat format.

from_ase_structure(file_name, **kwargs)

Read data from dpdata.plugins.ase.ASEStructureFormat format.

from_ase_traj(file_name, **kwargs)

Read data from dpdata.plugins.ase.ASETrajFormat format.

from_atomconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_contcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_cp2k_aimd_output(file_name, **kwargs)

Read data from dpdata.plugins.cp2k.CP2KAIMDOutputFormat format.

from_cp2k_output(file_name, **kwargs)

Read data from dpdata.plugins.cp2k.CP2KOutputFormat format.

from_deepmd(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDRawFormat format.

from_deepmd_comp(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDCompFormat format.

from_deepmd_hdf5(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDHDF5Format format.

from_deepmd_npy(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDCompFormat format.

from_deepmd_npy_mixed(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDMixedFormat format.

from_deepmd_raw(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDRawFormat format.

from_dftbplus(file_name, **kwargs)

Read data from dpdata.plugins.dftbplus.DFTBplusFormat format.

from_dump(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSDumpFormat format.

from_fhi_aims_md(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiMDFormat format.

from_fhi_aims_output(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiMDFormat format.

from_fhi_aims_scf(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiSCFFormat format.

from_finalconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_fmt_obj(fmtobj, file_name, **kwargs)[source]
from_gaussian_gjf(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussiaGJFFormat format.

from_gaussian_log(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussianLogFormat format.

from_gaussian_md(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussianMDFormat format.

from_gro(file_name, **kwargs)

Read data from dpdata.plugins.gromacs.GromacsGroFormat format.

from_gromacs_gro(file_name, **kwargs)

Read data from dpdata.plugins.gromacs.GromacsGroFormat format.

from_lammps_dump(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSDumpFormat format.

from_lammps_lmp(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSLmpFormat format.

from_list(file_name, **kwargs)

Read data from dpdata.plugins.list.ListFormat format.

from_lmp(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSLmpFormat format.

from_mlmd(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_mol(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.MolFormat format.

from_mol_file(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.MolFormat format.

from_movement(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_n2p2(file_name, **kwargs)

Read data from dpdata.plugins.n2p2.N2P2Format format.

from_openmx_md(file_name, **kwargs)

Read data from dpdata.plugins.openmx.OPENMXFormat format.

from_orca_spout(file_name, **kwargs)

Read data from dpdata.plugins.orca.ORCASPOutFormat format.

from_outcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPOutcarFormat format.

from_poscar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_psi4_inp(file_name, **kwargs)

Read data from dpdata.plugins.psi4.PSI4InputFormat format.

from_psi4_out(file_name, **kwargs)

Read data from dpdata.plugins.psi4.PSI4OutFormat format.

from_pwmat_atomconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_pwmat_finalconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_pwmat_mlmd(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pwmat_movement(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pwmat_output(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pymatgen_computedstructureentry(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

from_pymatgen_molecule(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenMoleculeFormat format.

from_pymatgen_structure(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenStructureFormat format.

from_qe_cp_traj(file_name, **kwargs)

Read data from dpdata.plugins.qe.QECPTrajFormat format.

from_qe_pw_scf(file_name, **kwargs)

Read data from dpdata.plugins.qe.QECPPWSCFFormat format.

from_quip_gap_xyz(file_name, **kwargs)

Read data from dpdata.plugins.xyz.QuipGapXYZFormat format.

from_quip_gap_xyz_file(file_name, **kwargs)

Read data from dpdata.plugins.xyz.QuipGapXYZFormat format.

from_sdf(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.SdfFormat format.

from_sdf_file(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.SdfFormat format.

from_siesta_aiMD_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

from_siesta_aimd_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

from_siesta_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaOutputFormat format.

from_sqm_in(file_name, **kwargs)

Read data from dpdata.plugins.amber.SQMINFormat format.

from_sqm_out(file_name, **kwargs)

Read data from dpdata.plugins.amber.SQMOutFormat format.

from_stru(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSTRUFormat format.

from_vasp_contcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_vasp_outcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPOutcarFormat format.

from_vasp_poscar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_vasp_string(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPStringFormat format.

from_vasp_xml(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPXMLFormat format.

from_xml(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPXMLFormat format.

from_xyz(file_name, **kwargs)

Read data from dpdata.plugins.xyz.XYZFormat format.

has_virial()[source]
post_funcs = <dpdata.plugin.Plugin object>
remove_outlier(threshold: float = 8.0) LabeledSystem[source]

Remove outlier frames from the system.

Remove the frames whose energies satisfy the condition

\[\frac{\left \| E - \bar{E} \right \|}{\sigma(E)} \geq \text{threshold}\]

where \(\bar{E}\) and \(\sigma(E)\) are the mean and standard deviation of the energies in the system.

Parameters:
thresholdfloat

The threshold of outlier detection. The default value is 8.0.

Returns:
LabeledSystem

The system without outlier frames.

References

[1]

Gao, X.; Ramezanghorbani, F.; Isayev, O.; Smith, J. S.; Roitberg, A. E. TorchANI: A Free and Open Source PyTorch-Based Deep Learning Implementation of the ANI Neural Network Potentials. J. Chem. Inf. Model. 2020, 60, 3408-3415.

[2]

Zeng, J.; Tao, Y.; Giese, T. J.; York, D. M.. QDπ: A Quantum Deep Potential Interaction Model for Drug Discovery. J. Comput. Chem. 2023, 19, 1261-1275.

rot_frame_lower_triangular(f_idx=0)[source]
to_3dmol(*args, **kwargs)

Dump data to dpdata.plugins.3dmol.Py3DMolFormat format.

to_abacus_lcao_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_lcao_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_lcao_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_pw_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_pw_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_pw_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_stru(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSTRUFormat format.

to_amber_md(*args, **kwargs)

Dump data to dpdata.plugins.amber.AmberMDFormat format.

to_ase_structure(*args, **kwargs)

Dump data to dpdata.plugins.ase.ASEStructureFormat format.

to_ase_traj(*args, **kwargs)

Dump data to dpdata.plugins.ase.ASETrajFormat format.

to_atomconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_contcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_cp2k_aimd_output(*args, **kwargs)

Dump data to dpdata.plugins.cp2k.CP2KAIMDOutputFormat format.

to_cp2k_output(*args, **kwargs)

Dump data to dpdata.plugins.cp2k.CP2KOutputFormat format.

to_deepmd(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDRawFormat format.

to_deepmd_comp(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDCompFormat format.

to_deepmd_hdf5(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDHDF5Format format.

to_deepmd_npy(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDCompFormat format.

to_deepmd_npy_mixed(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDMixedFormat format.

to_deepmd_raw(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDRawFormat format.

to_dftbplus(*args, **kwargs)

Dump data to dpdata.plugins.dftbplus.DFTBplusFormat format.

to_dump(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSDumpFormat format.

to_fhi_aims_md(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiMDFormat format.

to_fhi_aims_output(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiMDFormat format.

to_fhi_aims_scf(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiSCFFormat format.

to_finalconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_fmt_obj(fmtobj, *args, **kwargs)[source]
to_gaussian_gjf(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussiaGJFFormat format.

to_gaussian_log(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussianLogFormat format.

to_gaussian_md(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussianMDFormat format.

to_gro(*args, **kwargs)

Dump data to dpdata.plugins.gromacs.GromacsGroFormat format.

to_gromacs_gro(*args, **kwargs)

Dump data to dpdata.plugins.gromacs.GromacsGroFormat format.

to_lammps_dump(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSDumpFormat format.

to_lammps_lmp(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSLmpFormat format.

to_list(*args, **kwargs)

Dump data to dpdata.plugins.list.ListFormat format.

to_lmp(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSLmpFormat format.

to_mlmd(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_mol(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.MolFormat format.

to_mol_file(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.MolFormat format.

to_movement(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_n2p2(*args, **kwargs)

Dump data to dpdata.plugins.n2p2.N2P2Format format.

to_openmx_md(*args, **kwargs)

Dump data to dpdata.plugins.openmx.OPENMXFormat format.

to_orca_spout(*args, **kwargs)

Dump data to dpdata.plugins.orca.ORCASPOutFormat format.

to_outcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPOutcarFormat format.

to_poscar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_psi4_inp(*args, **kwargs)

Dump data to dpdata.plugins.psi4.PSI4InputFormat format.

to_psi4_out(*args, **kwargs)

Dump data to dpdata.plugins.psi4.PSI4OutFormat format.

to_pwmat_atomconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_pwmat_finalconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_pwmat_mlmd(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pwmat_movement(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pwmat_output(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pymatgen_ComputedStructureEntry(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

to_pymatgen_computedstructureentry(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

to_pymatgen_molecule(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenMoleculeFormat format.

to_pymatgen_structure(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenStructureFormat format.

to_qe_cp_traj(*args, **kwargs)

Dump data to dpdata.plugins.qe.QECPTrajFormat format.

to_qe_pw_scf(*args, **kwargs)

Dump data to dpdata.plugins.qe.QECPPWSCFFormat format.

to_quip_gap_xyz(*args, **kwargs)

Dump data to dpdata.plugins.xyz.QuipGapXYZFormat format.

to_quip_gap_xyz_file(*args, **kwargs)

Dump data to dpdata.plugins.xyz.QuipGapXYZFormat format.

to_sdf(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.SdfFormat format.

to_sdf_file(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.SdfFormat format.

to_siesta_aimd_output(*args, **kwargs)

Dump data to dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

to_siesta_output(*args, **kwargs)

Dump data to dpdata.plugins.siesta.SiestaOutputFormat format.

to_sqm_in(*args, **kwargs)

Dump data to dpdata.plugins.amber.SQMINFormat format.

to_sqm_out(*args, **kwargs)

Dump data to dpdata.plugins.amber.SQMOutFormat format.

to_stru(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSTRUFormat format.

to_vasp_contcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_vasp_outcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPOutcarFormat format.

to_vasp_poscar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_vasp_string(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPStringFormat format.

to_vasp_xml(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPXMLFormat format.

to_xml(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPXMLFormat format.

to_xyz(*args, **kwargs)

Dump data to dpdata.plugins.xyz.XYZFormat format.

class dpdata.system.MultiSystems(*systems, type_map=None)[source]

Bases: object

A set containing several systems.

Methods

append(*systems)

Append systems or MultiSystems to systems.

check_atom_names(system)

Make atom_names in all systems equal, prevent inconsistent atom_types.

correction(hl_sys)

Get energy and force correction between self (assumed low-level) and a high-level MultiSystems.

from_3dmol(file_name, **kwargs)

Read data from dpdata.plugins.3dmol.Py3DMolFormat format.

from_abacus_lcao_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_lcao_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_lcao_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_pw_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_pw_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_pw_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_stru(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSTRUFormat format.

from_amber_md(file_name, **kwargs)

Read data from dpdata.plugins.amber.AmberMDFormat format.

from_ase_structure(file_name, **kwargs)

Read data from dpdata.plugins.ase.ASEStructureFormat format.

from_ase_traj(file_name, **kwargs)

Read data from dpdata.plugins.ase.ASETrajFormat format.

from_atomconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_contcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_cp2k_aimd_output(file_name, **kwargs)

Read data from dpdata.plugins.cp2k.CP2KAIMDOutputFormat format.

from_cp2k_output(file_name, **kwargs)

Read data from dpdata.plugins.cp2k.CP2KOutputFormat format.

from_deepmd(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDRawFormat format.

from_deepmd_comp(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDCompFormat format.

from_deepmd_hdf5(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDHDF5Format format.

from_deepmd_npy(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDCompFormat format.

from_deepmd_npy_mixed(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDMixedFormat format.

from_deepmd_raw(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDRawFormat format.

from_dftbplus(file_name, **kwargs)

Read data from dpdata.plugins.dftbplus.DFTBplusFormat format.

from_dump(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSDumpFormat format.

from_fhi_aims_md(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiMDFormat format.

from_fhi_aims_output(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiMDFormat format.

from_fhi_aims_scf(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiSCFFormat format.

from_finalconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_gaussian_gjf(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussiaGJFFormat format.

from_gaussian_log(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussianLogFormat format.

from_gaussian_md(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussianMDFormat format.

from_gro(file_name, **kwargs)

Read data from dpdata.plugins.gromacs.GromacsGroFormat format.

from_gromacs_gro(file_name, **kwargs)

Read data from dpdata.plugins.gromacs.GromacsGroFormat format.

from_lammps_dump(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSDumpFormat format.

from_lammps_lmp(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSLmpFormat format.

from_list(file_name, **kwargs)

Read data from dpdata.plugins.list.ListFormat format.

from_lmp(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSLmpFormat format.

from_mlmd(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_mol(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.MolFormat format.

from_mol_file(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.MolFormat format.

from_movement(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_n2p2(file_name, **kwargs)

Read data from dpdata.plugins.n2p2.N2P2Format format.

from_openmx_md(file_name, **kwargs)

Read data from dpdata.plugins.openmx.OPENMXFormat format.

from_orca_spout(file_name, **kwargs)

Read data from dpdata.plugins.orca.ORCASPOutFormat format.

from_outcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPOutcarFormat format.

from_poscar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_psi4_inp(file_name, **kwargs)

Read data from dpdata.plugins.psi4.PSI4InputFormat format.

from_psi4_out(file_name, **kwargs)

Read data from dpdata.plugins.psi4.PSI4OutFormat format.

from_pwmat_atomconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_pwmat_finalconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_pwmat_mlmd(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pwmat_movement(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pwmat_output(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pymatgen_computedstructureentry(...)

Read data from dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

from_pymatgen_molecule(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenMoleculeFormat format.

from_pymatgen_structure(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenStructureFormat format.

from_qe_cp_traj(file_name, **kwargs)

Read data from dpdata.plugins.qe.QECPTrajFormat format.

from_qe_pw_scf(file_name, **kwargs)

Read data from dpdata.plugins.qe.QECPPWSCFFormat format.

from_quip_gap_xyz(file_name, **kwargs)

Read data from dpdata.plugins.xyz.QuipGapXYZFormat format.

from_quip_gap_xyz_file(file_name, **kwargs)

Read data from dpdata.plugins.xyz.QuipGapXYZFormat format.

from_sdf(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.SdfFormat format.

from_sdf_file(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.SdfFormat format.

from_siesta_aiMD_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

from_siesta_aimd_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

from_siesta_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaOutputFormat format.

from_sqm_in(file_name, **kwargs)

Read data from dpdata.plugins.amber.SQMINFormat format.

from_sqm_out(file_name, **kwargs)

Read data from dpdata.plugins.amber.SQMOutFormat format.

from_stru(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSTRUFormat format.

from_vasp_contcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_vasp_outcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPOutcarFormat format.

from_vasp_poscar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_vasp_string(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPStringFormat format.

from_vasp_xml(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPXMLFormat format.

from_xml(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPXMLFormat format.

from_xyz(file_name, **kwargs)

Read data from dpdata.plugins.xyz.XYZFormat format.

get_nframes()

Returns number of frames in all systems.

minimize(*args, minimizer, **kwargs)

Minimize geometry by a minimizer.

pick_atom_idx(idx[, nopbc])

Pick atom index.

predict(*args[, driver])

Predict energies and forces by a driver.

to(fmt, *args, **kwargs)

Dump systems to the specific format.

to_3dmol(*args, **kwargs)

Dump data to dpdata.plugins.3dmol.Py3DMolFormat format.

to_abacus_lcao_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_lcao_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_lcao_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_pw_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_pw_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_pw_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_stru(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSTRUFormat format.

to_amber_md(*args, **kwargs)

Dump data to dpdata.plugins.amber.AmberMDFormat format.

to_ase_structure(*args, **kwargs)

Dump data to dpdata.plugins.ase.ASEStructureFormat format.

to_ase_traj(*args, **kwargs)

Dump data to dpdata.plugins.ase.ASETrajFormat format.

to_atomconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_contcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_cp2k_aimd_output(*args, **kwargs)

Dump data to dpdata.plugins.cp2k.CP2KAIMDOutputFormat format.

to_cp2k_output(*args, **kwargs)

Dump data to dpdata.plugins.cp2k.CP2KOutputFormat format.

to_deepmd(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDRawFormat format.

to_deepmd_comp(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDCompFormat format.

to_deepmd_hdf5(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDHDF5Format format.

to_deepmd_npy(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDCompFormat format.

to_deepmd_npy_mixed(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDMixedFormat format.

to_deepmd_raw(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDRawFormat format.

to_dftbplus(*args, **kwargs)

Dump data to dpdata.plugins.dftbplus.DFTBplusFormat format.

to_dump(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSDumpFormat format.

to_fhi_aims_md(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiMDFormat format.

to_fhi_aims_output(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiMDFormat format.

to_fhi_aims_scf(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiSCFFormat format.

to_finalconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_gaussian_gjf(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussiaGJFFormat format.

to_gaussian_log(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussianLogFormat format.

to_gaussian_md(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussianMDFormat format.

to_gro(*args, **kwargs)

Dump data to dpdata.plugins.gromacs.GromacsGroFormat format.

to_gromacs_gro(*args, **kwargs)

Dump data to dpdata.plugins.gromacs.GromacsGroFormat format.

to_lammps_dump(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSDumpFormat format.

to_lammps_lmp(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSLmpFormat format.

to_list(*args, **kwargs)

Dump data to dpdata.plugins.list.ListFormat format.

to_lmp(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSLmpFormat format.

to_mlmd(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_mol(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.MolFormat format.

to_mol_file(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.MolFormat format.

to_movement(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_n2p2(*args, **kwargs)

Dump data to dpdata.plugins.n2p2.N2P2Format format.

to_openmx_md(*args, **kwargs)

Dump data to dpdata.plugins.openmx.OPENMXFormat format.

to_orca_spout(*args, **kwargs)

Dump data to dpdata.plugins.orca.ORCASPOutFormat format.

to_outcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPOutcarFormat format.

to_poscar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_psi4_inp(*args, **kwargs)

Dump data to dpdata.plugins.psi4.PSI4InputFormat format.

to_psi4_out(*args, **kwargs)

Dump data to dpdata.plugins.psi4.PSI4OutFormat format.

to_pwmat_atomconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_pwmat_finalconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_pwmat_mlmd(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pwmat_movement(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pwmat_output(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pymatgen_ComputedStructureEntry(*args, ...)

Dump data to dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

to_pymatgen_computedstructureentry(*args, ...)

Dump data to dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

to_pymatgen_molecule(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenMoleculeFormat format.

to_pymatgen_structure(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenStructureFormat format.

to_qe_cp_traj(*args, **kwargs)

Dump data to dpdata.plugins.qe.QECPTrajFormat format.

to_qe_pw_scf(*args, **kwargs)

Dump data to dpdata.plugins.qe.QECPPWSCFFormat format.

to_quip_gap_xyz(*args, **kwargs)

Dump data to dpdata.plugins.xyz.QuipGapXYZFormat format.

to_quip_gap_xyz_file(*args, **kwargs)

Dump data to dpdata.plugins.xyz.QuipGapXYZFormat format.

to_sdf(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.SdfFormat format.

to_sdf_file(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.SdfFormat format.

to_siesta_aimd_output(*args, **kwargs)

Dump data to dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

to_siesta_output(*args, **kwargs)

Dump data to dpdata.plugins.siesta.SiestaOutputFormat format.

to_sqm_in(*args, **kwargs)

Dump data to dpdata.plugins.amber.SQMINFormat format.

to_sqm_out(*args, **kwargs)

Dump data to dpdata.plugins.amber.SQMOutFormat format.

to_stru(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSTRUFormat format.

to_vasp_contcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_vasp_outcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPOutcarFormat format.

to_vasp_poscar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_vasp_string(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPStringFormat format.

to_vasp_xml(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPXMLFormat format.

to_xml(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPXMLFormat format.

to_xyz(*args, **kwargs)

Dump data to dpdata.plugins.xyz.XYZFormat format.

train_test_split(test_size[, seed])

Split systems into random train and test subsets.

from_dir

from_file

from_fmt_obj

load_systems_from_file

to_fmt_obj

append(*systems)[source]

Append systems or MultiSystems to systems.

Parameters:
*systemsSystem

The system to append

check_atom_names(system)[source]

Make atom_names in all systems equal, prevent inconsistent atom_types.

correction(hl_sys: MultiSystems)[source]

Get energy and force correction between self (assumed low-level) and a high-level MultiSystems. The self’s coordinates will be kept, but energy and forces will be replaced by the correction between these two systems.

Parameters:
hl_sysMultiSystems

high-level MultiSystems

Returns:
corrected_sysMultiSystems

Corrected MultiSystems

Notes

This method will not check whether coordinates and elements of two systems are the same. The user should make sure by itself.

Examples

Get correction between a low-level system and a high-level system:

>>> low_level = dpdata.MultiSystems().from_deepmd_hdf5("low_level.hdf5")
>>> high_level = dpdata.MultiSystems().from_deepmd_hdf5("high_level.hdf5")
>>> corr = low_level.correction(high_lebel)
>>> corr.to_deepmd_hdf5("corr.hdf5")
from_3dmol(file_name, **kwargs)

Read data from dpdata.plugins.3dmol.Py3DMolFormat format.

from_abacus_lcao_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_lcao_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_lcao_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_pw_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_pw_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_pw_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_stru(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSTRUFormat format.

from_amber_md(file_name, **kwargs)

Read data from dpdata.plugins.amber.AmberMDFormat format.

from_ase_structure(file_name, **kwargs)

Read data from dpdata.plugins.ase.ASEStructureFormat format.

from_ase_traj(file_name, **kwargs)

Read data from dpdata.plugins.ase.ASETrajFormat format.

from_atomconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_contcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_cp2k_aimd_output(file_name, **kwargs)

Read data from dpdata.plugins.cp2k.CP2KAIMDOutputFormat format.

from_cp2k_output(file_name, **kwargs)

Read data from dpdata.plugins.cp2k.CP2KOutputFormat format.

from_deepmd(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDRawFormat format.

from_deepmd_comp(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDCompFormat format.

from_deepmd_hdf5(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDHDF5Format format.

from_deepmd_npy(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDCompFormat format.

from_deepmd_npy_mixed(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDMixedFormat format.

from_deepmd_raw(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDRawFormat format.

from_dftbplus(file_name, **kwargs)

Read data from dpdata.plugins.dftbplus.DFTBplusFormat format.

classmethod from_dir(dir_name, file_name, fmt='auto', type_map=None)[source]
from_dump(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSDumpFormat format.

from_fhi_aims_md(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiMDFormat format.

from_fhi_aims_output(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiMDFormat format.

from_fhi_aims_scf(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiSCFFormat format.

classmethod from_file(file_name, fmt, **kwargs)[source]
from_finalconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_fmt_obj(fmtobj, directory, labeled=True, **kwargs)[source]
from_gaussian_gjf(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussiaGJFFormat format.

from_gaussian_log(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussianLogFormat format.

from_gaussian_md(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussianMDFormat format.

from_gro(file_name, **kwargs)

Read data from dpdata.plugins.gromacs.GromacsGroFormat format.

from_gromacs_gro(file_name, **kwargs)

Read data from dpdata.plugins.gromacs.GromacsGroFormat format.

from_lammps_dump(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSDumpFormat format.

from_lammps_lmp(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSLmpFormat format.

from_list(file_name, **kwargs)

Read data from dpdata.plugins.list.ListFormat format.

from_lmp(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSLmpFormat format.

from_mlmd(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_mol(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.MolFormat format.

from_mol_file(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.MolFormat format.

from_movement(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_n2p2(file_name, **kwargs)

Read data from dpdata.plugins.n2p2.N2P2Format format.

from_openmx_md(file_name, **kwargs)

Read data from dpdata.plugins.openmx.OPENMXFormat format.

from_orca_spout(file_name, **kwargs)

Read data from dpdata.plugins.orca.ORCASPOutFormat format.

from_outcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPOutcarFormat format.

from_poscar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_psi4_inp(file_name, **kwargs)

Read data from dpdata.plugins.psi4.PSI4InputFormat format.

from_psi4_out(file_name, **kwargs)

Read data from dpdata.plugins.psi4.PSI4OutFormat format.

from_pwmat_atomconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_pwmat_finalconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_pwmat_mlmd(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pwmat_movement(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pwmat_output(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pymatgen_computedstructureentry(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

from_pymatgen_molecule(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenMoleculeFormat format.

from_pymatgen_structure(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenStructureFormat format.

from_qe_cp_traj(file_name, **kwargs)

Read data from dpdata.plugins.qe.QECPTrajFormat format.

from_qe_pw_scf(file_name, **kwargs)

Read data from dpdata.plugins.qe.QECPPWSCFFormat format.

from_quip_gap_xyz(file_name, **kwargs)

Read data from dpdata.plugins.xyz.QuipGapXYZFormat format.

from_quip_gap_xyz_file(file_name, **kwargs)

Read data from dpdata.plugins.xyz.QuipGapXYZFormat format.

from_sdf(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.SdfFormat format.

from_sdf_file(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.SdfFormat format.

from_siesta_aiMD_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

from_siesta_aimd_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

from_siesta_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaOutputFormat format.

from_sqm_in(file_name, **kwargs)

Read data from dpdata.plugins.amber.SQMINFormat format.

from_sqm_out(file_name, **kwargs)

Read data from dpdata.plugins.amber.SQMOutFormat format.

from_stru(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSTRUFormat format.

from_vasp_contcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_vasp_outcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPOutcarFormat format.

from_vasp_poscar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_vasp_string(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPStringFormat format.

from_vasp_xml(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPXMLFormat format.

from_xml(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPXMLFormat format.

from_xyz(file_name, **kwargs)

Read data from dpdata.plugins.xyz.XYZFormat format.

get_nframes()[source]

Returns number of frames in all systems.

load_systems_from_file(file_name=None, fmt=None, **kwargs)[source]
minimize(*args: Any, minimizer: str | Minimizer, **kwargs: Any) MultiSystems[source]

Minimize geometry by a minimizer.

Parameters:
*argsiterable

Arguments passing to the minimizer

minimizerstr or Minimizer

The assigned minimizer

**kwargsdict

Other arguments passing to the minimizer

Returns:
MultiSystems

A new labeled MultiSystems.

Examples

Minimize a system using ASE BFGS along with a DP driver:

>>> from dpdata.driver import Driver
>>> from ase.optimize import BFGS
>>> driver = Driver.get_driver("dp")("some_model.pb")
>>> some_system.minimize(minimizer="ase", driver=driver, optimizer=BFGS, fmax=1e-5)
pick_atom_idx(idx, nopbc=None)[source]

Pick atom index.

Parameters:
idxint or list or slice

atom index

nopbcBoolen (default: None)

If nopbc is True or False, set nopbc

Returns:
new_sys: MultiSystems

new system

predict(*args: Any, driver='dp', **kwargs: Any) MultiSystems[source]

Predict energies and forces by a driver.

Parameters:
*argsiterable

Arguments passing to the driver

driverstr, default=dp

The assigned driver. For compatibility, default is dp

**kwargsdict

Other arguments passing to the driver

Returns:
MultiSystems

A new labeled MultiSystems.

to(fmt: str, *args, **kwargs) MultiSystems[source]

Dump systems to the specific format.

Parameters:
fmtstr

format

*argslist

arguments

**kwargsdict

keyword arguments

Returns:
MultiSystems

self

to_3dmol(*args, **kwargs)

Dump data to dpdata.plugins.3dmol.Py3DMolFormat format.

to_abacus_lcao_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_lcao_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_lcao_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_pw_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_pw_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_pw_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_stru(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSTRUFormat format.

to_amber_md(*args, **kwargs)

Dump data to dpdata.plugins.amber.AmberMDFormat format.

to_ase_structure(*args, **kwargs)

Dump data to dpdata.plugins.ase.ASEStructureFormat format.

to_ase_traj(*args, **kwargs)

Dump data to dpdata.plugins.ase.ASETrajFormat format.

to_atomconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_contcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_cp2k_aimd_output(*args, **kwargs)

Dump data to dpdata.plugins.cp2k.CP2KAIMDOutputFormat format.

to_cp2k_output(*args, **kwargs)

Dump data to dpdata.plugins.cp2k.CP2KOutputFormat format.

to_deepmd(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDRawFormat format.

to_deepmd_comp(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDCompFormat format.

to_deepmd_hdf5(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDHDF5Format format.

to_deepmd_npy(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDCompFormat format.

to_deepmd_npy_mixed(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDMixedFormat format.

to_deepmd_raw(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDRawFormat format.

to_dftbplus(*args, **kwargs)

Dump data to dpdata.plugins.dftbplus.DFTBplusFormat format.

to_dump(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSDumpFormat format.

to_fhi_aims_md(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiMDFormat format.

to_fhi_aims_output(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiMDFormat format.

to_fhi_aims_scf(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiSCFFormat format.

to_finalconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_fmt_obj(fmtobj, directory, *args, **kwargs)[source]
to_gaussian_gjf(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussiaGJFFormat format.

to_gaussian_log(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussianLogFormat format.

to_gaussian_md(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussianMDFormat format.

to_gro(*args, **kwargs)

Dump data to dpdata.plugins.gromacs.GromacsGroFormat format.

to_gromacs_gro(*args, **kwargs)

Dump data to dpdata.plugins.gromacs.GromacsGroFormat format.

to_lammps_dump(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSDumpFormat format.

to_lammps_lmp(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSLmpFormat format.

to_list(*args, **kwargs)

Dump data to dpdata.plugins.list.ListFormat format.

to_lmp(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSLmpFormat format.

to_mlmd(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_mol(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.MolFormat format.

to_mol_file(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.MolFormat format.

to_movement(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_n2p2(*args, **kwargs)

Dump data to dpdata.plugins.n2p2.N2P2Format format.

to_openmx_md(*args, **kwargs)

Dump data to dpdata.plugins.openmx.OPENMXFormat format.

to_orca_spout(*args, **kwargs)

Dump data to dpdata.plugins.orca.ORCASPOutFormat format.

to_outcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPOutcarFormat format.

to_poscar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_psi4_inp(*args, **kwargs)

Dump data to dpdata.plugins.psi4.PSI4InputFormat format.

to_psi4_out(*args, **kwargs)

Dump data to dpdata.plugins.psi4.PSI4OutFormat format.

to_pwmat_atomconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_pwmat_finalconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_pwmat_mlmd(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pwmat_movement(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pwmat_output(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pymatgen_ComputedStructureEntry(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

to_pymatgen_computedstructureentry(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

to_pymatgen_molecule(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenMoleculeFormat format.

to_pymatgen_structure(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenStructureFormat format.

to_qe_cp_traj(*args, **kwargs)

Dump data to dpdata.plugins.qe.QECPTrajFormat format.

to_qe_pw_scf(*args, **kwargs)

Dump data to dpdata.plugins.qe.QECPPWSCFFormat format.

to_quip_gap_xyz(*args, **kwargs)

Dump data to dpdata.plugins.xyz.QuipGapXYZFormat format.

to_quip_gap_xyz_file(*args, **kwargs)

Dump data to dpdata.plugins.xyz.QuipGapXYZFormat format.

to_sdf(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.SdfFormat format.

to_sdf_file(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.SdfFormat format.

to_siesta_aimd_output(*args, **kwargs)

Dump data to dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

to_siesta_output(*args, **kwargs)

Dump data to dpdata.plugins.siesta.SiestaOutputFormat format.

to_sqm_in(*args, **kwargs)

Dump data to dpdata.plugins.amber.SQMINFormat format.

to_sqm_out(*args, **kwargs)

Dump data to dpdata.plugins.amber.SQMOutFormat format.

to_stru(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSTRUFormat format.

to_vasp_contcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_vasp_outcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPOutcarFormat format.

to_vasp_poscar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_vasp_string(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPStringFormat format.

to_vasp_xml(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPXMLFormat format.

to_xml(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPXMLFormat format.

to_xyz(*args, **kwargs)

Dump data to dpdata.plugins.xyz.XYZFormat format.

train_test_split(test_size: float | int, seed: int | None = None) Tuple[MultiSystems, MultiSystems, Dict[str, ndarray]][source]

Split systems into random train and test subsets.

Parameters:
test_sizefloat or int

If float, should be between 0.0 and 1.0 and represent the proportion of the dataset to include in the test split. If int, represents the absolute number of test samples.

seedint, default=None

Random seed

Returns:
MultiSystems

The training set

MultiSystems

The testing set

Dict[str, np.ndarray]

The bool array of training and testing sets for each system. False for training set and True for testing set.

class dpdata.system.System(file_name=None, fmt='auto', type_map=None, begin=0, step=1, data=None, convergence_check=True, **kwargs)[source]

Bases: MSONable

The data System.

A data System (a concept used by deepmd-kit) contains frames (e.g. produced by an MD simulation) that has the same number of atoms of the same type. The order of the atoms should be consistent among the frames in one System.

For example, a water system named d_example has two molecules. The properties can be accessed by
  • d_example[‘atom_numbs’] : [2, 4]

  • d_example[‘atom_names’] : [‘O’, ‘H’]

  • d_example[‘atom_types’] : [0, 1, 1, 0, 1, 1]

  • d_example[‘orig’] : [0, 0, 0]

  • d_example[‘cells’] : a numpy array of size nframes x 3 x 3

  • d_example[‘coords’] : a numpy array of size nframes x natoms x 3

It is noted that
  • The order of frames stored in ‘atom_types’, ‘cells’ and ‘coords’ should be consistent.

  • The order of atoms in all frames of ‘atom_types’ and ‘coords’ should be consistent.

Restrictions:
  • d_example[‘orig’] is always [0, 0, 0]

  • d_example[‘cells’][ii] is always lower triangular (lammps cell tensor convention)

Attributes:
DTYPEStuple[DataType]

data types of this class

Methods

add_atom_names(atom_names)

Add atom_names that do not exist.

append(system)

Append a system to this system.

apply_pbc()

Append periodic boundary condition.

as_dict()

Returns data dict of System instance.

check_data()

Check if data is correct.

check_type_map(type_map)

Assign atom_names to type_map if type_map is given and different from atom_names.

convert_to_mixed_type([type_map])

Convert the data dict to mixed type format structure, in order to append systems with different formula but the same number of atoms.

copy()

Returns a copy of the system.

dump(filename[, indent])

Dump .json or .yaml file.

extend(systems)

Extend a system list to this system.

from_3dmol(file_name, **kwargs)

Read data from dpdata.plugins.3dmol.Py3DMolFormat format.

from_abacus_lcao_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_lcao_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_lcao_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_pw_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_pw_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_pw_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_stru(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSTRUFormat format.

from_amber_md(file_name, **kwargs)

Read data from dpdata.plugins.amber.AmberMDFormat format.

from_ase_structure(file_name, **kwargs)

Read data from dpdata.plugins.ase.ASEStructureFormat format.

from_ase_traj(file_name, **kwargs)

Read data from dpdata.plugins.ase.ASETrajFormat format.

from_atomconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_contcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_cp2k_aimd_output(file_name, **kwargs)

Read data from dpdata.plugins.cp2k.CP2KAIMDOutputFormat format.

from_cp2k_output(file_name, **kwargs)

Read data from dpdata.plugins.cp2k.CP2KOutputFormat format.

from_deepmd(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDRawFormat format.

from_deepmd_comp(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDCompFormat format.

from_deepmd_hdf5(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDHDF5Format format.

from_deepmd_npy(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDCompFormat format.

from_deepmd_npy_mixed(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDMixedFormat format.

from_deepmd_raw(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDRawFormat format.

from_dftbplus(file_name, **kwargs)

Read data from dpdata.plugins.dftbplus.DFTBplusFormat format.

from_dict(d)

param d:

Dict representation.

from_dump(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSDumpFormat format.

from_fhi_aims_md(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiMDFormat format.

from_fhi_aims_output(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiMDFormat format.

from_fhi_aims_scf(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiSCFFormat format.

from_finalconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_gaussian_gjf(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussiaGJFFormat format.

from_gaussian_log(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussianLogFormat format.

from_gaussian_md(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussianMDFormat format.

from_gro(file_name, **kwargs)

Read data from dpdata.plugins.gromacs.GromacsGroFormat format.

from_gromacs_gro(file_name, **kwargs)

Read data from dpdata.plugins.gromacs.GromacsGroFormat format.

from_lammps_dump(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSDumpFormat format.

from_lammps_lmp(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSLmpFormat format.

from_list(file_name, **kwargs)

Read data from dpdata.plugins.list.ListFormat format.

from_lmp(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSLmpFormat format.

from_mlmd(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_mol(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.MolFormat format.

from_mol_file(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.MolFormat format.

from_movement(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_n2p2(file_name, **kwargs)

Read data from dpdata.plugins.n2p2.N2P2Format format.

from_openmx_md(file_name, **kwargs)

Read data from dpdata.plugins.openmx.OPENMXFormat format.

from_orca_spout(file_name, **kwargs)

Read data from dpdata.plugins.orca.ORCASPOutFormat format.

from_outcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPOutcarFormat format.

from_poscar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_psi4_inp(file_name, **kwargs)

Read data from dpdata.plugins.psi4.PSI4InputFormat format.

from_psi4_out(file_name, **kwargs)

Read data from dpdata.plugins.psi4.PSI4OutFormat format.

from_pwmat_atomconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_pwmat_finalconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_pwmat_mlmd(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pwmat_movement(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pwmat_output(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pymatgen_computedstructureentry(...)

Read data from dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

from_pymatgen_molecule(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenMoleculeFormat format.

from_pymatgen_structure(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenStructureFormat format.

from_qe_cp_traj(file_name, **kwargs)

Read data from dpdata.plugins.qe.QECPTrajFormat format.

from_qe_pw_scf(file_name, **kwargs)

Read data from dpdata.plugins.qe.QECPPWSCFFormat format.

from_quip_gap_xyz(file_name, **kwargs)

Read data from dpdata.plugins.xyz.QuipGapXYZFormat format.

from_quip_gap_xyz_file(file_name, **kwargs)

Read data from dpdata.plugins.xyz.QuipGapXYZFormat format.

from_sdf(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.SdfFormat format.

from_sdf_file(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.SdfFormat format.

from_siesta_aiMD_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

from_siesta_aimd_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

from_siesta_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaOutputFormat format.

from_sqm_in(file_name, **kwargs)

Read data from dpdata.plugins.amber.SQMINFormat format.

from_sqm_out(file_name, **kwargs)

Read data from dpdata.plugins.amber.SQMOutFormat format.

from_stru(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSTRUFormat format.

from_vasp_contcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_vasp_outcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPOutcarFormat format.

from_vasp_poscar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_vasp_string(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPStringFormat format.

from_vasp_xml(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPXMLFormat format.

from_xml(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPXMLFormat format.

from_xyz(file_name, **kwargs)

Read data from dpdata.plugins.xyz.XYZFormat format.

get_atom_names()

Returns name of atoms.

get_atom_numbs()

Returns number of atoms.

get_atom_types()

Returns type of atoms.

get_natoms()

Returns total number of atoms in the system.

get_nframes()

Returns number of frames in the system.

get_ntypes()

Returns total number of atom types in the system.

load(filename)

Rebuild System obj.

map_atom_types([type_map])

Map the atom types of the system.

minimize(*args, minimizer, **kwargs)

Minimize the geometry.

perturb(pert_num, cell_pert_fraction, ...[, ...])

Perturb each frame in the system randomly.

pick_atom_idx(idx[, nopbc])

Pick atom index.

pick_by_amber_mask(param, maskstr[, ...])

Pick atoms by amber mask.

predict(*args[, driver])

Predict energies and forces by a driver.

register_data_type(*data_type)

Register data type.

remove_atom_names(atom_names)

Remove atom names and all such atoms.

remove_pbc([protect_layer])

This method does NOT delete the definition of the cells, it (1) revises the cell to a cubic cell and ensures that the cell boundary to any atom in the system is no less than protect_layer (2) translates the system such that the center-of-geometry of the system locates at the center of the cell.

replicate(ncopy)

Replicate the each frame in the system in 3 dimensions.

shuffle()

Shuffle frames randomly.

sort_atom_names([type_map])

Sort atom_names of the system and reorder atom_numbs and atom_types accoarding to atom_names.

sort_atom_types()

Sort atom types.

sub_system(f_idx)

Construct a subsystem from the system.

to(fmt, *args, **kwargs)

Dump systems to the specific format.

to_3dmol(*args, **kwargs)

Dump data to dpdata.plugins.3dmol.Py3DMolFormat format.

to_abacus_lcao_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_lcao_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_lcao_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_pw_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_pw_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_pw_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_stru(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSTRUFormat format.

to_amber_md(*args, **kwargs)

Dump data to dpdata.plugins.amber.AmberMDFormat format.

to_ase_structure(*args, **kwargs)

Dump data to dpdata.plugins.ase.ASEStructureFormat format.

to_ase_traj(*args, **kwargs)

Dump data to dpdata.plugins.ase.ASETrajFormat format.

to_atomconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_contcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_cp2k_aimd_output(*args, **kwargs)

Dump data to dpdata.plugins.cp2k.CP2KAIMDOutputFormat format.

to_cp2k_output(*args, **kwargs)

Dump data to dpdata.plugins.cp2k.CP2KOutputFormat format.

to_deepmd(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDRawFormat format.

to_deepmd_comp(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDCompFormat format.

to_deepmd_hdf5(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDHDF5Format format.

to_deepmd_npy(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDCompFormat format.

to_deepmd_npy_mixed(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDMixedFormat format.

to_deepmd_raw(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDRawFormat format.

to_dftbplus(*args, **kwargs)

Dump data to dpdata.plugins.dftbplus.DFTBplusFormat format.

to_dump(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSDumpFormat format.

to_fhi_aims_md(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiMDFormat format.

to_fhi_aims_output(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiMDFormat format.

to_fhi_aims_scf(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiSCFFormat format.

to_finalconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_gaussian_gjf(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussiaGJFFormat format.

to_gaussian_log(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussianLogFormat format.

to_gaussian_md(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussianMDFormat format.

to_gro(*args, **kwargs)

Dump data to dpdata.plugins.gromacs.GromacsGroFormat format.

to_gromacs_gro(*args, **kwargs)

Dump data to dpdata.plugins.gromacs.GromacsGroFormat format.

to_json()

Returns a json string representation of the MSONable object.

to_lammps_dump(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSDumpFormat format.

to_lammps_lmp(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSLmpFormat format.

to_list(*args, **kwargs)

Dump data to dpdata.plugins.list.ListFormat format.

to_lmp(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSLmpFormat format.

to_mlmd(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_mol(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.MolFormat format.

to_mol_file(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.MolFormat format.

to_movement(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_n2p2(*args, **kwargs)

Dump data to dpdata.plugins.n2p2.N2P2Format format.

to_openmx_md(*args, **kwargs)

Dump data to dpdata.plugins.openmx.OPENMXFormat format.

to_orca_spout(*args, **kwargs)

Dump data to dpdata.plugins.orca.ORCASPOutFormat format.

to_outcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPOutcarFormat format.

to_poscar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_psi4_inp(*args, **kwargs)

Dump data to dpdata.plugins.psi4.PSI4InputFormat format.

to_psi4_out(*args, **kwargs)

Dump data to dpdata.plugins.psi4.PSI4OutFormat format.

to_pwmat_atomconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_pwmat_finalconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_pwmat_mlmd(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pwmat_movement(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pwmat_output(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pymatgen_ComputedStructureEntry(*args, ...)

Dump data to dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

to_pymatgen_computedstructureentry(*args, ...)

Dump data to dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

to_pymatgen_molecule(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenMoleculeFormat format.

to_pymatgen_structure(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenStructureFormat format.

to_qe_cp_traj(*args, **kwargs)

Dump data to dpdata.plugins.qe.QECPTrajFormat format.

to_qe_pw_scf(*args, **kwargs)

Dump data to dpdata.plugins.qe.QECPPWSCFFormat format.

to_quip_gap_xyz(*args, **kwargs)

Dump data to dpdata.plugins.xyz.QuipGapXYZFormat format.

to_quip_gap_xyz_file(*args, **kwargs)

Dump data to dpdata.plugins.xyz.QuipGapXYZFormat format.

to_sdf(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.SdfFormat format.

to_sdf_file(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.SdfFormat format.

to_siesta_aimd_output(*args, **kwargs)

Dump data to dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

to_siesta_output(*args, **kwargs)

Dump data to dpdata.plugins.siesta.SiestaOutputFormat format.

to_sqm_in(*args, **kwargs)

Dump data to dpdata.plugins.amber.SQMINFormat format.

to_sqm_out(*args, **kwargs)

Dump data to dpdata.plugins.amber.SQMOutFormat format.

to_stru(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSTRUFormat format.

to_vasp_contcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_vasp_outcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPOutcarFormat format.

to_vasp_poscar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_vasp_string(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPStringFormat format.

to_vasp_xml(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPXMLFormat format.

to_xml(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPXMLFormat format.

to_xyz(*args, **kwargs)

Dump data to dpdata.plugins.xyz.XYZFormat format.

unsafe_hash()

Returns an hash of the current object.

validate_monty_v1(_MSONable__input_value)

Pydantic validator with correct signature for pydantic v1.x

validate_monty_v2(_MSONable__input_value, _)

Pydantic validator with correct signature for pydantic v2.x

affine_map

apply_type_map

from_fmt

from_fmt_obj

replace

rot_frame_lower_triangular

rot_lower_triangular

to_fmt_obj

DTYPES = (<dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>, <dpdata.data_type.DataType object>)
add_atom_names(atom_names)[source]

Add atom_names that do not exist.

affine_map(trans, f_idx=0)[source]
append(system)[source]

Append a system to this system.

Parameters:
systemSystem

The system to append

apply_pbc()[source]

Append periodic boundary condition.

apply_type_map(type_map)[source]
as_dict()[source]

Returns data dict of System instance.

check_data()[source]

Check if data is correct.

Raises:
DataError

if data is not correct

check_type_map(type_map)[source]

Assign atom_names to type_map if type_map is given and different from atom_names.

Parameters:
type_maplist

type_map

convert_to_mixed_type(type_map=None)[source]

Convert the data dict to mixed type format structure, in order to append systems with different formula but the same number of atoms. Change the ‘atom_names’ to one placeholder type ‘MIXED_TOKEN’ and add ‘real_atom_types’ to store the real type vectors according to the given type_map.

Parameters:
type_maplist

type_map

copy()[source]

Returns a copy of the system.

dump(filename, indent=4)[source]

Dump .json or .yaml file.

extend(systems)[source]

Extend a system list to this system.

Parameters:
systems[System1, System2, System3 ]

The list to extend

property formula

Return the formula of this system, like C3H5O2.

property formula_hash: str

Return the hash of the formula of this system.

from_3dmol(file_name, **kwargs)

Read data from dpdata.plugins.3dmol.Py3DMolFormat format.

from_abacus_lcao_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_lcao_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_lcao_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_pw_md(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusMDFormat format.

from_abacus_pw_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_pw_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_relax(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusRelaxFormat format.

from_abacus_scf(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSCFFormat format.

from_abacus_stru(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSTRUFormat format.

from_amber_md(file_name, **kwargs)

Read data from dpdata.plugins.amber.AmberMDFormat format.

from_ase_structure(file_name, **kwargs)

Read data from dpdata.plugins.ase.ASEStructureFormat format.

from_ase_traj(file_name, **kwargs)

Read data from dpdata.plugins.ase.ASETrajFormat format.

from_atomconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_contcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_cp2k_aimd_output(file_name, **kwargs)

Read data from dpdata.plugins.cp2k.CP2KAIMDOutputFormat format.

from_cp2k_output(file_name, **kwargs)

Read data from dpdata.plugins.cp2k.CP2KOutputFormat format.

from_deepmd(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDRawFormat format.

from_deepmd_comp(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDCompFormat format.

from_deepmd_hdf5(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDHDF5Format format.

from_deepmd_npy(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDCompFormat format.

from_deepmd_npy_mixed(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDMixedFormat format.

from_deepmd_raw(file_name, **kwargs)

Read data from dpdata.plugins.deepmd.DeePMDRawFormat format.

from_dftbplus(file_name, **kwargs)

Read data from dpdata.plugins.dftbplus.DFTBplusFormat format.

from_dump(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSDumpFormat format.

from_fhi_aims_md(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiMDFormat format.

from_fhi_aims_output(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiMDFormat format.

from_fhi_aims_scf(file_name, **kwargs)

Read data from dpdata.plugins.fhi_aims.FhiSCFFormat format.

from_finalconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_fmt(file_name, fmt='auto', **kwargs)[source]
from_fmt_obj(fmtobj, file_name, **kwargs)[source]
from_gaussian_gjf(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussiaGJFFormat format.

from_gaussian_log(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussianLogFormat format.

from_gaussian_md(file_name, **kwargs)

Read data from dpdata.plugins.gaussian.GaussianMDFormat format.

from_gro(file_name, **kwargs)

Read data from dpdata.plugins.gromacs.GromacsGroFormat format.

from_gromacs_gro(file_name, **kwargs)

Read data from dpdata.plugins.gromacs.GromacsGroFormat format.

from_lammps_dump(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSDumpFormat format.

from_lammps_lmp(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSLmpFormat format.

from_list(file_name, **kwargs)

Read data from dpdata.plugins.list.ListFormat format.

from_lmp(file_name, **kwargs)

Read data from dpdata.plugins.lammps.LAMMPSLmpFormat format.

from_mlmd(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_mol(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.MolFormat format.

from_mol_file(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.MolFormat format.

from_movement(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_n2p2(file_name, **kwargs)

Read data from dpdata.plugins.n2p2.N2P2Format format.

from_openmx_md(file_name, **kwargs)

Read data from dpdata.plugins.openmx.OPENMXFormat format.

from_orca_spout(file_name, **kwargs)

Read data from dpdata.plugins.orca.ORCASPOutFormat format.

from_outcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPOutcarFormat format.

from_poscar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_psi4_inp(file_name, **kwargs)

Read data from dpdata.plugins.psi4.PSI4InputFormat format.

from_psi4_out(file_name, **kwargs)

Read data from dpdata.plugins.psi4.PSI4OutFormat format.

from_pwmat_atomconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_pwmat_finalconfig(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

from_pwmat_mlmd(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pwmat_movement(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pwmat_output(file_name, **kwargs)

Read data from dpdata.plugins.pwmat.PwmatOutputFormat format.

from_pymatgen_computedstructureentry(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

from_pymatgen_molecule(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenMoleculeFormat format.

from_pymatgen_structure(file_name, **kwargs)

Read data from dpdata.plugins.pymatgen.PyMatgenStructureFormat format.

from_qe_cp_traj(file_name, **kwargs)

Read data from dpdata.plugins.qe.QECPTrajFormat format.

from_qe_pw_scf(file_name, **kwargs)

Read data from dpdata.plugins.qe.QECPPWSCFFormat format.

from_quip_gap_xyz(file_name, **kwargs)

Read data from dpdata.plugins.xyz.QuipGapXYZFormat format.

from_quip_gap_xyz_file(file_name, **kwargs)

Read data from dpdata.plugins.xyz.QuipGapXYZFormat format.

from_sdf(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.SdfFormat format.

from_sdf_file(file_name, **kwargs)

Read data from dpdata.plugins.rdkit.SdfFormat format.

from_siesta_aiMD_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

from_siesta_aimd_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

from_siesta_output(file_name, **kwargs)

Read data from dpdata.plugins.siesta.SiestaOutputFormat format.

from_sqm_in(file_name, **kwargs)

Read data from dpdata.plugins.amber.SQMINFormat format.

from_sqm_out(file_name, **kwargs)

Read data from dpdata.plugins.amber.SQMOutFormat format.

from_stru(file_name, **kwargs)

Read data from dpdata.plugins.abacus.AbacusSTRUFormat format.

from_vasp_contcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_vasp_outcar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPOutcarFormat format.

from_vasp_poscar(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPPoscarFormat format.

from_vasp_string(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPStringFormat format.

from_vasp_xml(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPXMLFormat format.

from_xml(file_name, **kwargs)

Read data from dpdata.plugins.vasp.VASPXMLFormat format.

from_xyz(file_name, **kwargs)

Read data from dpdata.plugins.xyz.XYZFormat format.

get_atom_names()[source]

Returns name of atoms.

get_atom_numbs()[source]

Returns number of atoms.

get_atom_types()[source]

Returns type of atoms.

get_natoms()[source]

Returns total number of atoms in the system.

get_nframes()[source]

Returns number of frames in the system.

get_ntypes() int[source]

Returns total number of atom types in the system.

static load(filename)[source]

Rebuild System obj. from .json or .yaml file.

map_atom_types(type_map=None) ndarray[source]

Map the atom types of the system.

Parameters:
type_map

dict : {“H”:0,”O”:1} or list [“H”,”C”,”O”,”N”] The map between elements and index if no map_dict is given, index will be set according to atomic number

Returns:
new_atom_typesnp.ndarray

The mapped atom types

minimize(*args: Any, minimizer: str | Minimizer, **kwargs: Any) LabeledSystem[source]

Minimize the geometry.

Parameters:
*argsiterable

Arguments passing to the minimizer

minimizerstr or Minimizer

The assigned minimizer

**kwargsdict

Other arguments passing to the minimizer

Returns:
labeled_sysLabeledSystem

A new labeled system.

property nopbc
perturb(pert_num, cell_pert_fraction, atom_pert_distance, atom_pert_style='normal')[source]

Perturb each frame in the system randomly. The cell will be deformed randomly, and atoms will be displaced by a random distance in random direction.

Parameters:
pert_numint

Each frame in the system will make pert_num copies, and all the copies will be perturbed. That means the system to be returned will contain pert_num * frame_num of the input system.

cell_pert_fractionfloat

A fraction determines how much (relatively) will cell deform. The cell of each frame is deformed by a symmetric matrix perturbed from identity. The perturbation to the diagonal part is subject to a uniform distribution in [-cell_pert_fraction, cell_pert_fraction), and the perturbation to the off-diagonal part is subject to a uniform distribution in [-0.5*cell_pert_fraction, 0.5*cell_pert_fraction).

atom_pert_distancefloat

unit: Angstrom. A distance determines how far atoms will move. Atoms will move about atom_pert_distance in random direction. The distribution of the distance atoms move is determined by atom_pert_style

atom_pert_stylestr

Determines the distribution of the distance atoms move is subject to. Avaliable options are

  • ‘normal’: the distance will be object to chi-square distribution with 3 degrees of freedom after normalization.

    The mean value of the distance is atom_pert_fraction*side_length

  • ‘uniform’: will generate uniformly random points in a 3D-balls with radius as atom_pert_distance.

    These points are treated as vector used by atoms to move. Obviously, the max length of the distance atoms move is atom_pert_distance.

  • ‘const’: The distance atoms move will be a constant atom_pert_distance.

Returns:
perturbed_systemSystem

The perturbed_system. It contains pert_num * frame_num of the input system frames.

pick_atom_idx(idx, nopbc=None)[source]

Pick atom index.

Parameters:
idxint or list or slice

atom index

nopbcBoolen (default: None)

If nopbc is True or False, set nopbc

Returns:
new_sys: System

new system

pick_by_amber_mask(param, maskstr, pass_coords=False, nopbc=None)[source]

Pick atoms by amber mask.

Parameters:
paramstr or parmed.Structure

filename of Amber param file or parmed.Structure

maskstrstr

Amber masks

pass_coordsBoolen (default: False)

If pass_coords is true, the function will pass coordinates and return a MultiSystem. Otherwise, the result is coordinate-independent, and the function will return System or LabeledSystem.

nopbcBoolen (default: None)

If nopbc is True or False, set nopbc

post_funcs = <dpdata.plugin.Plugin object>
predict(*args: Any, driver: str = 'dp', **kwargs: Any) LabeledSystem[source]

Predict energies and forces by a driver.

Parameters:
*argsiterable

Arguments passing to the driver

driverstr, default=dp

The assigned driver. For compatibility, default is dp

**kwargsdict

Other arguments passing to the driver

Returns:
labeled_sysLabeledSystem

A new labeled system.

Examples

The default driver is DP:

>>> labeled_sys = ori_sys.predict("frozen_model_compressed.pb")
classmethod register_data_type(*data_type: Tuple[DataType])[source]

Register data type.

Parameters:
*data_typetuple[DataType]

data type to be regiestered

remove_atom_names(atom_names)[source]

Remove atom names and all such atoms. For example, you may not remove EP atoms in TIP4P/Ew water, which is not a real atom.

remove_pbc(protect_layer=9)[source]

This method does NOT delete the definition of the cells, it (1) revises the cell to a cubic cell and ensures that the cell boundary to any atom in the system is no less than protect_layer (2) translates the system such that the center-of-geometry of the system locates at the center of the cell.

Parameters:
protect_layerthe protect layer between the atoms and the cell

boundary

replace(initial_atom_type, end_atom_type, replace_num)[source]
replicate(ncopy)[source]

Replicate the each frame in the system in 3 dimensions. Each frame in the system will become a supercell.

Parameters:
ncopy

list: [4,2,3] or tuple: (4,2,3,) make ncopy[0] copys in x dimensions, make ncopy[1] copys in y dimensions, make ncopy[2] copys in z dimensions.

Returns:
tmpSystem

The system after replication.

rot_frame_lower_triangular(f_idx=0)[source]
rot_lower_triangular()[source]
property short_formula: str

Return the short formula of this system. Elements with zero number will be removed.

property short_name: str

Return the short name of this system (no more than 255 bytes), in the following order:

  • formula

  • short_formula

  • formula_hash.

shuffle()[source]

Shuffle frames randomly.

sort_atom_names(type_map=None)[source]

Sort atom_names of the system and reorder atom_numbs and atom_types accoarding to atom_names. If type_map is not given, atom_names will be sorted by alphabetical order. If type_map is given, atom_names will be type_map.

Parameters:
type_maplist

type_map

sort_atom_types() ndarray[source]

Sort atom types.

Returns:
idxnp.ndarray

new atom index in the Axis.NATOMS

sub_system(f_idx)[source]

Construct a subsystem from the system.

Parameters:
f_idxint or index

Which frame to use in the subsystem

Returns:
sub_systemSystem

The subsystem

to(fmt: str, *args, **kwargs) System[source]

Dump systems to the specific format.

Parameters:
fmtstr

format

*args

arguments

**kwargs

keyword arguments

Returns:
System

self

to_3dmol(*args, **kwargs)

Dump data to dpdata.plugins.3dmol.Py3DMolFormat format.

to_abacus_lcao_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_lcao_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_lcao_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_pw_md(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusMDFormat format.

to_abacus_pw_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_pw_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_relax(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusRelaxFormat format.

to_abacus_scf(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSCFFormat format.

to_abacus_stru(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSTRUFormat format.

to_amber_md(*args, **kwargs)

Dump data to dpdata.plugins.amber.AmberMDFormat format.

to_ase_structure(*args, **kwargs)

Dump data to dpdata.plugins.ase.ASEStructureFormat format.

to_ase_traj(*args, **kwargs)

Dump data to dpdata.plugins.ase.ASETrajFormat format.

to_atomconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_contcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_cp2k_aimd_output(*args, **kwargs)

Dump data to dpdata.plugins.cp2k.CP2KAIMDOutputFormat format.

to_cp2k_output(*args, **kwargs)

Dump data to dpdata.plugins.cp2k.CP2KOutputFormat format.

to_deepmd(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDRawFormat format.

to_deepmd_comp(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDCompFormat format.

to_deepmd_hdf5(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDHDF5Format format.

to_deepmd_npy(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDCompFormat format.

to_deepmd_npy_mixed(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDMixedFormat format.

to_deepmd_raw(*args, **kwargs)

Dump data to dpdata.plugins.deepmd.DeePMDRawFormat format.

to_dftbplus(*args, **kwargs)

Dump data to dpdata.plugins.dftbplus.DFTBplusFormat format.

to_dump(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSDumpFormat format.

to_fhi_aims_md(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiMDFormat format.

to_fhi_aims_output(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiMDFormat format.

to_fhi_aims_scf(*args, **kwargs)

Dump data to dpdata.plugins.fhi_aims.FhiSCFFormat format.

to_finalconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_fmt_obj(fmtobj, *args, **kwargs)[source]
to_gaussian_gjf(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussiaGJFFormat format.

to_gaussian_log(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussianLogFormat format.

to_gaussian_md(*args, **kwargs)

Dump data to dpdata.plugins.gaussian.GaussianMDFormat format.

to_gro(*args, **kwargs)

Dump data to dpdata.plugins.gromacs.GromacsGroFormat format.

to_gromacs_gro(*args, **kwargs)

Dump data to dpdata.plugins.gromacs.GromacsGroFormat format.

to_lammps_dump(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSDumpFormat format.

to_lammps_lmp(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSLmpFormat format.

to_list(*args, **kwargs)

Dump data to dpdata.plugins.list.ListFormat format.

to_lmp(*args, **kwargs)

Dump data to dpdata.plugins.lammps.LAMMPSLmpFormat format.

to_mlmd(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_mol(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.MolFormat format.

to_mol_file(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.MolFormat format.

to_movement(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_n2p2(*args, **kwargs)

Dump data to dpdata.plugins.n2p2.N2P2Format format.

to_openmx_md(*args, **kwargs)

Dump data to dpdata.plugins.openmx.OPENMXFormat format.

to_orca_spout(*args, **kwargs)

Dump data to dpdata.plugins.orca.ORCASPOutFormat format.

to_outcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPOutcarFormat format.

to_poscar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_psi4_inp(*args, **kwargs)

Dump data to dpdata.plugins.psi4.PSI4InputFormat format.

to_psi4_out(*args, **kwargs)

Dump data to dpdata.plugins.psi4.PSI4OutFormat format.

to_pwmat_atomconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_pwmat_finalconfig(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatAtomconfigFormat format.

to_pwmat_mlmd(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pwmat_movement(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pwmat_output(*args, **kwargs)

Dump data to dpdata.plugins.pwmat.PwmatOutputFormat format.

to_pymatgen_ComputedStructureEntry(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

to_pymatgen_computedstructureentry(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenCSEFormat format.

to_pymatgen_molecule(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenMoleculeFormat format.

to_pymatgen_structure(*args, **kwargs)

Dump data to dpdata.plugins.pymatgen.PyMatgenStructureFormat format.

to_qe_cp_traj(*args, **kwargs)

Dump data to dpdata.plugins.qe.QECPTrajFormat format.

to_qe_pw_scf(*args, **kwargs)

Dump data to dpdata.plugins.qe.QECPPWSCFFormat format.

to_quip_gap_xyz(*args, **kwargs)

Dump data to dpdata.plugins.xyz.QuipGapXYZFormat format.

to_quip_gap_xyz_file(*args, **kwargs)

Dump data to dpdata.plugins.xyz.QuipGapXYZFormat format.

to_sdf(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.SdfFormat format.

to_sdf_file(*args, **kwargs)

Dump data to dpdata.plugins.rdkit.SdfFormat format.

to_siesta_aimd_output(*args, **kwargs)

Dump data to dpdata.plugins.siesta.SiestaAIMDOutputFormat format.

to_siesta_output(*args, **kwargs)

Dump data to dpdata.plugins.siesta.SiestaOutputFormat format.

to_sqm_in(*args, **kwargs)

Dump data to dpdata.plugins.amber.SQMINFormat format.

to_sqm_out(*args, **kwargs)

Dump data to dpdata.plugins.amber.SQMOutFormat format.

to_stru(*args, **kwargs)

Dump data to dpdata.plugins.abacus.AbacusSTRUFormat format.

to_vasp_contcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_vasp_outcar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPOutcarFormat format.

to_vasp_poscar(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPPoscarFormat format.

to_vasp_string(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPStringFormat format.

to_vasp_xml(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPXMLFormat format.

to_xml(*args, **kwargs)

Dump data to dpdata.plugins.vasp.VASPXMLFormat format.

to_xyz(*args, **kwargs)

Dump data to dpdata.plugins.xyz.XYZFormat format.

property uniq_formula

Return the uniq_formula of this system. The uniq_formula sort the elements in formula by names. Systems with the same uniq_formula can be append together.

dpdata.system.add_format_methods()[source]

Add format methods to System, LabeledSystem, and MultiSystems; add data types to System and LabeledSystem.

Notes

Ensure all plugins have been loaded before execuating this function!

dpdata.system.get_atom_perturb_vector(atom_pert_distance, atom_pert_style='normal')[source]
dpdata.system.get_cell_perturb_matrix(cell_pert_fraction)[source]
dpdata.system.get_cls_name(cls: object) str[source]

Returns the fully qualified name of a class, such as np.ndarray.

Parameters:
clsobject

the class

Returns:
str

the fully qualified name of a class

dpdata.system.load_format(fmt)[source]

dpdata.unit module

class dpdata.unit.Conversion(unitA, unitB, check=True)[source]

Bases: ABC

Methods

set_value

value

set_value(value)[source]
value()[source]
class dpdata.unit.EnergyConversion(unitA, unitB)[source]

Bases: Conversion

Methods

set_value

value

class dpdata.unit.ForceConversion(unitA, unitB)[source]

Bases: Conversion

Methods

set_value

value

class dpdata.unit.LengthConversion(unitA, unitB)[source]

Bases: Conversion

Methods

set_value

value

class dpdata.unit.PressureConversion(unitA, unitB)[source]

Bases: Conversion

Methods

set_value

value

dpdata.unit.check_unit(unit)[source]

dpdata.utils module

dpdata.utils.add_atom_names(data, atom_names)[source]

Add atom_names that do not exist.

dpdata.utils.elements_index_map(elements, standard=False, inverse=False)[source]
dpdata.utils.remove_pbc(system, protect_layer=9)[source]
dpdata.utils.sort_atom_names(data, type_map=None)[source]

Sort atom_names of the system and reorder atom_numbs and atom_types accoarding to atom_names. If type_map is not given, atom_names will be sorted by alphabetical order. If type_map is given, atom_names will be type_map.

Parameters:
datadict

system data

type_maplist

type_map

dpdata.utils.uniq_atom_names(data)[source]

Make the atom names uniq. For example [‘O’, ‘H’, ‘O’, ‘H’, ‘O’] -> [‘O’, ‘H’].

Parameters:
datadict

data dict of System, LabeledSystem

dpdata.utils.utf8len(s: str) int[source]

Return the byte length of a string.

Authors

  • A bot of @njzjz

  • AngelJia

  • AnguseZhang

    1. Thang Nguyen

  • Chen Tao

  • Chentao168

  • Chenxing Luo

  • Duo

  • Ericwang6

  • Feifei Tian

  • Han Wang

  • Haruka

  • Hedley

  • Hedley Dong

  • HuangJiameng

  • Jia-Xin Zhu

  • Jingchao Zhang

  • Jinzhe Zeng

  • Junhan Chang

  • L-RuiHao

  • Levi Zhou

  • LiangWenshuo1118

  • Linfeng Zhang

  • Liu Renxi

  • Liu-RX

  • LiuGroupHNU

  • LiuHanyu

  • LiuLiping

  • Logan Ward

  • Marián Rynik

  • PKUfjh

  • Pan Xiang

  • Peng Xingliang

  • Shigetomo Yanase

  • Silvia-liu

  • Wanrun Jiang

  • Wenxin Zhang

  • Yifan Li李一帆

  • Yingze Wang

  • Yixiao Chen

  • Yongbin Zhuang

  • Yu Liu

  • Yuan Fengbo

  • Zezhong Zhang

  • deepmodeling

  • dependabot[bot]

  • ericwang6

  • felix5572

  • haidi

  • hl2500

  • hongriTianqi

  • jameswind

  • kiwi

  • link89

  • liuliping

  • m0sey

  • pee8379

  • pre-commit-ci[bot]

  • pxlxingliang

  • repo-ranger[bot]

  • robinzhuang

  • robinzyb

  • tianhongzhen

  • tuoping

  • wang laosi

  • xfanak

  • yuzhi

  • zezhong-zhang

dpdata

conda-forge pip install Documentation Status

dpdata is a python package for manipulating data formats of software in computational science, including DeePMD-kit, VASP, LAMMPS, GROMACS, Gaussian. dpdata only works with python 3.7 or above.

Installation

One can download the source code of dpdata by

git clone https://github.com/deepmodeling/dpdata.git dpdata

then use pip to install the module from source

cd dpdata
pip install .

dpdata can also by install via pip without source

pip install dpdata

Quick start

This section gives some examples on how dpdata works. Firstly one needs to import the module in a python 3.x compatible code.

import dpdata

The typicall workflow of dpdata is

  1. Load data from vasp or lammps or deepmd-kit data files.

  2. Manipulate data

  3. Dump data to in a desired format

Load data

d_poscar = dpdata.System("POSCAR", fmt="vasp/poscar")

or let dpdata infer the format (vasp/poscar) of the file from the file name extension

d_poscar = dpdata.System("my.POSCAR")

The number of atoms, atom types, coordinates are loaded from the POSCAR and stored to a data System called d_poscar. A data System (a concept used by deepmd-kit) contains frames that has the same number of atoms of the same type. The order of the atoms should be consistent among the frames in one System. It is noted that POSCAR only contains one frame. If the multiple frames stored in, for example, a OUTCAR is wanted,

d_outcar = dpdata.LabeledSystem("OUTCAR")

The labels provided in the OUTCAR, i.e. energies, forces and virials (if any), are loaded by LabeledSystem. It is noted that the forces of atoms are always assumed to exist. LabeledSystem is a derived class of System.

The System or LabeledSystem can be constructed from the following file formats with the format key in the table passed to argument fmt:

Software

format

multi frames

labeled

class

format key

vasp

poscar

False

False

System

‘vasp/poscar’

vasp

outcar

True

True

LabeledSystem

‘vasp/outcar’

vasp

xml

True

True

LabeledSystem

‘vasp/xml’

lammps

lmp

False

False

System

‘lammps/lmp’

lammps

dump

True

False

System

‘lammps/dump’

deepmd

raw

True

False

System

‘deepmd/raw’

deepmd

npy

True

False

System

‘deepmd/npy’

deepmd

raw

True

True

LabeledSystem

‘deepmd/raw’

deepmd

npy

True

True

LabeledSystem

‘deepmd/npy’

deepmd

npy

True

True

MultiSystems

‘deepmd/npy/mixed’

deepmd

npy

True

False

MultiSystems

‘deepmd/npy/mixed’

gaussian

log

False

True

LabeledSystem

‘gaussian/log’

gaussian

log

True

True

LabeledSystem

‘gaussian/md’

siesta

output

False

True

LabeledSystem

‘siesta/output’

siesta

aimd_output

True

True

LabeledSystem

‘siesta/aimd_output’

cp2k(deprecated in future)

output

False

True

LabeledSystem

‘cp2k/output’

cp2k(deprecated in future)

aimd_output

True

True

LabeledSystem

‘cp2k/aimd_output’

cp2k(plug-in)

stdout

False

True

LabeledSystem

‘cp2kdata/e_f’

cp2k(plug-in)

stdout

True

True

LabeledSystem

‘cp2kdata/md’

QE

log

False

True

LabeledSystem

‘qe/pw/scf’

QE

log

True

False

System

‘qe/cp/traj’

QE

log

True

True

LabeledSystem

‘qe/cp/traj’

Fhi-aims

output

True

True

LabeledSystem

‘fhi_aims/md’

Fhi-aims

output

False

True

LabeledSystem

‘fhi_aims/scf’

quip/gap

xyz

True

True

MultiSystems

‘quip/gap/xyz’

PWmat

atom.config

False

False

System

‘pwmat/atom.config’

PWmat

movement

True

True

LabeledSystem

‘pwmat/movement’

PWmat

OUT.MLMD

True

True

LabeledSystem

‘pwmat/out.mlmd’

Amber

multi

True

True

LabeledSystem

‘amber/md’

Amber/sqm

sqm.out

False

False

System

‘sqm/out’

Gromacs

gro

True

False

System

‘gromacs/gro’

ABACUS

STRU

False

False

System

‘abacus/stru’

ABACUS

STRU

False

True

LabeledSystem

‘abacus/scf’

ABACUS

cif

True

True

LabeledSystem

‘abacus/md’

ABACUS

STRU

True

True

LabeledSystem

‘abacus/relax’

ase

structure

True

True

MultiSystems

‘ase/structure’

DFTB+

dftbplus

False

True

LabeledSystem

‘dftbplus’

n2p2

n2p2

True

True

LabeledSystem

‘n2p2’

The Class dpdata.MultiSystems can read data from a dir which may contains many files of different systems, or from single xyz file which contains different systems.

Use dpdata.MultiSystems.from_dir to read from a directory, dpdata.MultiSystems will walk in the directory Recursively and find all file with specific file_name. Supports all the file formats that dpdata.LabeledSystem supports.

Use dpdata.MultiSystems.from_file to read from single file. Single-file support is available for the quip/gap/xyz and ase/structure formats.

For example, for quip/gap xyz files, single .xyz file may contain many different configurations with different atom numbers and atom type.

The following commands relating to Class dpdata.MultiSystems may be useful.

# load data

xyz_multi_systems = dpdata.MultiSystems.from_file(
    file_name="tests/xyz/xyz_unittest.xyz", fmt="quip/gap/xyz"
)
vasp_multi_systems = dpdata.MultiSystems.from_dir(
    dir_name="./mgal_outcar", file_name="OUTCAR", fmt="vasp/outcar"
)

# use wildcard
vasp_multi_systems = dpdata.MultiSystems.from_dir(
    dir_name="./mgal_outcar", file_name="*OUTCAR", fmt="vasp/outcar"
)

# print the multi_system infomation
print(xyz_multi_systems)
print(xyz_multi_systems.systems)  # return a dictionaries

# print the system infomation
print(xyz_multi_systems.systems["B1C9"].data)

# dump a system's data to ./my_work_dir/B1C9_raw folder
xyz_multi_systems.systems["B1C9"].to_deepmd_raw("./my_work_dir/B1C9_raw")

# dump all systems
xyz_multi_systems.to_deepmd_raw("./my_deepmd_data/")

You may also use the following code to parse muti-system:

from dpdata import LabeledSystem, MultiSystems
from glob import glob

"""
process multi systems
"""
fs = glob("./*/OUTCAR")  # remeber to change here !!!
ms = MultiSystems()
for f in fs:
    try:
        ls = LabeledSystem(f)
    except:
        print(f)
    if len(ls) > 0:
        ms.append(ls)

ms.to_deepmd_raw("deepmd")
ms.to_deepmd_npy("deepmd")

Access data

These properties stored in System and LabeledSystem can be accessed by operator [] with the key of the property supplied, for example

coords = d_outcar["coords"]

Available properties are (nframe: number of frames in the system, natoms: total number of atoms in the system)

key

type

dimension

are labels

description

‘atom_names’

list of str

ntypes

False

The name of each atom type

‘atom_numbs’

list of int

ntypes

False

The number of atoms of each atom type

‘atom_types’

np.ndarray

natoms

False

Array assigning type to each atom

‘cells’

np.ndarray

nframes x 3 x 3

False

The cell tensor of each frame

‘coords’

np.ndarray

nframes x natoms x 3

False

The atom coordinates

‘energies’

np.ndarray

nframes

True

The frame energies

‘forces’

np.ndarray

nframes x natoms x 3

True

The atom forces

‘virials’

np.ndarray

nframes x 3 x 3

True

The virial tensor of each frame

Dump data

The data stored in System or LabeledSystem can be dumped in ‘lammps/lmp’ or ‘vasp/poscar’ format, for example:

d_outcar.to("lammps/lmp", "conf.lmp", frame_idx=0)

The first frames of d_outcar will be dumped to ‘conf.lmp’

d_outcar.to("vasp/poscar", "POSCAR", frame_idx=-1)

The last frames of d_outcar will be dumped to ‘POSCAR’.

The data stored in LabeledSystem can be dumped to deepmd-kit raw format, for example

d_outcar.to("deepmd/raw", "dpmd_raw")

Or a simpler command:

dpdata.LabeledSystem("OUTCAR").to("deepmd/raw", "dpmd_raw")

Frame selection can be implemented by

dpdata.LabeledSystem("OUTCAR").sub_system([0, -1]).to("deepmd/raw", "dpmd_raw")

by which only the first and last frames are dumped to dpmd_raw.

replicate

dpdata will create a super cell of the current atom configuration.

dpdata.System("./POSCAR").replicate(
    (
        1,
        2,
        3,
    )
)

tuple(1,2,3) means don’t copy atom configuration in x direction, make 2 copys in y direction, make 3 copys in z direction.

perturb

By the following example, each frame of the original system (dpdata.System('./POSCAR')) is perturbed to generate three new frames. For each frame, the cell is perturbed by 5% and the atom positions are perturbed by 0.6 Angstrom. atom_pert_style indicates that the perturbation to the atom positions is subject to normal distribution. Other available options to atom_pert_style areuniform (uniform in a ball), and const (uniform on a sphere).

perturbed_system = dpdata.System("./POSCAR").perturb(
    pert_num=3,
    cell_pert_fraction=0.05,
    atom_pert_distance=0.6,
    atom_pert_style="normal",
)
print(perturbed_system.data)

replace

By the following example, Random 8 Hf atoms in the system will be replaced by Zr atoms with the atom postion unchanged.

s = dpdata.System("tests/poscars/POSCAR.P42nmc", fmt="vasp/poscar")
s.replace("Hf", "Zr", 8)
s.to_vasp_poscar("POSCAR.P42nmc.replace")

BondOrderSystem

A new class BondOrderSystem which inherits from class System is introduced in dpdata. This new class contains information of chemical bonds and formal charges (stored in BondOrderSystem.data['bonds'], BondOrderSystem.data['formal_charges']). Now BondOrderSystem can only read from .mol/.sdf formats, because of its dependency on rdkit (which means rdkit must be installed if you want to use this function). Other formats, such as pdb, must be converted to .mol/.sdf format (maybe with software like open babel).

import dpdata

system_1 = dpdata.BondOrderSystem(
    "tests/bond_order/CH3OH.mol", fmt="mol"
)  # read from .mol file
system_2 = dpdata.BondOrderSystem(
    "tests/bond_order/methane.sdf", fmt="sdf"
)  # read from .sdf file

In sdf file, all molecules must be of the same topology (i.e. conformers of the same molecular configuration). BondOrderSystem also supports initialize from a rdkit.Chem.rdchem.Mol object directly.

from rdkit import Chem
from rdkit.Chem import AllChem
import dpdata

mol = Chem.MolFromSmiles("CC")
mol = Chem.AddHs(mol)
AllChem.EmbedMultipleConfs(mol, 10)
system = dpdata.BondOrderSystem(rdkit_mol=mol)

Bond Order Assignment

The BondOrderSystem implements a more robust sanitize procedure for rdkit Mol, as defined in dpdata.rdkit.santizie.Sanitizer. This class defines 3 level of sanitization process by: low, medium and high. (default is medium).

  • low: use rdkit.Chem.SanitizeMol() function to sanitize molecule.

  • medium: before using rdkit, the programm will first assign formal charge of each atom to avoid inappropriate valence exceptions. However, this mode requires the rightness of the bond order information in the given molecule.

  • high: the program will try to fix inappropriate bond orders in aromatic hetreocycles, phosphate, sulfate, carboxyl, nitro, nitrine, guanidine groups. If this procedure fails to sanitize the given molecule, the program will then try to call obabel to pre-process the mol and repeat the sanitization procedure. That is to say, if you wan’t to use this level of sanitization, please ensure ``obabel`` is installed in the environment. According to our test, our sanitization procedure can successfully read 4852 small molecules in the PDBBind-refined-set. It is necessary to point out that the in the molecule file (mol/sdf), the number of explicit hydrogens has to be correct. Thus, we recommend to use obabel xxx -O xxx -h to pre-process the file. The reason why we do not implement this hydrogen-adding procedure in dpdata is that we can not ensure its correctness.

import dpdata

for sdf_file in glob.glob("bond_order/refined-set-ligands/obabel/*sdf"):
    syst = dpdata.BondOrderSystem(sdf_file, sanitize_level="high", verbose=False)

Formal Charge Assignment

BondOrderSystem implement a method to assign formal charge for each atom based on the 8-electron rule (see below). Note that it only supports common elements in bio-system: B,C,N,O,P,S,As

import dpdata

syst = dpdata.BondOrderSystem("tests/bond_order/CH3NH3+.mol", fmt="mol")
print(syst.get_formal_charges())  # return the formal charge on each atom
print(syst.get_charge())  # return the total charge of the system

If a valence of 3 is detected on carbon, the formal charge will be assigned to -1. Because for most cases (in alkynyl anion, isonitrile, cyclopentadienyl anion), the formal charge on 3-valence carbon is -1, and this is also consisent with the 8-electron rule.

Mixed Type Format

The format deepmd/npy/mixed is the mixed type numpy format for DeePMD-kit, and can be loaded or dumped through class dpdata.MultiSystems.

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.

Here are examples using deepmd/npy/mixed format:

  • Dump a MultiSystems into a mixed type numpy directory: ```python import dpdata

dpdata.MultiSystems(*systems).to_deepmd_npy_mixed(“mixed_dir”)

- Load a mixed type data into a MultiSystems:
```python
import dpdata

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

Plugins

One can follow a simple example to add their own format by creating and installing plugins. It’s critical to add the Format class to entry_points['dpdata.plugins'] in ``pyproject.toml` <plugin_example/pyproject.toml>`_:

[project.entry-points.'dpdata.plugins']
random = "dpdata_random:RandomFormat"

Indices and tables