Comments (6)
Hey! Great question. It was always possible, but because no one had asked we hadn't exposed the functionality. Just pushed a change that makes it possible via the per_particle
keyword argument.
For example,
energy_fn = energy.soft_sphere_pair(displacement)
print(energy_fn(R)) # Prints a scalar.
pp_energy_fn = energy.soft_sphere_pair(displacement, per_particle=True)
print(pp_energy_fn(R)) # Prints a vector of shape [N,]
One case that is not yet implemented is if you have a multispecies system where the species are specified upfront. I'll hopefully get to adding this case soon but in the meantime, you should specify the species dynamically. For example,
pp_energy_fn = energy.soft_sphere_pair(displacement, species=species, sigma=sigma, per_particle=True)
print(pp_energy_fn(R)) # Throws an error.
from jax_md.quantity import Dynamic
pp_energy_fn = energy.soft_sphere_pair(displacement, species=Dynamic, sigma=sigma, per_particle=True)
print(pp_energy_fn(R, species=species)) # Works and prints a vector.
Let me know how it works or if you have any questions!
from jax-md.
Dear sschoeholz, thank you for the beautiful answer. I will try it and let you know. Cheers!
from jax-md.
Dear sschoeholz, I am implementind an EAM explicit potential using jax-md and seems that, until now, all is working fine. The per_particle
functionality is very nice and important for my project. As soon as my md approach is working properly I will post here and, maybe, could be an example to others colleagues.
from jax-md.
Hey @SoDantas8452 somehow I missed this reply but that sounds awesome! If you were interested, we would also be happy to work with you to commit your EAM potential into jax md properly?
from jax-md.
Dear @sschoenholz I wrote a naive code (somehow zero version of the whole code). Could you take a look to help me with it? Maybe I could send to your e-mail a jupyter notebook code. Thanks!
from jax-md.
Hi @SoDantas8452 thanks for your reply again, for some reason I keep missing these. I would love to work iwth you to improve our eam implementation. Definitely send me a jupyter notebook and let's iterate! The best place to reach me is [email protected].
from jax-md.
Related Issues (20)
- Brownian simulations break when dt <= ~3e-8
- Better documentation needed for quantity.pair_correlation and quantity.pair_correlation_neighbor_list HOT 1
- Potential implementation for space.periodic_general HOT 4
- neighborlist in non-orthorhombic systems HOT 3
- `jax_md` installation fails from pip install with python 3.11 HOT 1
- Feature Request: Improved execution time for bonds. HOT 2
- Is there a bug in the equivariant neural network notebook? HOT 1
- FireDescent is not implemented correctly
- Is the any way could translate the Sparse neighbor list to OrderedSparse neighbor list?
- Code snippets in README.md give NaNs
- Issues with NPT + Lennard Jones using jax-md-0.2.5 HOT 2
- jax-md renderer not working HOT 1
- Readers of the paper may unintentionally access old code in the `master` branch
- NaNs for Lennard Jones potential gradients. HOT 1
- Error importing jax_md
- documentation not compiling HOT 1
- GPU memory leak when using soft_sphere_neighbor_list with epsilon species tensor
- FireDescent should use velocity and not momentum when calculating P
- Proposal: Extending Jax MD with Monte Carlo Capabilities and Bonded Potentials HOT 7
- nequip uses legacy e3nn-jax modules HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jax-md.