Installation of MuDirac

Dependencies

MuDirac requires:

  • A C++ compiler

  • CMake 3.25 or later

  • Ceres Solver (required for 2pF nuclear model optimisation)

Installing Ceres Solver

Ceres can be installed via a package manager on most platforms:

Ubuntu/Debian:

sudo apt-get install libceres-dev

macOS (Homebrew):

brew install ceres-solver

Conda:

conda install -c conda-forge ceres-solver

If you prefer to build Ceres from source, first install its dependencies (including glog), then clone and build:

Ubuntu/Debian:

sudo apt-get install libgoogle-glog-dev libgflags-dev libeigen3-dev

macOS (Homebrew):

brew install glog gflags eigen

Then build and install Ceres. MuDirac only uses Ceres’s dense solver (DENSE_QR), so SuiteSparse and LAPACK are not needed and can be disabled for a faster, leaner build:

git clone https://github.com/ceres-solver/ceres-solver.git
cd ceres-solver && git checkout tags/2.2.0
mkdir build && cd build
cmake -DBUILD_TESTING=OFF -DBUILD_EXAMPLES=OFF -DSUITESPARSE=OFF -DLAPACK=OFF ..
make -j4
sudo make install

Note

Do not use -DMINIGLOG=ON when building Ceres for use with MuDirac. MuDirac uses the aixlog logging library, which defines the same severity symbols (INFO, WARNING, ERROR, FATAL) as Ceres’s miniglog substitute. Using miniglog will cause a compilation error due to this conflict. Always build Ceres with the full glog library.

Building MuDirac

MuDirac uses CMake as a build system. In order to compile it and prepare it to be executed on a Linux, Unix, or MacOS system with a working C++ compiler installed, follow these steps:

  1. Download and unpack (or git clone) the repository on your local system.

  2. Within the main folder of the repository (the one containing the READ.md file), create a subfolder called build.

  3. Within the build folder, run the following commands:

cmake ..
make mudirac

In order to run the test suite, within the same directory run:

make tests
make test

and wait for a few seconds for the tests to complete. If you want mudirac to be accessible from any folder in your computer, add the resulting bin directory to your system PATH environment variable.

Install MuDirac using conda

MuDirac is available as conda package. To install mudirac using conda run the following

conda install conda-forge::mudirac

Usage

To simulate the x-ray transition energies of a muonic atom, MuDirac works simply by running it with an input file:

mudirac input.in

where .in file can have any name one prefers. The input file is a text file with rows of the form keyword: value, which contains all the necessary information about the parameters of the Dirac equation, and the muonic atom and transitions being simulated. A full list of keywords employable in the .in file and their meaning can be found in Input keywords.