-
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
PME for Magnetostatics #54
Comments
This would be very nice, agreed. But maybe this can wait until we released some kind of 1.0? |
Yes, I think it has a low priority and probably high difficulty. But, whoever wants, is encouraged to jump on it. :-) |
As for other things, if you see "design constraints" that would prevent this, and which we can address now (without going on with a full implementation) it'd be worth to consider doing that. |
The only thing we don't support is an exponent of 5. Otherwise, I think everything else should be there. |
Thanks for developing and open-sourcing this. I would be interested in helping to make this happen earlier and have many immediate needs for different systems. Is anyone actively working on this? Happy to jump into it to lower the barrier to be included as soon as possible. :) |
hello! great to see involvement already this early after we release the first beta. |
You can try starting, which is also a good test how well described the code is. If you need some kickstart, we can also have an independent chat. Email me in case. |
@ceriottm @PicoCentauri Yes I have used your code calculate the electrostatics and found it is very reliable and smooth! Multipole expansion is the natural extension and much needed. The code base design is a bit intricate but I found document is great and code is self-explanatory. Maybe a high level question --- Is appending multipoles into a single pass or separating them into multiple class more preferred? |
Yes the code still has some not super clear parts. See also #57. I would go for a different class called import torch
from torchpme.potentials import Potential
class DipolarP3M:
def __init__(
self,
potential: Potential,
mesh_spacing: float,
interpolation_nodes: int = 4,
full_neighbor_list: bool = False,
prefactor: float = 1.0,
): ...
def forward(
self,
dipoles: torch.Tensor,
cell: torch.Tensor,
positions: torch.Tensor,
neighbor_indices: torch.Tensor,
neighbor_distances: torch.Tensor,
): ... If we want to implement more then just P3M for dipoles it may makes sense to write another base class and put everything in a subfolder |
I want to start implementing the core classes for dipole-dipole interactions, beginning with a direct “potential” since it is the easiest to implement. The question is: what do you think is the optimal way to store the building blocks? For charge interactions, we can introduce the notion of a scalar potential and calculate the energy as the product of this potential with a scalar charge. For dipoles, the final energy is obtained via a dot product. Thus, we can either compute the energy directly or, if we aim to preserve the concept of "generalized potential" * "generalized charge" (with the dipole moment acting as the generalized charge in this case), the potential would need to be represented as a vector. However, I am unsure whether this approach is reasonable. What do you think? |
I think for ML purposes it is preferable to have access to the per-atom vector potential, in the same way that we offer access to the per-atom scalar potential. |
Besides, computing the potential for point charges another very important interaction is the one between point dipoles according to
where$`r=|\vec{r}|$ and the prefactor $D$ is given by $D =μ_0/(4π)$ . Here, $μ_0$ is the vacuum permittivity.
Analogous to a PME algorithm for point charges there also exist fast solvers for dipolar interaction usually called dipolar PME algorithms as described for example in Cérda 2008 .
@sirmarcel and I saw systems where it seemed crucial to also add point dipoles on top of point charges to model the energy and forces of such structures accurately. Therefore, such calculators could be a very powerful and logical extension of
torch-pme
.The text was updated successfully, but these errors were encountered: