dpgen2.conf package

Submodules

dpgen2.conf.alloy_conf module

class dpgen2.conf.alloy_conf.AlloyConf(lattice: Union[System, Tuple[str, float]], type_map: List[str], replicate: Optional[Union[List[int], Tuple[int], int]] = 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[, ...])

Parameters

generate_systems(numb_confs[, ...])

Parameters

generate_file_content(numb_confs, concentration: Optional[Union[List[List[float]], List[float]]] = 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: Optional[Union[List[List[float]], List[float]]] = None, cell_pert_frac: float = 0.0, atom_pert_dist: float = 0.0) 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).

Returns
conf_list List[dpdata.System]

A list of generated confs in dpdata.System.

class dpgen2.conf.alloy_conf.AlloyConfGenerator(numb_confs, lattice: Union[System, Tuple[str, float]], replicate: Optional[Union[List[int], Tuple[int], int]] = None, concentration: Optional[Union[List[List[float]], List[float]]] = 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

static args() List[Argument][source]
generate(type_map) MultiSystems[source]

Method of generating configurations.

Parameters
type_map: List[str]

The type map.

Returns
confs: dpdata.MultiSystems

The returned configurations in dpdata.MultiSystems format

dpgen2.conf.alloy_conf.gen_doc(*, make_anchor=True, make_link=True, **kwargs)[source]
dpgen2.conf.alloy_conf.generate_alloy_conf_args()[source]
dpgen2.conf.alloy_conf.generate_alloy_conf_file_content(lattice: Union[System, Tuple[str, float]], type_map: List[str], numb_confs, replicate: Optional[Union[List[int], Tuple[int], int]] = None, concentration: Optional[Union[List[List[float]], List[float]]] = None, cell_pert_frac: float = 0.0, atom_pert_dist: float = 0.0, fmt: str = 'lammps/lmp')[source]
dpgen2.conf.alloy_conf.normalize(data)[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 static args() List[Argument][source]
abstract generate(type_map) MultiSystems[source]

Method of generating configurations.

Parameters
type_map: List[str]

The type map.

Returns
confs: dpdata.MultiSystems

The returned configurations in dpdata.MultiSystems format

get_file_content(type_map, fmt='lammps/lmp') List[str][source]

Get the file content of configurations

Parameters
type_map: List[str]

The type map.

Returns
conf_list: List[str]

A list of file content of configurations.

classmethod normalize_config(data: Dict = {}, strict: bool = True) Dict[source]

Normalized the argument.

Parameters
data: Dict

The input dict of arguments.

strict: bool

Strictly check the arguments.

Returns
data: Dict

The normalized arguments.

dpgen2.conf.file_conf module

class dpgen2.conf.file_conf.FileConfGenerator(files: Union[str, List[str]], fmt: str = 'auto', prefix: Optional[str] = None, remove_pbc: Optional[bool] = 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

static args() List[Argument][source]
generate(type_map) MultiSystems[source]

Method of generating configurations.

Parameters
type_map: List[str]

The type map.

Returns
confs: dpdata.MultiSystems

The returned configurations in dpdata.MultiSystems format

dpgen2.conf.unit_cells module

class dpgen2.conf.unit_cells.BCC[source]

Bases: object

Methods

gen_box

numb_atoms

poscar_unit

gen_box()[source]
numb_atoms()[source]
poscar_unit(latt)[source]
class dpgen2.conf.unit_cells.DIAMOND[source]

Bases: object

Methods

gen_box

numb_atoms

poscar_unit

gen_box()[source]
numb_atoms()[source]
poscar_unit(latt)[source]
class dpgen2.conf.unit_cells.FCC[source]

Bases: object

Methods

gen_box

numb_atoms

poscar_unit

gen_box()[source]
numb_atoms()[source]
poscar_unit(latt)[source]
class dpgen2.conf.unit_cells.HCP[source]

Bases: object

Methods

gen_box

numb_atoms

poscar_unit

gen_box()[source]
numb_atoms()[source]
poscar_unit(latt)[source]
class dpgen2.conf.unit_cells.SC[source]

Bases: object

Methods

gen_box

numb_atoms

poscar_unit

gen_box()[source]
numb_atoms()[source]
poscar_unit(latt)[source]
dpgen2.conf.unit_cells.generate_unit_cell(crystal: str, latt: float = 1.0) System[source]