Skip to content

Commit 06322f4

Browse files
Moved L_R and M_R
1 parent c07a7af commit 06322f4

2 files changed

Lines changed: 68 additions & 46 deletions

File tree

mala/common/parameters.py

Lines changed: 44 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -471,50 +471,66 @@ class ParametersDescriptors(ParametersBase):
471471
descriptor calculation.
472472
473473
ace_included_expansion_ranks : list
474-
ACE_DOCS_MISSING: I think I know what this does, but I am not sure
475-
how to best communicate to users how to set this.
474+
List of all included expansion ranks for the ACE descriptors.
475+
These expansion ranks correspond to the many body order in the
476+
expansion of the atomic energy in many body terms. The list does
477+
can exclude terms, i.e., [1,2,4] is a valid option.
478+
Lengths have to be consistent between ace_included_expansion_ranks,
479+
ace_maximum_n_per_rank, ace_maximum_l_per_rank and
480+
ace_minimum_l_per_rank.
476481
477482
ace_maximum_n_per_rank : list
478-
ACE_DOCS_MISSING: I think I know what this does, but I am not sure
479-
how to best communicate to users how to set this.
483+
Maximum n for each expansion rank in the ACE descriptors. These
484+
n correspond to the n starting from equation 27 in the original
485+
ACE paper (doi.org/10.1103/PhysRevB.99.014104)
486+
Lengths have to be consistent between ace_included_expansion_ranks,
487+
ace_maximum_n_per_rank, ace_maximum_l_per_rank and
488+
ace_minimum_l_per_rank.
480489
481490
ace_maximum_l_per_rank : list
482-
ACE_DOCS_MISSING: I think I know what this does, but I am not sure
483-
how to best communicate to users how to set this.
491+
Maximum l for each expansion rank in the ACE descriptors. These
492+
n correspond to the n starting from equation 27 in the original
493+
ACE paper (doi.org/10.1103/PhysRevB.99.014104).
494+
Lengths have to be consistent between ace_included_expansion_ranks,
495+
ace_maximum_n_per_rank, ace_maximum_l_per_rank and
496+
ace_minimum_l_per_rank.
484497
485498
ace_minimum_l_per_rank : list
486-
ACE_DOCS_MISSING: I think I know what this does, but I am not sure
487-
how to best communicate to users how to set this.
499+
Minimum l for each expansion rank in the ACE descriptors. These
500+
n correspond to the n starting from equation 27 in the original
501+
ACE paper (doi.org/10.1103/PhysRevB.99.014104)
502+
Lengths have to be consistent between ace_included_expansion_ranks,
503+
ace_maximum_n_per_rank, ace_maximum_l_per_rank and
504+
ace_minimum_l_per_rank.
488505
489-
ace_nshell : list
490-
ACE_DOCS_MISSING: I think I know what this does, but I am not sure
491-
how to best communicate to users how to set this.
492-
493-
ace_balance_cutoff_radii_for_elements : list
494-
ACE_DOCS_MISSING: I think I know what this does, but I am not sure
495-
how to best communicate to users how to set this.
506+
ace_balance_cutoff_radii_for_elements : bool
507+
If True, cutoff radii will be balanced between element types.
508+
This is helpful when dealing with elements varying drastically in size.
496509
497510
ace_larger_cutoff_for_metals : list
498-
ACE_DOCS_MISSING: I think I know what this does, but I am not sure
499-
how to best communicate to users how to set this.
511+
If True (default) a slightly larger cutoff is used for metals. This
512+
is recommended.
500513
501514
ace_use_maximum_cutoff_per_element : list
502-
ACE_DOCS_MISSING: I think I know what this does, but I am not sure
503-
how to best communicate to users how to set this.
504-
505-
ace_L_R : list
506-
ACE_DOCS_MISSING: I am not sure how to set this.
507-
508-
ace_M_R : list
509-
ACE_DOCS_MISSING: I am not sure how to set this.
515+
If True, the maximum chemically reasonable cutoff will be used
516+
for all bonds. These maximum cutoff radii are based on the
517+
Van-der-Waals radii. Note that this may increase computation time!
510518
511519
ace_coupling_coefficients_type : str
512520
Coupling type used for reduction of spherical harmonic products.
513-
Can be "clebsch_gordan" or "wigner_3j".
521+
These come into play starting from equation 28 in the original
522+
ACE paper (doi.org/10.1103/PhysRevB.99.014104).
523+
Can be "clebsch_gordan" or "wigner_3j". This parameter usually does
524+
not have to be changed. The default is "clebsch_gordan".
514525
515526
ace_coupling_coefficients_maximum_l : int
516-
ACE_DOCS_MISSING: I think I know what this does, but I am not sure
517-
how to best communicate to users how to set this.
527+
The maximum l up to which to precompute the Clebsch-Gordan/Wigner 3j
528+
symbols. These are precomputed within MALA to reduce overall
529+
computation time, but to save on storage space, precomputation is only
530+
done to a certain l (for the meaning of l, refer to the original ACE
531+
paper, doi.org/10.1103/PhysRevB.99.014104, page 5). MALA automatically
532+
recomputes the coefficients if ace_coupling_coefficients_maximum_l is
533+
increased.
518534
"""
519535

520536
def __init__(self):
@@ -563,25 +579,10 @@ def __init__(self):
563579
self.ace_minimum_l_per_rank = [0, 0, 0]
564580

565581
# Flavors/extra options for the ACE descriptors.
566-
# TODO: This will become ace_cutoff, and the default should be 2.0!
567-
self.ace_nshell = 2.0
568-
569582
self.ace_balance_cutoff_radii_for_elements = False
570583
self.ace_larger_cutoff_for_metals = True
571-
572-
# TODO: Based on VdW radii
573584
self.ace_use_maximum_cutoff_per_element = False
574585

575-
# TODO: Move that into the ace.py class. Rename them, also they are
576-
# always 0 for now
577-
# Equivariance options for the ACE descriptors.
578-
# L_R: Transformation characteristics of the descriptor
579-
# (0: scalar, 1: vector, 2: tensor, etc.)
580-
# M_R: Selects which transformation within the subclass of
581-
# transformations selected by L_R.
582-
self.ace_L_R = 0
583-
self.ace_M_R = 0
584-
585586
# Other value could be "wigner3j".
586587
self.ace_coupling_coefficients_type = "clebsch_gordan"
587588

mala/descriptors/ace.py

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,27 @@ def __init__(self, parameters):
9292
self.__ace_grid_filter = True
9393
self.__ace_padfunc = True
9494

95+
# TODO: Move that into the ace.py class. Rename them, also they are
96+
# always 0 for now
97+
# Equivariance options for the ACE descriptors.
98+
# L_R: Transformation characteristics of the descriptor
99+
# (0: scalar, 1: vector, 2: tensor, etc.)
100+
# M_R: Selects which transformation within the subclass of
101+
# transformations selected by L_R.
102+
103+
# Transformation characteristic and selector, also referred to as
104+
# L_R and M_R, respectively. The former governs which type of
105+
# transformation characteristic the descriptors follow (i.e., do they
106+
# transform as 0: scalar, 1: vector, 2: tensor, etc.). The latter
107+
# selects which transformation within the subclass of transformations
108+
# selected by L_R is used. E.g., if _transformation_characteristic=1,
109+
# then the descriptors may transform like a p_x, p_y, or p_z orbital,
110+
# depending on the value of _transformation_selector (-1, 0, 1).
111+
# For now, these will always be 0. I put them as class attributes
112+
# so that they may be changed for debugging purposes.
113+
self._transformation_characteristic = 0
114+
self._transformation_selector = 0
115+
95116
# Consistency checks for the ACE settings.
96117
if (
97118
len(self.parameters.ace_included_expansion_ranks)
@@ -471,7 +492,7 @@ def _calculate_coupling_coeffs(self):
471492
ccs = wigner_coupling.wigner_3j_coupling(
472493
self.__precomputed_wigner_3j,
473494
ldict,
474-
L_R=self.parameters.ace_L_R,
495+
L_R=self._transformation_characteristic,
475496
)
476497

477498
elif (
@@ -480,7 +501,7 @@ def _calculate_coupling_coeffs(self):
480501
ccs = cg_coupling.clebsch_gordan_coupling(
481502
self.__precomputed_clebsch_gordan,
482503
ldict,
483-
L_R=self.parameters.ace_L_R,
504+
L_R=self._transformation_characteristic,
484505
)
485506

486507
else:
@@ -501,7 +522,7 @@ def _calculate_coupling_coeffs(self):
501522
max(self.parameters.ace_maximum_n_per_rank),
502523
self._cutoff_factors,
503524
self.__lambdas,
504-
ccs[self.parameters.ace_M_R],
525+
ccs[self._transformation_selector],
505526
rcutinner=rcinner,
506527
drcutinner=drcinner,
507528
lmin=self.parameters.ace_minimum_l_per_rank,

0 commit comments

Comments
 (0)