[lammps-users] magnetic system

I need to learn how to simulate a magnetic system. How can I find some scripts as examples?

Hello Runak!

My name is Julien Tranchida, I’m the lead developer of the SPIN package that enables magneto-elastic simulations with Lammps. Thanks a lot for your interest!

You can find some initial scripts in the example repository of Lammps (lammps/examples/SPIN). Note that those are just a set of toy models, so that you should not blindly use them to perform actual materials simulations. You will always have to adapt them to your own materials and simulations.
That being said, they should provide you with a lot of information. For example, how to set the type of your particles to be atomic spins (so having a position, a velocity, and a magnetic spin), how to initialize spin configurations, how to combine a Heisenberg Hamiltonian with any mechanical potential implemented in Lammps, how to run spin - lattice dynamics (or spin dynamics on a frozen lattice), output magnetic quantities, and countless other things.

You can also relate all this information to some of the manuscripts we’ve been publishing with the code through the years, for example:




In all those manuscripts, you should find information about the definition of magneto-elastic potentials, initial spin-lattice configurations, or spin-lattice calculations in NVE, NVT, or semi-NPT ensembles. Overall, it should be straightforward to compare the setups in those papers to the examples in the examples/SPIN repository.

Of course, you can (and should!) also read the documentation. I tried to keep it up-to-date. For any magnetic command that you will find in the examples, you should be able to find an associated doc page. For example:


If you’re not sure about the meaning of one of the commands in the example deck, have a look at the associated doc page should always give you an answer ;-).

Hope this helps! Let me know if you have specific questions about some setups.

All the best,

That’s great. Thanks a lot Julien for your help.