Skip to content

Commit 60386ca

Browse files
committed
Added /edited comments
1 parent b880c39 commit 60386ca

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

arkane/statmech.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,7 @@ def project_rotors(conformer, hessian, rotors, linear, is_ts, get_projected_out_
10831083
p[:, 0:external] = d[:, 0:external]
10841084
p[:, external:external + 3 * n_atoms] = identity[:, 0:3 * n_atoms]
10851085

1086+
# modified Gram–Schmidt orthonormalization
10861087
for i in range(3 * n_atoms + external):
10871088
norm = 0.0
10881089
for j in range(3 * n_atoms):
@@ -1091,15 +1092,15 @@ def project_rotors(conformer, hessian, rotors, linear, is_ts, get_projected_out_
10911092
if norm > 1E-15:
10921093
p[j, i] /= np.sqrt(norm)
10931094
else:
1094-
p[j, i] = 0.0
1095+
p[j, i] = 0.0 # zeroing out vectors that are nearly zero or dependent, could lose a basis
10951096
for j in range(i + 1, 3 * n_atoms + external):
10961097
proj = 0.0
10971098
for k in range(3 * n_atoms):
10981099
proj += p[k, i] * p[k, j]
10991100
for k in range(3 * n_atoms):
11001101
p[k, j] -= proj * p[k, i]
11011102

1102-
# Order p, there will be vectors that are 0.0
1103+
# Order p, since there will be vectors that are 0.0
11031104
i = 0
11041105
is_zero_column = (p*p).sum(axis=0) < 0.5
11051106
# put the columns that are zeros at the end

0 commit comments

Comments
 (0)