-
Notifications
You must be signed in to change notification settings - Fork 13
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
General spliner class #212
Conversation
16bef0b
to
0033cb2
Compare
Here is a pre-built version of the code in this pull request: wheels.zip, you can install it locally by unzipping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The design looks good to me, although the derived class isn't doing much additional work. Maybe we could ask for a third person's opinion on this
0033cb2
to
87ecb0c
Compare
3831432
to
c41a737
Compare
c41a737
to
c72b89b
Compare
We have to repbase again metatensor but otherwise should be fine. |
8ef0ad4
to
5d6db7a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, I have some comments on minor API points & naming
Note that the integration range was deliberately left ambiguous since it depends | ||
on the radial basis, i.e. for the GTO basis, :math:`r \in R^+` is used, while | ||
:math:`r \in [0, cutoff]` for the monomial basis. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still disagree with this formulation ^_^. this is always an integral to +\infty, but sometime the function to integrate is 0 outside of the cutoff, so the integral can be simplified. But we can always define it as an integral from 0 to +\infty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fine for me to change it.
:parameter center_contribution: Contribution of the central atom required for LODE | ||
calculations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should point to the corresponding property documentation in the base class
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The properties are private. I don't know what we should point to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then we can duplicate the documentation here instead. I mainly want to have a definition of what "Contribution of the central atom required for LODE" means.
import numpy as np | ||
|
||
|
||
class SplinerBase(ABC): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this is specifically for tabulated radial integral, I think it should be reflected somewhere in the name:
class SplinerBase(ABC): | |
class RadialIntegralSplinerBase(ABC): |
return interpolated_values | ||
|
||
|
||
class SplinerFromFunction(SplinerBase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class SplinerFromFunction(SplinerBase): | |
class RadialIntegralFromFunction(SplinerBase): |
1-D array containing the values of the radial integral. :parameter cutoff: | ||
Spherical cutoff for the radial basis :parameter max_angular: number of radial | ||
components |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1-D array containing the values of the radial integral. :parameter cutoff: | |
Spherical cutoff for the radial basis :parameter max_angular: number of radial | |
components | |
1-D array containing the values of the radial integral. | |
:parameter cutoff: Spherical cutoff for the radial basis |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks. Always these issues with the auto formatting.
5d6db7a
to
9938d12
Compare
|
||
# The hardcoded displacement is a only a valid choice of the positions are in a | ||
# reasonable range. | ||
assert np.abs(positions).mean() >= 1.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we do a propper raise here? Probably it is better...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would be nice yes =)
201c48d
to
7299d88
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, once CI is happy we can merge!
Classes for generating spline points which can be used as input for the for the radial | ||
integral hyper paramater option. For an complete example for the LE how to use the | ||
classes see :ref:`example-splines`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Classes for generating spline points which can be used as input for the for the radial | |
integral hyper paramater option. For an complete example for the LE how to use the | |
classes see :ref:`example-splines`. | |
Classes for generating spline points which can be used as input for the radial | |
integral hyper parameter option. For an complete example on how to use the | |
classes see :ref:`example-splines`. |
:members: | ||
:show-inheritance: | ||
|
||
.. autoclass:: rascaline.utils.RadialIntegralFromFunction |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should pick a place for these. I see you like to have them in the module docstring, and I prefer them in the docs sources. Let's chat about it in the meeting later today?
radial basis function and :math:`n` the current radial channel. This should be | ||
implemented in the child classes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
radial basis function and :math:`n` the current radial channel. This should be | |
implemented in the child classes. | |
radial basis function and :math:`n` the current radial channel. This should be | |
precomputed and provided separately. |
7299d88
to
fa37ad1
Compare
Also allow to calculate the derivative of the radial integral numerically.
fa37ad1
to
c835ea8
Compare
__init__.py
, i.e. adding an__all__
list.Splitting the code into a
SplinerBase
andSplinerFromFunction
class sounds maybe like an overkill here. However, this is only the first commit and should serve as a discussion basis for the architecture of the classes. After we agree on the design I will use the base class to extend the splining classes to more real and also kspace splining classes.📚 Documentation preview 📚: https://rascaline--212.org.readthedocs.build/en/212/