Conventions#
Spherical Coordinates#
Spherical coordinates \((r, \theta, \phi)\) are used extensively throughout the molecular, atomic, and angular grid modules. The radius \(r \in [0, \infty)\), azimuthal \(\theta \in [-\pi, \pi]\) and polar \(\phi \in [0, \pi)\) angles are defined from Cartesian coordinates as:
such that when the radius is zero \(r=0\), the angles are zero \(\theta, \phi = 0\).
Grid offers a utility function to convert to spherical coordinates:
import numpy as np
from grid.utils import convert_cart_to_sph
# Generate random set of points
cart_pts = np.random.uniform((-100, 100), size=(1000, 3))
# Convert to spherical coordinates
spher_pts = convert_cart_to_sph(cart_pts)
# Convert to spherical coordinates, centered at [1, 1, 1]
spher_pts = convert_cart_to_sph(cart_pts, center=np.array([1.0, 1.0, 1.0]))
The atomic grid class can also convert its points to spherical coordinates:
from grid.atomgrid import AtomGrid
atom_grid = AtomGrid(...)
spher_pts = atom_grid.convert_cartesian_to_spherical()
With the convention that when \(r=0\), the angles within \(\{(0, \theta_j, \phi_j)\}\) in that shell are obtained from an angular grid \(\{(\theta_j, \phi_j)\}\) with some degree.
Spherical Harmonics#
The real spherical harmonics are defined using complex spherical harmonics:
where the degree \(l \in \mathbb{N}\), order \(m \in \{-l, \cdots, l\}\) and \(Y^m_l\) is the complex spherical harmonic. The Condon-Shortley phase is not included.
Alternatively, using the associated Legendre polynomials \(P_l^m\) (without the Condon-Shortley phase):
Grid offers the generate_real_spherical_harmonics function:
from grid.utils import generate_real_spherical_harmonics
spher_pts = np.array(...)
theta = spher_pts[:, 1]
phi = spher_pts[:, 2]
# Generate all degrees up to l=2
spherical_harmonics = generate_real_spherical_harmonics(2, theta, phi)
Ordering#
The spherical harmonics are ordered by degree \(l\) in ascending order. For each degree \(l\), the orders \(m\) are in HORTON2 order:
Angular Grids#
The angular grids integrate functions over the unit sphere.
The quadrature weights are chosen so that the spherical harmonics are orthonormal:
The weights also sum to \(4\pi\).
Nested Grids#
Angular grids of different degrees can be very close to one another. The following shows the mean with standard deviation and maximum distance between an angular grid of one degree and the next higher degree. The * indicates Lebedev-Laikov grids with negative weights.
Degree |
Number Points |
Mean (std) Distance |
Max Distance |
|---|---|---|---|
3 |
6 |
0.0(0.0) |
0.0 |
5 |
18 |
0.0(0.0) |
0.0 |
7 |
26 |
0.14(0.15) |
0.31 |
9 |
38 |
0.19(0.15) |
0.31 |
11 |
50 |
0.15(0.15) |
0.31 |
13* |
74 |
0.11(0.082) |
0.2 |
15 |
86 |
0.052(0.042) |
0.12 |
17 |
110 |
0.065(0.047) |
0.14 |
19 |
146 |
0.048(0.048) |
0.14 |
21 |
170 |
0.035(0.027) |
0.089 |
23 |
194 |
0.061(0.047) |
0.16 |
25* |
230 |
0.058(0.036) |
0.12 |
27* |
266 |
0.045(0.035) |
0.13 |
29 |
302 |
0.055(0.036) |
0.14 |
31 |
350 |
0.042(0.028) |
0.1 |
35 |
434 |
0.054(0.021) |
0.092 |
41 |
590 |
0.048(0.019) |
0.082 |
47 |
770 |
0.043(0.017) |
0.074 |
53 |
974 |
0.038(0.015) |
0.065 |
59 |
1202 |
0.035(0.014) |
0.06 |
65 |
1454 |
0.032(0.012) |
0.054 |
71 |
1730 |
0.03(0.011) |
0.05 |
77 |
2030 |
0.027(0.011) |
0.047 |
83 |
2354 |
0.026(0.0099) |
0.043 |
89 |
2702 |
0.024(0.0093) |
0.041 |
95 |
3074 |
0.023(0.0088) |
0.039 |
101 |
3470 |
0.021(0.0083) |
0.036 |
107 |
3890 |
0.02(0.0078) |
0.035 |
113 |
4334 |
0.019(0.0075) |
0.033 |
119 |
4802 |
0.018(0.007) |
0.031 |
125 |
5294 |
0.018(0.0066) |
0.03 |
Degree |
Number Points |
Mean (std) Distance |
Max Distance |
|---|---|---|---|
1 |
2 |
0.0(0.0) |
0.0 |
3 |
6 |
0.34(0.24) |
0.55 |
5 |
12 |
0.22(0.13) |
0.35 |
7 |
32 |
0.16(0.076) |
0.26 |
9 |
48 |
0.14(0.071) |
0.26 |
11 |
70 |
0.14(0.045) |
0.23 |
13 |
94 |
0.12(0.047) |
0.2 |
15 |
120 |
0.11(0.041) |
0.19 |
17 |
156 |
0.088(0.038) |
0.16 |
19 |
192 |
0.078(0.036) |
0.14 |
21 |
234 |
0.077(0.033) |
0.14 |
23 |
278 |
0.075(0.027) |
0.13 |
25 |
328 |
0.066(0.029) |
0.11 |
27 |
380 |
0.061(0.023) |
0.11 |
29 |
438 |
0.057(0.024) |
0.1 |
31 |
498 |
0.06(0.021) |
0.1 |
33 |
564 |
0.047(0.02) |
0.094 |
35 |
632 |
0.05(0.019) |
0.085 |
37 |
706 |
0.048(0.018) |
0.085 |
39 |
782 |
0.039(0.017) |
0.074 |
41 |
864 |
0.045(0.017) |
0.079 |
43 |
948 |
0.043(0.015) |
0.074 |
45 |
1038 |
0.041(0.015) |
0.071 |
47 |
1130 |
0.037(0.014) |
0.068 |
49 |
1228 |
0.033(0.014) |
0.064 |
51 |
1328 |
0.034(0.013) |
0.062 |
53 |
1434 |
0.034(0.013) |
0.061 |
55 |
1542 |
0.03(0.012) |
0.054 |
57 |
1656 |
0.034(0.011) |
0.057 |
59 |
1772 |
0.03(0.011) |
0.054 |
61 |
1894 |
0.025(0.011) |
0.05 |
63 |
2018 |
0.029(0.011) |
0.052 |
65 |
2148 |
0.029(0.011) |
0.052 |
67 |
2280 |
0.025(0.01) |
0.05 |
69 |
2418 |
0.027(0.0095) |
0.048 |
71 |
2558 |
0.027(0.0093) |
0.048 |
73 |
2704 |
0.022(0.0095) |
0.045 |
75 |
2852 |
0.024(0.0091) |
0.044 |
77 |
3006 |
0.02(0.0085) |
0.041 |
79 |
3162 |
0.023(0.0086) |
0.041 |
81 |
3324 |
0.023(0.0084) |
0.042 |
83 |
3488 |
0.02(0.0081) |
0.04 |
85 |
3658 |
0.022(0.0083) |
0.04 |
87 |
3830 |
0.022(0.0081) |
0.039 |
89 |
4008 |
0.018(0.0076) |
0.036 |
91 |
4188 |
0.02(0.0073) |
0.036 |
93 |
4374 |
0.018(0.0075) |
0.036 |
95 |
4562 |
0.02(0.0074) |
0.036 |
97 |
4756 |
0.019(0.007) |
0.034 |
99 |
4952 |
0.016(0.0067) |
0.031 |
101 |
5154 |
0.018(0.0067) |
0.034 |
103 |
5358 |
0.016(0.0064) |
0.031 |
105 |
5568 |
0.018(0.0064) |
0.031 |
107 |
5780 |
0.018(0.0063) |
0.032 |
109 |
5998 |
0.015(0.0062) |
0.03 |
111 |
6218 |
0.017(0.0062) |
0.03 |
113 |
6444 |
0.017(0.0061) |
0.029 |
115 |
6672 |
0.014(0.006) |
0.027 |
117 |
6906 |
0.016(0.006) |
0.029 |
119 |
7142 |
0.016(0.0056) |
0.029 |
121 |
7384 |
0.016(0.0056) |
0.028 |
123 |
7628 |
0.015(0.0056) |
0.027 |
125 |
7878 |
0.013(0.0054) |
0.027 |
127 |
8130 |
0.015(0.0056) |
0.027 |
129 |
8388 |
0.014(0.0053) |
0.027 |
131 |
8648 |
0.012(0.0051) |
0.025 |
133 |
8914 |
0.014(0.0054) |
0.025 |
135 |
9182 |
0.012(0.005) |
0.025 |
137 |
9456 |
0.014(0.0052) |
0.025 |
139 |
9732 |
0.014(0.0048) |
0.024 |
141 |
10014 |
0.013(0.005) |
0.025 |
143 |
10298 |
0.011(0.0047) |
0.023 |
145 |
10588 |
0.013(0.0049) |
0.023 |
147 |
10880 |
0.01(0.0047) |
0.022 |
149 |
11178 |
0.013(0.0047) |
0.023 |
151 |
11478 |
0.013(0.0045) |
0.023 |
153 |
11784 |
0.01(0.0044) |
0.022 |
155 |
12092 |
0.012(0.0045) |
0.022 |
157 |
12406 |
0.01(0.0043) |
0.021 |
159 |
12722 |
0.012(0.0044) |
0.022 |
161 |
13044 |
0.012(0.0044) |
0.021 |
163 |
13368 |
0.0096(0.0042) |
0.02 |
165 |
13698 |
0.011(0.0043) |
0.021 |
167 |
14030 |
0.011(0.0042) |
0.02 |
169 |
14368 |
0.0092(0.004) |
0.02 |
171 |
14708 |
0.011(0.004) |
0.02 |
173 |
15054 |
0.011(0.004) |
0.02 |
175 |
15402 |
0.0086(0.0039) |
0.02 |
177 |
15756 |
0.01(0.004) |
0.019 |
179 |
16112 |
0.0085(0.0039) |
0.018 |
181 |
16474 |
0.01(0.0038) |
0.019 |
183 |
16838 |
0.011(0.0037) |
0.019 |
185 |
17208 |
0.01(0.0038) |
0.018 |
187 |
17580 |
0.0087(0.0036) |
0.018 |
189 |
17958 |
0.0081(0.0036) |
0.017 |
191 |
18338 |
0.0098(0.0036) |
0.018 |
193 |
18724 |
0.0099(0.0036) |
0.018 |
195 |
19112 |
0.0098(0.0035) |
0.018 |
197 |
19506 |
0.0078(0.0034) |
0.017 |
199 |
19902 |
0.0076(0.0034) |
0.017 |
201 |
20304 |
0.0095(0.0034) |
0.017 |
203 |
20708 |
0.0094(0.0033) |
0.017 |
205 |
21118 |
0.0075(0.0033) |
0.016 |
207 |
21530 |
0.0091(0.0033) |
0.017 |
209 |
21948 |
0.009(0.0033) |
0.016 |
211 |
22368 |
0.0089(0.0033) |
0.016 |
213 |
22794 |
0.0072(0.0032) |
0.016 |
215 |
23222 |
0.009(0.0032) |
0.016 |
217 |
23656 |
0.0071(0.0031) |
0.016 |
219 |
24092 |
0.0087(0.0032) |
0.016 |
221 |
24534 |
0.0069(0.0031) |
0.015 |
223 |
24978 |
0.0086(0.0031) |
0.016 |
225 |
25428 |
0.0084(0.003) |
0.015 |
227 |
25880 |
0.0066(0.003) |
0.015 |
229 |
26338 |
0.0083(0.003) |
0.015 |
231 |
26798 |
0.0082(0.003) |
0.015 |
233 |
27264 |
0.0065(0.003) |
0.015 |
235 |
27732 |
0.0081(0.003) |
0.015 |
237 |
28206 |
0.0064(0.0028) |
0.015 |
239 |
28682 |
0.0079(0.0029) |
0.015 |
241 |
29164 |
0.0062(0.0028) |
0.014 |
243 |
29648 |
0.006(0.0028) |
0.014 |
245 |
30138 |
0.0078(0.0028) |
0.014 |
247 |
30630 |
0.0077(0.0028) |
0.014 |
249 |
31128 |
0.006(0.0027) |
0.013 |
251 |
31628 |
0.0076(0.0028) |
0.014 |
253 |
32134 |
0.0076(0.0027) |
0.014 |
255 |
32642 |
0.0075(0.0027) |
0.014 |
257 |
33156 |
0.0059(0.0026) |
0.013 |
259 |
33672 |
0.0074(0.0026) |
0.013 |
261 |
34194 |
0.0058(0.0026) |
0.013 |
263 |
34718 |
0.0071(0.0027) |
0.013 |
265 |
35248 |
0.0055(0.0025) |
0.013 |
267 |
35780 |
0.0071(0.0026) |
0.013 |
269 |
36318 |
0.0071(0.0026) |
0.013 |
271 |
36858 |
0.0054(0.0024) |
0.012 |
273 |
37404 |
0.007(0.0025) |
0.013 |
275 |
37952 |
0.007(0.0025) |
0.012 |
277 |
38506 |
0.0054(0.0024) |
0.012 |
279 |
39062 |
0.0068(0.0025) |
0.012 |
281 |
39624 |
0.0052(0.0024) |
0.012 |
283 |
40188 |
0.0068(0.0025) |
0.012 |
285 |
40758 |
0.0068(0.0024) |
0.012 |
287 |
41330 |
0.0066(0.0025) |
0.012 |
289 |
41908 |
0.0051(0.0023) |
0.011 |
291 |
42488 |
0.0065(0.0024) |
0.012 |
293 |
43074 |
0.0051(0.0023) |
0.011 |
295 |
43662 |
0.0065(0.0023) |
0.012 |
297 |
44256 |
0.005(0.0023) |
0.011 |
299 |
44852 |
0.0064(0.0023) |
0.011 |
301 |
45454 |
0.0064(0.0023) |
0.011 |
303 |
46058 |
0.0063(0.0023) |
0.011 |
305 |
46668 |
0.0049(0.0023) |
0.011 |
307 |
47280 |
0.0062(0.0023) |
0.011 |
309 |
47898 |
0.0047(0.0022) |
0.011 |
311 |
48518 |
0.0061(0.0022) |
0.011 |
313 |
49144 |
0.0047(0.0022) |
0.011 |
315 |
49772 |
0.0061(0.0022) |
0.011 |
317 |
50406 |
0.0059(0.0022) |
0.011 |
319 |
51042 |
0.0059(0.0022) |
0.011 |
321 |
51684 |
0.0046(0.0021) |
0.011 |
323 |
52328 |
0.0047(0.0021) |
0.01 |