SciML / NBodySimulator.jl

A differentiable simulator for scientific machine learning (SciML) with N-body problems, including astrophysical and molecular dynamics
https://docs.sciml.ai/NBodySimulator/stable/
Other
128 stars 20 forks source link

Use HierarchicalMatrices.jl for n-body problems #31

Open dlfivefifty opened 6 years ago

dlfivefifty commented 6 years ago

This continues a conversation that started here:

https://github.com/JuliaDiffEq/MultiScaleArrays.jl/issues/25#issuecomment-371539346

HierarchicalMatrices.jl gives a convenient way to implement the fast multipole method, which exploits low rank structure to make matrix multiplication fast. This can be used for efficient simulations: O(n) cost for n bodies.

ChrisRackauckas commented 6 years ago

Right now we have the users defining the potentials:

https://github.com/JuliaDiffEq/DiffEqPhysics.jl/blob/master/test/nbody_test.jl#L22

which isn't a good thing is we want to make this easy and fast. We really should be using a fast multipole method, so we might want to constrain the input potentials a bit so that way we can support this, but I 100% agree that we should do this sense it would make the n-body stuff scale a lot better. In addition, it should probably take into account neighborhood tracking so it's not actually doing every pair of interactions. That's important in MD of macromolecules like proteins.