Intensive gap¶
Does minimum and maximum pooling to get a gap-like intensive property.
Intensive properties like the band gap can’t be computed as a sum of local contributions due to the simple fact that they do not scale with the size of the system. This extender implements a simple but powerful idea that was used in this work [1] to predict gaps from local contributions:
i.e. it defines the gap as the difference between the maximum and minimum of two different local contributions \(c_i\) and \(v_i\). The minimum and maximum can be interpreted as the conduction and valence band edges or LUMO and HOMO energies, respectively.
The extender takes care of a global scalar output by requesting two separate local scalar quantities as inputs and performing the min/max pooling.
Pooling¶
The hard minimum and maximum are replaced by a self-weighted softmax pool, whose weights are computed from the per-atom values themselves:
The sign of \(\alpha\) (sharpness_bottom or sharpness_top) selects max-
vs min-pooling and its magnitude sets the sharpness: the pool recovers a hard
max/min as \(|\alpha| \to \infty\). The weights sum to one in each system,
so the pooled value is strictly intensive.
Installation¶
To install this extender along with the metatrain package, run:
pip install metatrain[extender-intensive-gap]
where the square brackets indicate that you want to install the optional
dependencies required for the intensive_gap extender.
Extender hyperparameters¶
The default hyperparameters for this extender are:
intensive_gap:
sharpness_bottom: 10.0
sharpness_top: -10.0
inputs: null
and here is the documentation for each hyperparameter:
- Hypers.sharpness_bottom: float = 10.0¶
Sharpness of the pooling of the bottom of the gap.
A positive value gives a soft max, while a negative value gives a soft min.
A larger magnitude gives a sharper pool (closer to a hard max/min).
- Hypers.sharpness_top: float = -10.0¶
Sharpness of the pooling of the top of the gap.
A positive value gives a soft max, while a negative value gives a soft min.
A larger magnitude gives a sharper pool (closer to a hard max/min).
- Hypers.inputs: ExtenderInputs | list[ExtenderInputs] | None = None¶
For each output, the names of the inputs to be pooled.
The amount of input specifications must match the amount of outputs. Any missing specification will be determined automatically from the output name.
Additional types to understand hypers¶
- class metatrain.utils.extenders.intensive_gap.documentation.ExtenderInputs[source]¶
Inputs to be pooled to compute the intensive gap.
- bottom: NotRequired[str]¶
Name of the requested input for the bottom of the gap.
If not provided, it is determined automatically from the output name as
mtt::extender_aux::intensive_gap::bottom::{output_name.replace('mtt::', '')}.This input is a per-atom scalar quantity.
- top: NotRequired[str]¶
Name of the requested input for the top of the gap.
If not provided, it is determined automatically from the output name as
mtt::extender_aux::intensive_gap::top::{output_name.replace('mtt::', '')}.This input is a per-atom scalar quantity.