Future Improvements

Adding More Magnetic Structures

The primary aim of this project was to investigate more magnetic field structures, so it is very likely that the user would wish to add investigate more sophisticated magnetic field patterns than the four provided. To do this, the user must:

  1. Add the necessary constructor to the MomentField.cpp implementation file, if none of the existing constructors accept the required set of parameters. This new constructor must also be declared in the MomentField.h header file.
  2. Update the MomentField.getType() function to return the corresponding magnetic field structure type.
  3. Update the MomentField.getMoment() function. This is where the bulk of the code describing the moment field goes.
  4. Add any new constructors to the Bindings.cpp file.
  5. Re-install the module.

Adding More Crystal Structures

  1. Within the Crystals directory, duplicate the Cu2OSeO3 implementation and header files and rename them to the name of the desired crystal.
  2. In the header file, replace all instances of Cu2OSeO3 with the name of the new crystal.
  3. In the implementation file, replace the 8.92500 in the argument for the Sample constructor with the side-length of the unit cell of the new crystal structure in Ångstroms. Note that, currently, all sides must be of the same length.
  4. Also in the implementation file, replace the CellAtom objects with those containing information about the positions of the atoms of the new crystal within the unit cell in fractional coordinates, as well as whether or not the moment should be flipped with respect to the pattern defined by the MomentField (true corresponds to flipped).
  5. Update the Bindings.cpp file by copying and pasting the entry for Cu2OSeO3, and replacing the name accordingly.
  6. Re-install the module.

Suggestions for Minor Improvements

  • More feedback when used from Python in terms of error messages; when the user, for example, uses a 1D array instead of a 2D array for the muon positions, it isn’t always clear what has gone wrong when the module fails to work.
  • Currently, the feedback about the progress of the calculations is not clear. It would be nice if the user could see e.g. a progress bar, or even better information about what is going on, rather than simply a flurry of numbers.
  • When creating a Sample object, the user must pass a MomentField object as an argument. The user must also pass a MomentField object when instantiating SpectrumCreator and VectorFieldCreator, which is not just inelegant, but also means things could go wrong if the user changes the name of the moment field that is passed to the Sample and the SpectrumCreator or VectorFieldCreator. It would be nice if SpectrumCreator and VectorFieldCreator could obtain this information from the sample instead.
  • Installation would be easier if the module were to be made pip-installable.
  • The ability to load crystal information from .cif files, rather than having to manually define the atom positions.
  • Conversion of all std::vector<double> objects used internally to py::array_t<double> objects, so that more information can be accessed from Python (and corresponding access to getter and setter methods from Python by updating the Bindings.cpp file accordingly).
  • Support for if the unit cell side lengths a != b != c, and for if alpha != beta != gamma.
  • I wrote this module during a summer internship, before which my experience of using C++ was minimal. Some code could probably be written more efficiently.
  • The magnitude of each magnetic dipole is defined within the MomentField class. Would it make more sense to simply normalise it here, and define it within each unique crystal class instead?