In practice we first initialize the system with uniform magnetization in a direction of our choice , away from the anisotropy axes, where we expect a nonzero torque. Next we evolve the system by constrained Monte Carlo until the length of the magnetization reaches equilibrium. We then take a thermodynamic average of the torque over the number of constrained Monte Carlo ``sweeps''. We repeat at other orientations and we finally reconstruct the anisotropy constants from the angular dependence of the torque.
Torque curves for a generic system with uniaxial and cubic anisotropy are shown in Fig. 4.1. The symbols show the calculated torque and the curves are fitted to a dependence in the uniaxial case and to a dependence when the system has cubic anisotropy, where is the angle from the easy axis.

In a situation like this, where all the torque curves have the same shape and the anisotropy is described by a single parameter, it is sufficient to compute the torque at 45 degrees in the uniaxial case and in the plane for the cubic anisotropy case, where the maximum is known to occur. In more general cases it is necessary to compute the torque at several angular positions. Finally, with every new system it is prudent to verify the shape of the torque curves over many angles, both polar and azimuthal, before reducing the number of evaluated points.
Rocio Yanes