# Does anyone know any software for MD simulation which include the effect of magnetic field?

I am interested to generate some configurations from MD simulations which include the presence of strong magnetic field. Does anyone know any software that has some functionality to do this?

• Your best bet is an ab initio MD code, most likely. CP2K has an option to enable an electric field, although I don't know much about this and related keywords. – Andrew Rosen May 1 '20 at 0:48
• What aspect of the magnetic field do you want to simulate? The effect on spins (which is probably a bit easier) or the effect on the orbitals? – taciteloquence May 1 '20 at 1:46
• I am thinking if it is possible to add the Lorentz force, for instance, during the propagation. But, I am not really sure what will be the effect of this addition. – Meilani Wibowo May 1 '20 at 20:06

There is certainly Lammps, which has a fix efield that allows you to apply electric field in your chosen cartesian direction. But I am not sure if it works for your purposes. You can play around with it to see.

https://lammps.sandia.gov/doc/fix_efield.html

• +1. But e-field might be quite different from b-field? By the way if you're a LAMMPS user there's now a room just for LAMMPS: chat.stackexchange.com/rooms/109805/lammps – Nike Dattani Jul 2 '20 at 1:14
• My bad - I misread the question. There appears to be some discussion in Lammps mailing list about fix bfield, which may be of interest (lammps.sandia.gov/threads/msg66010.html). @NikeDattani: Do I delete my answer or leave this comment as is - what's the correct way to do this? – gogo Jul 3 '20 at 3:27
• You're free to add the part about the bfield and the URL to the discussion about it, to your answer. It's okay for your answer to give a bit of info about using LAMMPS with an efield and also with a bfield. It just makes it even more useful, for perhaps double the number of visitors. – Nike Dattani Jul 3 '20 at 3:33

I think that there isn't one. As the cause of the magnetic properties are the electrons, and no MD codes consider the electrons, they are unable to simulate magnetism.

• There are multiple ab initio dynamics codes, including CP2K, CPMD, etc. – Geoff Hutchison May 1 '20 at 18:51

Actually that depends on what you're trying to achieve with the simulation. Generally speaking the magnetic field is not much different from the electric field, therefore the effect can be incorporated with small changes to fix efield in LAMMPS to account for different constants. In fact, this was what we did in a paper some time ago. However, the effect of the external magnetic field on magnetized particles is just a torque, and hence it makes sense to apply the torque only to spherically asymmetrical particles.