Introduction

ORLANDO: How nice to meet you here in Venice, Ewald - I have some exciting new magnetostriction data in ultrahigh fields which we are trying to understand !

EWALD: The pleasure is on my side - I am always impressed, how much effort you make to do such experiments. Maybe looking into McPhase can help to unterstand your data - McPhase is a program package designed to calculate properties of a magnetic system with localised magnetic moments given the crystal field and/or the exchange interaction constants.

SIMPLICIUS: Hi, do tell me, what can you do with that program ?

EWALD: For rare earth ions McPhase is based on the Hamiltonian of the standard model of rare earth magnetism [1]. 7 Alternatively, a more complex Hamiltonian can be used which includes all terms in intermediate coupling - this is important for transition metal and actinide ions.

SIMPLICIUS: I hope you know, that actinides are forbidden in my institute ! I am interested in exotic matter, this is important - so what can you study ?

EWALD: By means of magnetoelastic interactions the interplay of lattice and magnetism can be studied. Properties to be calculated are magnetic moments, electric polarisation, strain and excitations under magnetic and electric fields and stress/pressure.

ORLANDO: Indeed ? So can we do a quick calculation to understand better my new experimental high field data of magnetisation and magnetostriction. My student is trying really hard to set up something for pressure experiments too, it would be nice to have some prediction from theory !

Figure 1: Structure of the program package showing the tasks of the different modules.
\includegraphics[angle=0,width=0.7\columnwidth]{figsrc/mcphas_modules.eps}

EWALD: For each of the many tasks of the program package separate programs have been written. Fig. 1 gives an overview of the tasks of these different modules of the program package. Have a look:

singleion:
The best way to start with the program package is probably to get acquainted with the program singleion, which is the most important of several modules used for the calculation of single ion properties (see Section 6).
mcphas:
This program has been written to calculate the thermodynamic properties. In order to deal with the pair interactions a combined mean-field/monte-carlo algorithm is used in module mcphas. For a given temperature $T$ and magnetic field $\mathbf H$ (vector), electric field and stress tensor / pressure several possible magnetic structures are stabilised by a mean field algorithm and the free energy is calculated. The initial values for this mean-field procedure are modified randomly. In addition or alternatively a Monte Carlo process according to Metropolis stepping [2] can be performed. See Section 7 on how to perform such a simulation.

The temperature and magnetic/electric field / stress (pressure) are varied during the calculation and thereby it is possible to map out a phase diagram. The program produces a plot of the stabilised magnetic structures and the magnetisation on screen, the output files contain additional information such as calculated magnetoelastic and neutron-diffraction data. As a typical application of mcphas the calculated magnetic phase diagram of NdCu$_2$ is shown in fig. 2. The exchange parameters required for the calculation of such a complex antiferromagnet have been determined from the dispersion of magnetic excitations measured by neutron spectroscopy with moments aligned ferromagnetically by an external magnetic field. Details are described elsewhere [3].

graphics:
Several graphic programs easy the visualisation of the calculated data (section 17).

mcdiff:
The program McDiff can be used to calculate the magnetic neutrons or resonant x-ray diffraction intensities. Note that neutron intensities can be calculated going beyond the dipolar approximation for the magnetic formfactor.

mcdisp:
An additional program McDisp can be used to calculate the dispersion and intensity of magnetic excitations and diffuse magnetic scattering cross section. It is based on a mean field- random phase approximation treatment of the problem (section 9).
simannfit:
In oder to enable the determination of the parameters of the magnetic Hamiltonian from experimental data, a fitting tool Simannfit can be used to fit experimental magnetic structure and excitation data. This tool is based on the simulated annealing algorithm [4] and described in section 18.

Figure 2: Magnetic phase diagram for NdCu$_2$ for magnetic field along the orthorhombic $b$-direction. Colours represent the calculated phase diagram, lines correspond to experimentally determined phase boundaries. [plot created by program phased]
\includegraphics[angle=90,width=0.7\columnwidth]{figsrc/ndphased.eps}