Implement Magnetostatics in TorchPME #133
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This branch is linked to #54 and introduces the initial implementation of magnetostatics in the existing TorchPME library. The commit provides a basic implementation for direct potential calculations along with a simple test case.
With this implementation, it’s a good time to start discussing how to structure the current magnetostatic functionality and align it with the broader scope of the library. Notable changes to the main library include:
1. Dipole Potential Components:
Unlike charge-based potentials (e.g., Coulomb), dipole potentials consist of two components: a scalar and a tensor part. Currently, these components are explicitly returned separately and later combined in the calculator. While this approach works for now, we should evaluate whether it remains viable as we transition to more complex Ewald-based calculators.
2. Calculator Structure for Dipoles:
The dipole calculator significantly differs from charge-based calculators, potentially necessitating a new base calculator tailored for magnetostatics. For now, the implementation resides in the calculators folder, but it may need restructuring.
Key differences include:
• Passing dipoles instead of charges.
• Utilizing neighbor vectors instead of neighbor distances.
• Returning potentials in a vectorial form, which appears more convenient from an ML perspective.
📚 Documentation preview 📚: https://torch-pme--133.org.readthedocs.build/en/133/