Symmetrizer¶
In order for the energy (the model output) to be invariant with respect to global rotations NeuralXC symmetrizes the descriptors \(c_{nlm}\). Two symmetrizers are currently supported by NeuralXC and can be set with the keyword
symmetrizer_type
trace
\(d_{nl} = \sum_m c_{nlm}^2\)mixed_trace
\(d_{nn'l} = \sum_m c_{nlm}c_{n'lm}\)
All Symmetrizer classes are derived from BaseSymmetrizer
-
class
neuralxc.symmetrizer.symmetrizer.
BaseSymmetrizer
(symmetrize_instructions)¶ -
__init__
(symmetrize_instructions)¶ Symmetrizer :param symmetrize_instructions: Attributes needed to symmetrize input (such as angular momentum etc.) :type symmetrize_instructions: dict
-
get_symmetrized
(C)¶ Returns a symmetrized version of the descriptors c (from DensityProjector)
Parameters: C (dict of numpy.ndarrays or list of dict of numpy.ndarrays) – Electronic descriptors Returns: D – Symmetrized descriptors Return type: dict of numpy.ndarrays
-
Customized Symmetrizers can be created by inheriting from this base class and implementing the method _symmetrize_function. As of now two symmetrizers are implemented by default:
-
class
neuralxc.symmetrizer.symmetrizer.
TraceSymmetrizer
(*args, **kwargs)¶ Symmetrizes density projections with respect to global rotations.
_registry_name: ‘trace’ -
static
_symmetrize_function
(c, n_l, n, *args)¶ Returns the symmetrized version of c
Parameters: - c (np.ndarray of floats) – Stores the tensor elements in the order (n,l,m)
- n_l (int) – number of angular momenta (not equal to maximum ang. momentum! example: if only s-orbitals n_l would be 1)
- n (int) – number of radial functions
Returns: Casimir invariants
Return type: np.ndarray
-
static
-
class
neuralxc.symmetrizer.symmetrizer.
MixedTraceSymmetrizer
(*args, **kwargs)¶ _registry_name: ‘mixed_trace’ -
static
_symmetrize_function
(c, n_l, n, *args)¶ Return trace of c_m c_m’ with mixed radial channels of the tensors stored in c
Parameters: - c (np.ndarray of floats/complex) – Stores the tensor elements in the order (n,l,m)
- n_l (int) – number of angular momenta (not equal to maximum ang. momentum! example: if only s-orbitals n_l would be 1)
- n (int) – number of radial functions
Returns: Casimir invariants
Return type: np.ndarray
-
static