@@ -52,66 +52,45 @@ class Smearing(NumericalSettings):
52
52
53
53
class Mesh (ArchiveSection ):
54
54
"""
55
- A base section used to specify the settings of a sampling mesh.
56
- It supports uniformly-spaced meshes and symmetry-reduced representations.
55
+ A base section used to define the mesh or space partitioning over which a discrete numerical integration is performed.
57
56
"""
58
57
59
- spacing = Quantity (
60
- type = MEnum ( 'Equidistant' , 'Logarithmic' , 'Tan' ) ,
61
- shape = [ 'dimensionality' ] ,
58
+ dimensionality = Quantity (
59
+ type = np . int32 ,
60
+ default = 3 ,
62
61
description = """
63
- Identifier for the spacing of the Mesh. Defaults to 'Equidistant' if not defined. It can take the values:
64
-
65
- | Name | Description |
66
- | --------- | -------------------------------- |
67
- | `'Equidistant'` | Equidistant grid (also known as 'Newton-Cotes') |
68
- | `'Logarithmic'` | log distance grid |
69
- | `'Tan'` | Non-uniform tan mesh for grids. More dense at low abs values of the points, while less dense for higher values |
62
+ Dimensionality of the mesh: 1, 2, or 3. Defaults to 3.
70
63
""" ,
71
64
)
72
65
73
- quadrature = Quantity (
74
- type = MEnum (
75
- 'Gauss-Legendre' ,
76
- 'Gauss-Laguerre' ,
77
- 'Clenshaw-Curtis' ,
78
- 'Newton-Cotes' ,
79
- 'Gauss-Hermite' ,
80
- ),
66
+ kind = Quantity (
67
+ type = MEnum ('equidistant' , 'logarithmic' , 'tan' ),
68
+ shape = ['dimensionality' ],
81
69
description = """
82
- Quadrature rule used for integration of the Mesh. This quantity is relevant for 1D meshes :
70
+ Kind of mesh identifying the spacing in each of the dimensions specified by `dimensionality`. It can take the values :
83
71
84
72
| Name | Description |
85
73
| --------- | -------------------------------- |
86
- | `'Gauss-Legendre'` | Quadrature rule for integration using Legendre polynomials |
87
- | `'Gauss-Laguerre'` | Quadrature rule for integration using Laguerre polynomials |
88
- | `'Clenshaw-Curtis'` | Quadrature rule for integration using Chebyshev polynomials using discrete cosine transformations |
89
- | `'Gauss-Hermite'` | Quadrature rule for integration using Hermite polynomials |
90
- """ ,
91
- ) # ! @JosePizarro3 I think that this is separate from the spacing
92
-
93
- n_points = Quantity (
94
- type = np .int32 ,
95
- description = """
96
- Number of points in the mesh.
74
+ | `'equidistant'` | Equidistant grid (also known as 'Newton-Cotes') |
75
+ | `'logarithmic'` | log distance grid |
76
+ | `'Tan'` | Non-uniform tan mesh for grids. More dense at low abs values of the points, while less dense for higher values |
97
77
""" ,
98
78
)
99
79
100
- dimensionality = Quantity (
80
+ grid = Quantity (
101
81
type = np .int32 ,
102
- default = 3 ,
82
+ shape = [ 'dimensionality' ] ,
103
83
description = """
104
- Dimensionality of the mesh: 1, 2, or 3. Defaults to 3 .
84
+ Amount of mesh point sampling along each axis .
105
85
""" ,
106
86
)
107
87
108
- grid = Quantity (
88
+ n_points = Quantity (
109
89
type = np .int32 ,
110
- shape = ['dimensionality' ],
111
90
description = """
112
- Amount of mesh point sampling along each axis. See `type` for the axes definition .
91
+ Number of points in the mesh .
113
92
""" ,
114
- ) # ? @JosePizzaro3: should the mesh also contain its boundary information
93
+ )
115
94
116
95
points = Quantity (
117
96
type = np .complex128 ,
@@ -126,23 +105,73 @@ class Mesh(ArchiveSection):
126
105
shape = ['n_points' ],
127
106
description = """
128
107
The amount of times the same point reappears. A value larger than 1, typically indicates
129
- a symmetry operation that was applied to the `Mesh`. This quantity is equivalent to `weights`:
130
-
131
- multiplicities = n_points * weights
108
+ a symmetry operation that was applied to the `Mesh`.
132
109
""" ,
133
110
)
134
111
135
- weights = Quantity (
136
- type = np .float64 ,
137
- shape = ['n_points' ],
112
+ pruning = Quantity (
113
+ type = MEnum ('fixed' , 'adaptive' ),
138
114
description = """
139
- Weight of each point. A value smaller than 1, typically indicates a symmetry operation that was
140
- applied to the mesh. This quantity is equivalent to `multiplicities`:
115
+ Pruning method applied for reducing the amount of points in the Mesh. This is typically
116
+ used for numerical integration near the core levels in atoms.
117
+ In the fixed grid methods, the number of angular grid points is predetermined for
118
+ ranges of radial grid points, while in the adaptive methods, the angular grid is adjusted
119
+ on-the-fly for each radial point according to some accuracy criterion.
120
+ """
121
+ )
122
+
123
+ def normalize (self , archive : 'EntryArchive' , logger : 'BoundLogger' ) -> None :
124
+ super ().normalize (archive , logger )
141
125
142
- weights = multiplicities / n_points
126
+ if self .dimensionality not in [1 , 2 , 3 ]:
127
+ logger .error ('`dimensionality` meshes different than 1, 2, or 3 are not supported.' )
128
+
129
+
130
+ class NumericalIntegration (NumericalSettings ):
131
+ """
132
+ Numerical integration settings used to resolve the following type of integrals by discrete
133
+ numerical integration:
134
+
135
+ ```math
136
+ \int_{\v ec{r}_a}^{\v ec{r}_b} d^3 \v ec{r} F(\v ec{r}) \a pprox \sum_{n=a}^{b} w(\v ec{r}_n) F(\v ec{r}_n)
137
+ ```
138
+
139
+ Here, $F$ can be any type of function which would define the type of rules that can be applied
140
+ to solve such integral (e.g., 1D Gaussian quadrature rule or multi-dimensional `angular` rules like the
141
+ Lebedev quadrature rule).
142
+
143
+ These multidimensional integral has a `Mesh` defined over which the integration is performed, i.e., the
144
+ $\v ec{r}_n$ points.
145
+ """
146
+
147
+ coordinate = Quantity (
148
+ type = MEnum ('all' , 'radial' , 'angular' ),
149
+ description = """
150
+ Coordinate over which the integration is performed. `all` means the integration is performed in
151
+ all the space. `radial` and `angular` describe cases where the integration is performed for
152
+ functions which can be splitted into radial and angular distributions (e.g., orbital wavefunctions).
143
153
""" ,
144
154
)
145
155
156
+ integration_rule = Quantity (
157
+ type = str , # ? extend to MEnum?
158
+ description = """
159
+ Integration rule used. This can be any 1D Gaussian quadrature rule or multi-dimensional `angular` rules,
160
+ e.g., Lebedev quadrature rule (see e.g., Becke, Chem. Phys. 88, 2547 (1988)).
161
+ """
162
+ )
163
+
164
+ weight_partitioning = Quantity (
165
+ type = str ,
166
+ description = """
167
+ Approximation applied to the weight when doing the numerical integration.
168
+ See e.g., C. W. Murray, N. C. Handy
169
+ and G. J. Laming, Mol. Phys. 78, 997 (1993).
170
+ """
171
+ )
172
+
173
+ mesh = SubSection (sub_section = Mesh .m_def )
174
+
146
175
def normalize (self , archive : 'EntryArchive' , logger : 'BoundLogger' ) -> None :
147
176
super ().normalize (archive , logger )
148
177
@@ -908,4 +937,4 @@ class GTOIntegralDecomposition(NumericalSettings):
908
937
)
909
938
910
939
def normalize (self , archive : 'EntryArchive' , logger : 'BoundLogger' ) -> None :
911
- super ().normalize (archive , logger )
940
+ super ().normalize (archive , logger )
0 commit comments