Prediction modules for fundamental properties that stem directly from a single electronic states (\(j\)) and
are intrinsic to that state without any interaction.
Predicts atom-wise contributions and accumulates global prediction, e.g., for energies.
If aggregation_mode is None, only the per-atom predictions will be returned.
Parameters:
n_in (input dimension of representation)
n_out (output dimension of target property (default: 1), i.e., number of states)
n_hidden (size of hidden layers.) – If an integer, same number of node is used for all hidden layers resulting
in a rectangular network.
If None, the number of neurons is divided by two after each layer starting
n_in resulting in a pyramidal network.
n_layers (number of layers.)
aggregation_mode (one of {sum, avg} (default: sum))
output_key (the key under which the result will be stored)
per_atom_output_key (If not None, the key under which the per-atom result will be stored)
Return type:
Dictionary with predicted energies for multiple states.
Examples
The following code demonstrates how to define a prediction module for predicting the
energies of two electronic states using the Atomwise module SPaiNN.
Although the recipe for forward pass needs to be defined within
this function, one should call the Module instance afterwards
instead of this since the former takes care of running the
registered hooks while the latter silently ignores them.
Predicts forces and stress as response of the energy prediction
w.r.t. the atom positions and strain for multiple electronic states.
The number of electronic states, for which the forces are computed
is automatically taken from the shape of the energies.
For example, energy inputs of shape \([1,3]\) result in the
prediction of forces for three electronic states.
Parameters:
calc_forces (If True, calculate atomic forces.)
calc_stress (If True, calculate the stress tensor.)
energy_key (Key of the energy in results.)
force_key (Key of the forces in results.)
Return type:
Dictionary with predicted forces for multiple states.
Examples
The following code demonstrates how to define a prediction module for predicting the
forces from for multiple electronic states from the first derivative of the respective
predicted energies with respect to the atom positions using the Forces
module.
The number of the electronic states is automatically taken from the shape of the
energies.
Although the recipe for forward pass needs to be defined within
this function, one should call the Module instance afterwards
instead of this since the former takes care of running the
registered hooks while the latter silently ignores them.
Predicts nonadiabatic coupling vector, i.e. local, atomic couplings of
electronic states of the same multiplicity.
This requires a representation supplying (equivariant) vector features [1].
References
Parameters:
n_in (input dimension of representation)
n_out (output dimension of target property, i.e.,) – number of couplings
n_hidden (size of hidden layers) – If an integer, same number of node is used for all hidden layers
resulting in a rectangular network.
If None, the number of neurons is divided by two after each layer
starting n_in resulting in a pyramidal network.
n_layers (number of layers)
activation (activation function)
nac_key (the key under which the nonadiabatic couplings are stored)
use_vector_repr (If true, use vector representation to predict) – local, atomic couplings.
Return type:
Dictionary with predicted energies for multiple states.
Examples
The following code demonstrates how to define a prediction module for predicting the
nonadiabatic couplings of two electronic states, i.e. one coupling vector using
the Nacs module SPaiNN.
Although the recipe for forward pass needs to be defined within
this function, one should call the Module instance afterwards
instead of this since the former takes care of running the
registered hooks while the latter silently ignores them.
Predict Dipole Moments from latent partial charges. This requires a
representation supplying (equivariant) vector features [2], [3], [4].
References
Parameters:
n_in (Input dimension of representation.)
n_out (Output dimension, i.e., number of dipole moments (couplings).)
n_hidden (Size of hidden layers.) – If an integer, same number of node is used for all hidden layers
resulting in a rectangular network.
If None, the number of neurons is divided by two after each layer
starting n_in resulting in a pyramidal network.
n_layers (Number of layers.)
activation (Activation function.)
dipole_key (Key under which dipoles are stored.)
return_charges (If true, return partial charges.)
charges_key (Key under which partial charges are stored.)
Dictionary with predicted dipoles for multiple states.
Examples
The following code demonstrates how to define a prediction module for predicting the
dipole moments of two electronic states, i.e. one transition dipole and two permanent
dipoles using the Dipoles module of SPaiNN.
Although the recipe for forward pass needs to be defined within
this function, one should call the Module instance afterwards
instead of this since the former takes care of running the
registered hooks while the latter silently ignores them.
Predicts spin-orbit coupling vectors, i.e., local atomic couplings
between electronic states of different multiplicity.
This requires a representation supplying (equivariant) vector features [5].
References
Parameters:
n_in (Input dimension of representation.)
n_out (Output dimension, i.e., number of spin-orbit couplings.)
n_hidden (Size of hidden layers.) – If an integer, same number of node is used for all hidden layers
resulting in a rectangular network.
If None, the number of neurons is divided by two after each layer
starting n_in resulting in a pyramidal network.
n_layers (Number of layers.)
activation (Activation function.)
socs_key (Key under which spin-orbit couplings are stored.)
Return type:
Dictionary with predicted dipoles for multiple states.
Examples
The following code demonstrates how to define a prediction module for predicting the
spin-orbit couplings of two electronic states, e.g.\(S_0\) and \(T_1\)
using the Socs module of SPaiNN.
Although the recipe for forward pass needs to be defined within
this function, one should call the Module instance afterwards
instead of this since the former takes care of running the
registered hooks while the latter silently ignores them.