class matlantis_features.features.phonon.dos.PostPhononDOSFeature(partial: bool = False)#

Bases: FeatureBase

The matlantis-feature for calculating the phonon DOS from the force constant.

References

For more information, please refer to Matlantis Guidebook.

Methods

__init__([partial])

Initialize an instance.

__call__(force_constant, kpts[, scheme, …])

Calculates the phonon density of states (DOS) from the force constant.

attach_ctx([ctx])

Attach the feature to matlantis_features.utils.Context.

check_estimator_fn(estimator_fn)

Checks if the given estimator function is None and output a warning if so.

cost_estimate([atoms])

Estimate the cost of the feature.

from_dict(res)

Construct a FeatureBase object from serialized dict.

get_savedir_from_ctx()

Get the temporary save directory from the context.

init_scope()

Context manager that enable to set attribution of the feature.

repeat(n_repeat)

Set the maximum number of times that allowed to run the __call__ function.

to_dict()

Dictionary representation of the FeatureBase.

__init__(partial: bool = False) None#

Initialize an instance.

Parameters

partial (bool, optional) – Whether to calculate the element projected DOS. Defaults to
False.

__call__(force_constant: ForceConstantFeatureResult, kpts: List[int], scheme: str = ‘mp’, shift: Optional[ndarray] = None, freq_min: Optional[float] = None, freq_max: Optional[float] = None, freq_bin: Optional[float] = None, unit: str = ‘meV’) PostPhononDOSFeatureResult#

Calculates the phonon density of states (DOS) from the force constant.

Parameters
  • force_constant (ForceConstantFeatureResult) – The calculation result of
    the ForceConstantFeature.

  • kpts (list[int]) – The number of mesh points along each axis.

  • scheme (str, optional) – The type of mesh grid: either ‘mp’ or ‘gamma’. The mesh grid is
    determined by the Monkhorst-Pack scheme (‘mp’) or Gamma-centered scheme (‘gamma’).
    Defaults to ‘mp’.

  • shift (np.ndarray or None, optional) – The shift of the mesh grid in the direction along
    the corresponding reciprocal axes. Defaults to None.

  • freq_min (float or None, optional) – The minimum frequency of phonon DOS calculation
    range. Defaults to None.

  • freq_max (float or None, optional) – The maximum frequency of phonon DOS calculation
    range. Defaults to None.

  • freq_bin (float or None, optional) – The small interval in which the density of states
    will be calculated. Defaults to None.

  • unit (str, optional) – The unit of phonon frequency. Must be one of: ‘meV’, ‘eV’, ‘THz’
    or ‘cm^-1’. Defaults to ‘meV’.

Returns

The calculation results of phonon DOS.

Return type

PostPhononDOSFeatureResult

attach_ctx(ctx: Optional[Context] = None) None#

Attach the feature to matlantis_features.utils.Context.

Parameters

ctx (Context or None, optional) – The matlantis_features.utils.Context object. Defaults to None.

check_estimator_fn(estimator_fn: Optional[Callable[[], Estimator]]) None#

Checks if the given estimator function is None and output a warning if so.

Parameters

estimator_fn (EstimatorFnType or None, optional) – A factory method to create a custom estimator.
Please refer Customizing estimator used in matlantis-features for detail. Defaults to None.

cost_estimate(atoms: Optional[Union[Atoms, MatlantisAtoms]] = None) FeatureCost#

Estimate the cost of the feature.

Parameters

atoms (ASEAtoms or MatlantisAtoms or None, optional) – The input atoms. Defaults to None.

Returns

The cost of the feature.

Return type

FeatureCost

classmethod from_dict(res: Dict[str, Any]) FeatureBase#

Construct a FeatureBase object from serialized dict.

Parameters

res (dict[str, Any]) – A dict containing a serialized FeatureBase from to_dict().

Returns

The deserialized object from provided dict.

Return type

FeatureBase

get_savedir_from_ctx() Path#

Get the temporary save directory from the context.

Returns

The temporary save directory .

Return type

pathlib.Path

init_scope() Iterator[None]#

Context manager that enable to set attribution of the feature.

Returns

Init_scope context manager.

Return type

Iterator[None]

repeat(n_repeat: int) Self#

Set the maximum number of times that allowed to run the __call__ function.

Parameters

n_repeat (int) – The maximum number of repeats.

Returns

The feature.

Return type

Self

to_dict() Dict[str, Any]#

Dictionary representation of the FeatureBase.

Returns

A dict containing a serialized FeatureBase.

Return type

dict[str, Any]