Skip to content

Commit 83d625c

Browse files
committed
doc updates for tree coupling and common
1 parent a8f2ebd commit 83d625c

3 files changed

Lines changed: 23 additions & 21 deletions

File tree

mala/descriptors/acelib/common_utils.py

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,21 @@
88

99
def filled_perm(tuples, rank):
1010
"""
11-
Create a filled permutation.
12-
13-
ACE_DOCS_MISSING - What is this used for?
11+
Returns the sympy permutation from permutations of N tabulated from GAP
1412
1513
Parameters
1614
----------
1715
tuples : List
18-
List of tuples.
16+
list of touples indicating the partitions of N (e.g., for the (2,2) partition of 4,
17+
tuples should be [(0,1),(2,3)]
1918
2019
rank : int
21-
Rank of the permutation.
20+
Rank of the descriptor (N)
2221
2322
Returns
2423
-------
2524
Permutation : sympy.combinatorics.Permutation
26-
Permutation object.
25+
Permutation object for the permutations.
2726
"""
2827
allinds = list(range(rank))
2928
try:
@@ -152,7 +151,7 @@ def group_vector_by_nodes_pairwise(vector, nodes, remainder=None):
152151
List of nodes by which to pair vector.
153152
154153
remainder
155-
ACE_DOCS_MISSING
154+
Remainder node for binary trees with odd numbers of leaves.
156155
157156
Returns
158157
-------
@@ -162,8 +161,7 @@ def group_vector_by_nodes_pairwise(vector, nodes, remainder=None):
162161
tuple([vector[node[0]], vector[node[1]]]) for node in nodes
163162
]
164163

165-
# ACE_DOCS_MISSING - Am I missing something here that needs to be
166-
# documented or does remainder really do nothing?
164+
# for combinations of 2-cycles, nothing else needs to be done
167165
if remainder is not None:
168166
vector_by_tuples = vector_by_tuples
169167
return vector_by_tuples
@@ -173,12 +171,12 @@ def get_ms(l_vector, M_R=0):
173171
r"""
174172
Retrieve the set of m_i combination with \sum_i m_i = M_R.
175173
176-
These combinations are retrieved for an arbitrary l vector.
174+
These combinations are retrieved for an arbitrary l multiset.
177175
178176
Parameters
179177
----------
180178
l_vector : List
181-
Arbitrary vector.
179+
collection of angular momentum quantum numbers corresponding to spherical harmonics l1,l2...lN
182180
183181
M_R : int
184182
Sum to which combinations sum.
@@ -203,18 +201,19 @@ def get_ms(l_vector, M_R=0):
203201

204202
def check_triangle(l1, l2, l3):
205203
"""
206-
Check if a triangle can be formed with the given sides.
204+
check if three quantum angular momenta obey triangle conditions. Note that
205+
the order matters.
207206
208207
Parameters
209208
----------
210209
l1 : int
211-
Length of the first side.
210+
angular momentum quantum number 1
212211
213212
l2 : int
214-
Length of the second side.
213+
angular momentum quantum number 2
215214
216215
l3 : int
217-
Length of the third side.
216+
angular momentum quantum number 3
218217
219218
220219
Returns

mala/descriptors/acelib/coupling_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ def build_tree_for_l_intermediates(l, L_R=0):
5353
Parameters
5454
----------
5555
l : List
56-
List of angular momentum quantum numbers. These correspond to the N
57-
spherical harmonics in the ACE descriptor(s).
56+
list (multiset) of angular momentum indices l1,l2,...lN. These correspond
57+
to the N spherical harmonics in the ACE descriptor(s).
5858
5959
L_R : int
6060
Resultant angular momentum quantum number. This determines the equivariant

mala/descriptors/acelib/tree_sorting.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,13 +270,16 @@ def build_full_tree(l, L, L_R):
270270
Parameters
271271
----------
272272
l : List
273-
ACE_DOCS_MISSING
273+
list (multiset) of angular momentum indices l1,l2,...lN
274274
275275
L : List
276-
ACE_DOCS_MISSING
276+
list (multiset) of intermediate angular momentum indices l1,l2,...lN
277277
278278
L_R : int
279-
ACE_DOCS_MISSING
279+
Resultant angular momentum quantum number. This determines the equivariant
280+
character of the rank N descriptor after reduction. L_R=0 corresponds to
281+
a rotationally invariant feature, L_R=1 corresponds to a feature that
282+
transforms like a vector, L_R=2 a tensor, etc.
280283
281284
Returns
282285
-------
@@ -359,7 +362,7 @@ def rank_2_binary(l_parent, l_left, l_right):
359362

360363
def build_quick_tree(l):
361364
"""
362-
Build a quick tree from the given list.
365+
Build a binary tree from the given list.
363366
364367
Rank is assumed to be the length of the list. If the rank is odd, a
365368
remainder is returned.

0 commit comments

Comments
 (0)