class pfp_api_client.pfp.estimator.Estimator(max_retries: int = 10, model_version: Optional[str] = None, address: str = ‘localhost:5000’, priority: Optional[int] = None, calc_mode: Optional[Union[EstimatorCalcMode, str]] = None, method_type: Optional[Union[EstimatorMethodType, str]] = None)#

Bases: object

Core class of PFP. Estimator calculates the energy and related values (e.g. atomic forces) of given atomic structure. A single Estimator instance can only be used by at most
one ASECalculator instance.

Acceptable PFP model versions are:

  • v7.0.0: latest version, supporting 24 additional elements, for a total of 96 elements.

  • v6.0.0: improving the reproducibility of sparse environments
    (e.g. molecules in vacuum) and high-density structures.

  • v5.0.0: improving the reproducibility of physical properties
    for partially element-substituted structures, liquid, and organic crystals.

  • v4.0.0: improving the reproducibility of the energy order
    and the density of bulk structures of crystals, and intermolecular interactions.

  • v3.0.0: supporting 17 additional elements, for a total of 72 elements.

  • v2.0.0: model version with support for D3 correction and zero Hubbard U parameter.

  • v1.1.0: the same model as v1.0.0 with D3 correction support.

  • v1.0.0: initial stable version, does not support D3.

  • v0.0.0: PFP paper version, does not support D3.

  • latest: alias for v7.0.0.

property application_context: Optional[str]#
attach_to_calculator(_: Calculator) None#
property available_models: Sequence[str]#
property calc_mode: Optional[EstimatorCalcMode]#
estimate(args: EstimatorSystem) Dict[str, Union[List[MessageEnum], ndarray]]#

This function receives atomic system information and returns energy, forces and related values.

Parameters:

args (EstimatorSystem) – For details, see the document for EstimatorSystem.

Returns:

results – Dictionary which contains various calculated properties

Return type:

Dict[str, any]

get_shift_energy_table(calc_mode: Optional[Union[EstimatorCalcMode, str]] = None, model_version: Optional[str] = None) Dict[int, float]#

Return the table of shift energies of input atoms.

Parameters:

calc_mode (str, EstimatorCalcMode, or None) – Calculation mode. If not specified, calc_mode set in the estimator will be used.

Returns:

shift_energies_table – Table of shift energies.

Return type:

Dict[int, float]

property method_type: EstimatorMethodType#
property model_version: str#
property priority: int#
set_calc_mode(calc_mode: Union[EstimatorCalcMode, str]) None#

Set estimator calculation mode.

Parameters:

calc_mode (Union[EstimatorCalcMode, str]) – The calculation mode to be set.

set_message_status(message: MessageEnum, message_enable: bool) None#

Toggle whether to show individual messages in estimate().

Parameters:
  • message (MessageEnum) – Message to toggle.

  • message_enable (bool) – True/False correspond to enabling/disabling the message.

set_method_type(method_type: Union[EstimatorMethodType, str]) None#

Set estimator method type.

Parameters:

method_type (Union[EstimatorMethodType, str]) – The inference method type to be set.

set_model_version(model_version: str) None#

Set model version.

Parameters:

model_version (str) – The model version to be set.

set_priority(priority: int) None#
supported_elements(model_version: Optional[str] = None, status: Union[EstimatorElementStatus, Tuple[EstimatorElementStatus, ]] = EstimatorElementStatus.Expected, calc_mode: Optional[Union[EstimatorCalcMode, str]] = None) List[str]#

Return list of implemented elements in specified model version.

Parameters:
  • model_version (str, optional) – Model version to be specified.

  • status (EstimatorElementStatus or tuple of EstimatorElementStatus, optional) – Target support status to return. Multiple keywords can be specified.

  • calc_mode (EstimatorCalcMode, or str, optional) – Calculation mode. If not specified, calc_mode set in the estimator will be used.

Returns:

elements – List which contains implemented elements.

Return type:

List[str]

class pfp_api_client.pfp.estimator.EstimatorCalcMode(value)#

Bases: Enum

Enum class which is used to determine calc_mode in Estimator.

Variables:
  • CRYSTAL – Crystal mode. This mode corresponds to DFT calculations with plane wave basis sets.

  • CRYSTAL_PLUS_D3 – Crystal mode with D3 correction enabled. This mode corresponds to DFT calculations with plane wave basis sets, plus a D3 dispersion correction.

  • CRYSTAL_U0 – Crystal mode with Hubbard U parameter switched off. This mode corresponds to DFT calculations with plane wave basis sets.

  • CRYSTAL_U0_PLUS_D3 – Crystal mode with Hubbard U parameter switched off and D3 correction enabled. This mode corresponds to DFT calculations with plane wave basis sets, plus a D3 dispersion correction.

  • MOLECULE – Molecule mode. This mode corresponds to DFT calculations with local basis sets.

CRYSTAL = ‘crystal’#
CRYSTAL_PLUS_D3 = ‘crystal_plus_d3’#
CRYSTAL_U0 = ‘crystal_u0’#
CRYSTAL_U0_PLUS_D3 = ‘crystal_u0_plus_d3’#
MOLECULE = ‘molecule’#
PBE = ‘pbe’#
PBE_PLUS_D3 = ‘pbe_plus_d3’#
PBE_U = ‘pbe_u’#
PBE_U_PLUS_D3 = ‘pbe_u_plus_d3’#
R2SCAN = ‘r2scan’#
R2SCAN_PLUS_D3 = ‘r2scan_plus_d3’#
WB97XD = ‘wb97xd’#
static from_str(label: str) EstimatorCalcMode#
class pfp_api_client.pfp.estimator.EstimatorElementStatus(value)#

Bases: Enum

Enum class which is used to determine element_status in Estimator.

Variables:
  • Expected – Fully supported elements.

  • Experimental – Experimentally supported elements.

  • Unexpected – Unsopported elements.

Expected = ‘EstimatorElementStatus.Expected’#
Experimental = ‘EstimatorElementStatus.Experimental’#
class pfp_api_client.pfp.estimator.EstimatorMethodType(value)#

Bases: Enum

Enum class which is used to determine method_type in Estimator.

Variables:
  • PFVM – Inference is performed in pfvm mode. Inference of dftd3 is performed in torch mode.

  • MNCORE_ACCURATE – Inference is performed in accurate mode on MN-Core.

  • MNCORE_FAST – Inference is performed in fast mode on MN-Core.

  • PFVM_D3_PFVM – Inferences of pfp and dftd3 are performed in pfvm mode.

MNCORE = ‘mncore’#
MNCORE_ACCURATE = ‘mncore_accurate’#
MNCORE_FAST = ‘mncore_fast’#
PFVM = ‘pfvm’#
PFVM_D3_PFVM = ‘pfvm_d3_pfvm’#
static from_str(label: str) EstimatorMethodType#
class pfp_api_client.pfp.estimator.EstimatorSystem(properties: List[str], coordinates: ndarray, cell: ndarray, species: Optional[ndarray] = None, atomic_numbers: Optional[ndarray] = None, pbc: Optional[ndarray] = None, calc_mode: Optional[EstimatorCalcMode] = None, method_type: Optional[EstimatorMethodType] = None)#

Bases: object

Input argument of Estimator.estimate function.

Parameters:
  • properties (List[str]) – What properties should be calculated. Current implemented properties are “energy”, “forces”, “charges”, and “virial”. If gradient-based parameters (forces, virial) are not requested, the estimator does not calculate them.

  • coordinates (np.ndarray (dtype=np.float32 or np.float64)) – Coordination of atoms. The shape is (n_atoms, 3).

  • cell (np.ndarray (dtype=np.float32 or np.float64)) – Simulation cell of the system. The shape is (3, 3)

  • species (Optional[np.ndarray] (dtype=”)) – Element list of atoms as string. Either species or atomic_numbers should be provided. The shape is (n_atoms, )

  • atomic_numbers (Optional[np.ndarray] (dtype=np.uint8)) – Element list of atoms as atomic number. Either species or atomic_numbers should be provided. The shape is (n_atoms, )

  • pbc (Optional[np.ndarray] (dtype=np.uint8)) – Whether periodic boundary conditions are applied (1) or not (0) for each axis. The shape is (3, )

  • calc_mode (Optional[EstimatorCalcMode]) – Calculate results with given calculation mode.

atomic_numbers: Optional[ndarray] = None#
calc_mode: Optional[EstimatorCalcMode] = None#
cell: ndarray#
coordinates: ndarray#
pbc: Optional[ndarray] = None#
properties: List[str]#
species: Optional[ndarray] = None#