Transformed cube (#15)
Promolecular Transformation of a Cubic grid class. This is regarding issue #15.
Functionality
- Transform Cubic Grid in [0,1]^3 to R^3 using promolecular.
- Transform individual points.
- Integration (has weak tests).
- Jacobian of Transformation.
- Steepest-ascent of a function in Theta space.
- Directional derivatives in Theta space (Not Tested).
- Instead of [0,1]^3, change to [-1, 1]^3 and in docs (a35a07e).
- Added dynamic bracketing (b8fc2b2).
- Added Cubic Grid as Tensor Product of OneD grids (c104ac6).
- Added tolerance and using masked arrays for integration (eb32897).
- Hessian of transformation (9e73400)
- Interpolation and Derivative Interpolation (8727c0a).
- Python dataclass is not in py36 (187c00e).
TODO
- Make/Reduce tests faster
- Vectorize Logarithm Interpoaltion
- Test for Directional Derivative.
May 16, 2023. All of the TODO except for the "Directional derivative tests" are now fixed/added.
Codecov Report
Attention: 14 lines in your changes are missing coverage. Please review.
Comparison is base (
df822cf) 100.00% compared to head (187c00e) 99.12%. Report is 268 commits behind head on master.
:exclamation: Current head 187c00e differs from pull request most recent head 435577e. Consider uploading reports for the commit 435577e to get more accurate results
| Files | Patch % | Lines |
|---|---|---|
| src/grid/protransform.py | 95.30% | 14 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## master #96 +/- ##
===========================================
- Coverage 100.00% 99.12% -0.88%
===========================================
Files 14 14
Lines 1385 1592 +207
===========================================
+ Hits 1385 1578 +193
- Misses 0 14 +14
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@Ali-Tehrani does this need to be dusted off after the cubic grid is merged? If not, is it ready to be reviewed?
- [ ] Integrate this with the cubic grid class.
- [ ] Address https://github.com/theochem/grid/issues/15
Added new changes:
- It is a subclass of the base-class Hyper-Rectangle class in cubic
- Interpolation in cubic.py only worked for a single point when use_log=True and derivatives are wanted. This is now fixed and the tests were updated.
- Promolecular Transform Tests were updated, improved and randomized over a grid of points rather than a fixed set.
- Interpolation with Promol Transform now works.
- The requirement that promolecular transform requires boundary is removed and now works over any grid
This is not urgent, but in the interest of getting it (eventually) merged, I've assigned @marco-2023 to it. @marco-2023 we can talk about this at some point. One nice feature of this grid is that it is easy to adapt, at least in principle.
The easiest way to iteratively refine the grid is to take each grid point and identify its closest neighbors. The value of $f(\mathbf{r}_k)$ should ideally be very similar for these points; in particular we would like the second derivative of $f(\mathbf{r})$, times the square of the step-size in a given direction, to be small. One can iteratively refine by subdividing cubes until this quantity is sufficiently negligible.
This would need to be thought through carefully, but this is the basic idea. It is a reasonably efficient procedure once an initial kd-tree is constructed, I think.