Introduction

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. For rare earth ions it is based on the standard model of rare earth magnetism [1]. The Hamiltonian of the standard model of rare earth magnetism is described in section 5. Alternatively, a more complex Hamiltonian can be used which includes all terms in intermediate coupling - this is important for transition metal and actinide ions.

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.

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}

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) 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 by a Monte Carlo process. See Section 7 on how to perform such a simulation.

The temperature and magnetic field is varied during the calculation and thereby it is possible to map out the magnetic 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 [2].

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 [3] 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]