Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin Kazuki Huguenin-Dumittan committed Nov 24, 2023
1 parent df97859 commit 8c997a3
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 8 deletions.
4 changes: 4 additions & 0 deletions docs/src/references/fourier_convolution.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.. automodule:: meshlode.fourier_convolution
:members:
:undoc-members:
:show-inheritance:
2 changes: 2 additions & 0 deletions docs/src/references/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ functions toegther you might take a look at the :ref:`userdoc-how-to` section.
:maxdepth: 1

calculators/index
fourier_convolution
mesh_interpolator
4 changes: 4 additions & 0 deletions docs/src/references/mesh_interpolator.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.. automodule:: meshlode.mesh_interpolator
:members:
:undoc-members:
:show-inheritance:
13 changes: 5 additions & 8 deletions src/meshlode/fourier_convolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,11 @@ def compute(self, mesh_values: torch.tensor, kernel_func, value_at_origin=None)
:param mesh_values: torch.tensor of shape (n_channels, nx, ny, nz)
The values of the density defined on a mesh.
:param kernel_func: function
The kernel function takes k**2 as an argument and should
output the Fourier transform of the potential.
For the standard Ewald summation using the Coulomb potential
of a Gaussian charge density:
G(k) = 4pi / k**2 * exp(-0.5*(sigma*k)**2)
and hence
kernel_func(x) = 4pi / x * exp(-0.5*sigma**2 * x)
since x=k**2.
The kernel function takes k**2 as an argument and should output the Fourier
transform of the potential. For the standard Ewald summation using the
Coulomb potential of a Gaussian charge density:
:math:`G(k) = 4pi / k**2 * exp(-0.5*(sigma*k)**2)` and hence
:math:`kernel_func(x) = 4pi / x * exp(-0.5*sigma**2 * x)` since x=k**2.
:param value_at_origin: float
For some kernel functions like the one above, the value
at k=0 is singular. In such cases, it is possible to
Expand Down
2 changes: 2 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ lint_folders =
"{toxinidir}/docs/src/" \
"{toxinidir}/examples"

[testenv]
passenv = *

[testenv:build]
# builds the package and checks integrity
Expand Down

0 comments on commit 8c997a3

Please sign in to comment.