dpgen2.conf package#
Submodules#
dpgen2.conf.alloy_conf module#
- class dpgen2.conf.alloy_conf.AlloyConf(lattice: System | Tuple[str, float], type_map: List[str], replicate: List[int] | Tuple[int, int, int] | int | None = None)[source]#
Bases:
object
- Parameters:
- lattice Union[dpdata.System, Tuple[str,float]]
Lattice of the alloy confs. can be dpdata.System: lattice in dpdata.System Tuple[str, float]: pair of lattice type and lattice constant. lattice type can be “bcc”, “fcc”, “hcp”, “sc” or “diamond”
- replicate Union[List[int], Tuple[int], int]
replicate of the lattice
- type_map List[str]
The type map
Methods
generate_file_content
(numb_confs[, ...])generate_systems
(numb_confs[, ...])- generate_file_content(numb_confs, concentration: List[List[float]] | List[float] | None = None, cell_pert_frac: float = 0.0, atom_pert_dist: float = 0.0, fmt: str = 'lammps/lmp') List[str] [source]#
- Parameters:
- numb_confs int
Number of configurations to generate
- concentration List[List[float]] or List[float] or None
If List[float], the concentrations of each element. The length of the list should be the same as the type_map. If List[List[float]], a list of concentrations (List[float]) is randomly picked from the List. If None, the elements are assumed to be of equal concentration.
- cell_pert_frac float
fraction of cell perturbation
- atom_pert_dist float
the atom perturbation distance (unit angstrom).
- fmt str
the format of the returned conf strings. Should be one of the formats supported by dpdata
- Returns:
- conf_list List[str]
A list of file content of configurations.
- generate_systems(numb_confs, concentration: List[List[float]] | List[float] | None = None, cell_pert_frac: float = 0.0, atom_pert_dist: float = 0.0) List[System] [source]#
- Parameters:
- numb_confs int
Number of configurations to generate
- concentration List[List[float]] or List[float] or None
If List[float], the concentrations of each element. The length of the list should be the same as the type_map. If List[List[float]], a list of concentrations (List[float]) is randomly picked from the List. If None, the elements are assumed to be of equal concentration.
- cell_pert_frac float
fraction of cell perturbation
- atom_pert_dist float
the atom perturbation distance (unit angstrom).
- Returns:
- conf_list List[dpdata.System]
A list of generated confs in dpdata.System.
- class dpgen2.conf.alloy_conf.AlloyConfGenerator(numb_confs, lattice: System | Tuple[str, float], replicate: List[int] | Tuple[int, int, int] | int | None = None, concentration: List[List[float]] | List[float] | None = None, cell_pert_frac: float = 0.0, atom_pert_dist: float = 0.0)[source]#
Bases:
ConfGenerator
- Parameters:
- numb_confs int
Number of configurations to generate
- lattice Union[dpdata.System, Tuple[str,float]]
Lattice of the alloy confs. can be dpdata.System: lattice in dpdata.System Tuple[str, float]: pair of lattice type and lattice constant. lattice type can be “bcc”, “fcc”, “hcp”, “sc” or “diamond”
- replicate Union[List[int], Tuple[int], int]
replicate of the lattice
- concentration List[List[float]] or List[float] or None
If List[float], the concentrations of each element. The length of the list should be the same as the type_map. If List[List[float]], a list of concentrations (List[float]) is randomly picked from the List. If None, the elements are assumed to be of equal concentration.
- cell_pert_frac float
fraction of cell perturbation
- atom_pert_dist float
the atom perturbation distance (unit angstrom).
Methods
generate
(type_map)Method of generating configurations.
get_file_content
(type_map[, fmt])Get the file content of configurations
normalize_config
([data, strict])Normalized the argument.
args
doc
- generate(type_map) MultiSystems [source]#
Method of generating configurations.
- Parameters:
- type_mapList[str]
The type map.
- Returns:
- confs: dpdata.MultiSystems
The returned configurations in dpdata.MultiSystems format
- dpgen2.conf.alloy_conf.generate_alloy_conf_file_content(lattice: System | Tuple[str, float], type_map: List[str], numb_confs, replicate: List[int] | Tuple[int, int, int] | int | None = None, concentration: List[List[float]] | List[float] | None = None, cell_pert_frac: float = 0.0, atom_pert_dist: float = 0.0, fmt: str = 'lammps/lmp')[source]#
dpgen2.conf.conf_generator module#
- class dpgen2.conf.conf_generator.ConfGenerator[source]#
Bases:
ABC
Methods
generate
(type_map)Method of generating configurations.
get_file_content
(type_map[, fmt])Get the file content of configurations
normalize_config
([data, strict])Normalized the argument.
args
- abstract generate(type_map) MultiSystems [source]#
Method of generating configurations.
- Parameters:
- type_mapList[str]
The type map.
- Returns:
- confs: dpdata.MultiSystems
The returned configurations in dpdata.MultiSystems format
dpgen2.conf.file_conf module#
- class dpgen2.conf.file_conf.FileConfGenerator(files: str | List[str], fmt: str = 'auto', prefix: str | None = None, remove_pbc: bool | None = False)[source]#
Bases:
ConfGenerator
Methods
generate
(type_map)Method of generating configurations.
get_file_content
(type_map[, fmt])Get the file content of configurations
normalize_config
([data, strict])Normalized the argument.
args
doc
generate_mixed
generate_std
- generate(type_map) MultiSystems [source]#
Method of generating configurations.
- Parameters:
- type_mapList[str]
The type map.
- Returns:
- confs: dpdata.MultiSystems
The returned configurations in dpdata.MultiSystems format
- generate_mixed(type_map) MultiSystems [source]#
- generate_std(type_map) MultiSystems [source]#