-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add IntegrationGrid settings #137
Comments
These should already be covered. We already have a |
Can you point exactly to what you meant here?
@EBB2675 what do you mean here? Are these grids in some spherical coordinates system? |
Indeed. A product between a radial and an angular grid is built for each atom, then transformed into a molecular grid. I was thinking of (roughly) something like this:
|
Ok, so I think it is time for restructuring better Most importantly, let's do some Math. These schema is about handling the following N-dimensional integrations: where this integration is typically numerically obtained by discrete summations (https://en.wikipedia.org/wiki/Numerical_integration, https://en.wikipedia.org/wiki/Gaussian_quadrature): Note:
So, I propose the following schema (let me know what you think): class Mesh(NumericalSettings):
"""
A base section used to define the mesh or space partitioning over which a discrete numerical integration is performed.
"""
dimensionality = Quantity(
type=np.int32,
default=3,
description="""
Dimensionality of the mesh: 1, 2, or 3. Defaults to 3.
""",
)
kind = Quantity(
type=MEnum('equidistant', 'logarithmic', 'tan'),
shape=['dimensionality'],
description="""
Kind of mesh identifying the spacing in each of the dimensions specified by `dimensionality`. It can take the values:
| Name | Description |
| --------- | -------------------------------- |
| `'equidistant'` | Equidistant grid (also known as 'Newton-Cotes') |
| `'logarithmic'` | log distance grid |
| `'Tan'` | Non-uniform tan mesh for grids. More dense at low abs values of the points, while less dense for higher values |
""",
)
grid = Quantity(
type=np.int32,
shape=['dimensionality'],
description="""
Amount of mesh point sampling along each axis.
""",
)
n_points = Quantity(
type=np.int32,
description="""
Number of points in the mesh.
""",
)
points = Quantity(
type=np.complex128,
shape=['n_points', 'dimensionality'],
description="""
List of all the points in the mesh.
""",
)
multiplicities = Quantity(
type=np.float64,
shape=['n_points'],
description="""
The amount of times the same point reappears. A value larger than 1, typically indicates
a symmetry operation that was applied to the `Mesh`.
""",
)
pruning = Quantity(
type=str,
description="""
Pruning method applied for reducing the amount of points in the Mesh. This is typically
used for numerical integration near the core levels in atoms, and it takes the value
`adaptive`.
"""
)
def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:
super().normalize(archive, logger)
if self.dimensionality not in [1, 2, 3]:
logger.error('`dimensionality` meshes different than 1, 2, or 3 are not supported.')
class NumericalIntegration(NumericalSettings):
"""
Numerical integration settings used to resolve the following type of integrals by discrete
numerical integration:
```math
\int_{\vec{r}_a}^{\vec{r}_b} d^3 \vec{r} F(\vec{r}) \approx \sum_{n=a}^{b} w(\vec{r}_n) F(\vec{r}_n)
```
Here, $F$ can be any type of function which would define the type of rules that can be applied
to solve such integral (e.g., 1D Gaussian quadrature rule or multi-dimensional `angular` rules like the
Lebedev quadrature rule).
These multidimensional integral has a `Mesh` defined over which the integration is performed, i.e., the
$\vec{r}_n$ points.
"""
coordinate = Quantity(
type=MEnum('all', 'radial', 'angular'),
description="""
Coordinate over which the integration is performed. `all` means the integration is performed in
all the space. `radial` and `angular` describe cases where the integration is performed for
functions which can be splitted into radial and angular distributions (e.g., orbital wavefunctions).
""",
)
integration_rule = Quantity(
type=str, # ? extend to MEnum?
description="""
Integration rule used. This can be any 1D Gaussian quadrature rule or multi-dimensional `angular` rules,
e.g., Lebedev quadrature rule (see e.g., Becke, Chem. Phys. 88, 2547 (1988)).
"""
)
weight_partitioning = Quantity(
type=str,
description="""
Approximation applied to the weight when doing the numerical integration. See e.g., C. W. Murray, N. C. Handy
and G. J. Laming, Mol. Phys. 78, 997 (1993).
"""
)
mesh = SubSection(sub_section=Mesh.m_def)
def normalize(self, archive: 'EntryArchive', logger: 'BoundLogger') -> None:
super().normalize(archive, logger) If you want radial and angular integrations, you need to instantiate twice the Now, I was reading a bit the ORCA docu page (https://www.faccts.de/docs/orca/6.0/manual/contents/detailed/numint.html), and I understand you wanted to add But! This shouldn't prevent us to inherit from |
thanks a lot! @JosePizarro3
So at the end, a typical calculation can look like: DFT GRID COSX GRID X1 COSX GRID X2 COSX GRID X3 and thats why I wanted to distinguish between XC and COSX grids. What would be the best way to accommodate these four grids in the schema? |
Question: does the atom-dependent integration sums up to give a global property? If so, I would define something called
Yeah, I was writing a long answer but I see the problem now. I think we could keep the definition of the function to be integrated, I wonder now whether we maintain this structure, we should add
Should this be added to |
Starting from @JosePizarro3's proposal (#137 (comment)). I largely agree with the suggestion, but have several remarks. I'll just list them here, but can make an example schema if needed.
|
I'd reverse the reference direction.
Could you elaborate on both? I suppose that the basis function cutoff that you have in mind is specific to atom-centered basis sets. If so, I agree with Chema's answer, that is should be implemented by the child class of |
The settings of numerical integration grids for molecular systems should be added to somewhere in NumericalSettings.
The angular grid scheme, the radial grid scheme, atom partitioning, and pruning method are the most important quantities that I can think of right now.
The text was updated successfully, but these errors were encountered: