NQCD / NQCDistributions.jl

MIT License
0 stars 0 forks source link

Read parameters for VelocityBoltzmann from NQCDynamics.jl simulation. #9

Open Alexsp32 opened 11 months ago

Alexsp32 commented 11 months ago

With Julia 1.9 enabling package extensions, it should be possible to add extra methods to initialise a VelocityBoltzmann distribution using an NQCD simulation, e.g. VelocityBoltzmann(300u"K", simulation), using it to determine the atomic masses and total degrees of freedom to sample.

This would be useful in many cases where a DynamicalDistribution with a single Velocity Boltzmann distribution should affect all atoms in a system.

reinimaurer1 commented 10 months ago

I don't quite understand this suggestion. VelocityBoltzmann can already deal with multidimensional systems (aribtrary ndofs and natoms). Are you suggesting that it automatically restricts the velocity distributions that are generated to a subset of atoms?

I am asking as I am currently working on that code.

Alexsp32 commented 10 months ago

My idea was to make generating a Boltzmann distribution more convenient when a NQCDynamics.Simulation is already initialised. So instead of VelocityBoltzmann(T, sim.atoms.masses, size(sim)), enable VelocityBoltzmann(T, sim) to generate the same initial distribution.

reinimaurer1 commented 10 months ago

This makes sense. The solution I came up with is also not particularly nice. it works for now, but the interface could be easily improved.

Alexsp32 commented 9 months ago

This needs to be implemented in NQCDynamics.jl unless we want to draw Simulations out into a separate package.

Would also be useful to account for frozen atoms in simulations automatically → Generate guaranteed 0 velocity distributions for those atoms instead of Boltzmann. #12 makes multiple types of distributions for a UnivariateArray possible, so this can be done automatically in NQCDynamics.jl or manually by starting with a Matrix{UnivariateDistribution}.