↑ Return to About

Set Up

To use SpinDynamica, download and unzip the zip file available from the link at the top entry of the Download page. Place the packages wherever you want on your computer.

You need to tell Mathematica where the packages are by executing the following instruction:

This instruction may be placed either

  • as the first line of the notebook that uses SpinDynamica, or
  • in the file init.m of your AutoLoad folder.

The second option (init.m) is preferable, since SpinDynamica will always become available when the Mathematica Kernel is started. See the Wolfram.com documentation here.

To use init.m, create a Mathematica notebook init.nb in the AutoLoad folder containing the information above inside the initialization cells. The executable file init.m will then be created automatically inside the same directory. The location of AutoLoad is system-dependent. As an example, my Macintosh directory “/Users/mhl/Library/Mathematica/Kernel/” contains this file: init.nb, and the derived executable init.m. My file init.nb contains the following lines, which define a symbol $SpinDynamicaDirectory for the location of SpinDynamica, and add this to

In your local implementation, simply replace “/Users/mhl/Documents/software/maths/mathematica/programs/SpinDynamica/current version/SpinDynamica/” by the path specification for your unzipped SpinDynamica directory.

Tip: Keep a copy of your init.nb since an update of Mathematica may well overwrite the “/Users/mhl/Library/Mathematica/Kernel/” directory. The Mathematica documentation is not brilliantly transparent about how to set up autoload packages properly. Fortunately you only need to do it once.

When the path is set, SpinDynamica is loaded by launching the Mathematica kernel and executing

Needs[“SpinDynamica`”]

The quotes and single backquote are necessary.