computer programs\(\def\hfill{\hskip 5em}\def\hfil{\hskip 3em}\def\eqno#1{\hfil {#1}}\)

Journal logoJOURNAL OF
ISSN: 1600-5775

Quanty4RIXS: a program for crystal field multiplet calculations of RIXS and RIXS–MCD spectra using Quanty

aDebye Institute of Nanomaterial Science, Utrecht University, 3584 CA Utrecht, The Netherlands, bStewart Blusson Quantum Matter Institute, University of British Columbia, Vancouver, British Columbia, Canada V6T 1Z4, cDepartment of Physics and Engineering Physics, University of Saskatchewan, Saskatoon, Saskatchewan, Canada S7N 5E2, and dInstitute for Theoretical Physics, Heidelberg University, 69120 Heidelberg, Germany
*Correspondence e-mail:

Edited by S. Svensson, Uppsala University, Sweden (Received 13 December 2017; accepted 9 March 2018)

Some initial instructions for the Quanty4RIXS program written in MATLAB® are provided. The program assists in the calculation of 1s 2p RIXS and 1s 2p RIXS–MCD spectra using Quanty. Furthermore, 1s XAS and 2p 3d RIXS calculations in different symmetries can also be performed. It includes the Hartree–Fock values for the Slater integrals and spin–orbit interactions for several 3d transition metal ions that are required to create the .lua scripts containing all necessary parameters and quantum mechanical definitions for the calculations. The program can be used free of charge and is designed to allow for further adjustments of the scripts.

1. Introduction

This paper provides a first guidance and explanations on the usage of the Quanty4RIXS program for the calculation of resonant inelastic X-ray scattering (RIXS) and RIXS magnetic circular dichroism (RIXS–MCD) spectra. Quanty4­RIXS is related to the CTM4XAS program (Stavitski & de Groot, 2010[Stavitski, E. & de Groot, F. M. F. (2010). Micron, 41, 687-694.]) through the underlying crystal field model, though the computational approaches are fundamentally different.

CTM4XAS is primarily used to calculate one-dimensional X-ray absorption spectroscopy (XAS) or X-ray emission spectroscopy (XES) spectra based on the Cowan approach (Cowan, 1981[Cowan, R. D. (1981). The Theory of Atomic Structure and Spectra. University of California Press.]; Thole & van der Laan, 1988[Thole, B. T. & van der Laan, G. (1988). Phys. Rev. B, 38, 3158-3171.]). Quanty4RIXS, on the other hand, is specifically designed to calculate two-dimensional RIXS and RIXS–MCD maps taking advantage of the Green's function approach used by Quanty which we explain in §3[link]. For further details on the underlying physics and modelling we refer to the corresponding publications from Haverkort et al. (Haverkort et al., 2012[Haverkort, M. W., Zwierzycki, M. & Andersen, O. K. (2012). Phys. Rev. B, 85, 165113.], 2014[Haverkort, M. W., Sangiovanni, G., Hansmann, P., Toschi, A., Lu, Y. & Macke, S. (2014). Europhys. Lett. 108, 57004.]; Lu et al., 2014[Lu, Y., Höppner, M., Gunnarsson, O. & Haverkort, M. W. (2014). Phys. Rev. B, 90, 085102.]; Haverkort, 2016[Haverkort, M. W. (2016). J. Phys. Conf. Ser. 712, 012001.]).

Quanty4RIXS is a graphical user interface (GUI) simplifying the creation of the .lua script which is used as an input file for Quanty. The .lua script is the standard input file for Quanty containing all parameters, quantum mechanical operators and definitions used for the calculation. (Examples of the different elements can be found at The created .lua script can either be executed directly on a local machine using Quanty4RIXS to initiate the calculation, or the .lua file can be saved and transferred to a high-performance computer to run the calculation.

Quanty4RIXS is written in MATLAB® and the source code is published `as is' to make it available to the scientific community. It can be altered and adjusted to meet the user's own requirements as long as the original author (Patric Zimmermann, Utrecht University, 2017) is mentioned along subsequent versions.

2. Setup

In order to run the program, MATLAB® version 2016a or newer must be used. In older versions some GUI elements are not present, leading to errors. To enable the program to start the calculations locally, Quanty must be installed on a local machine. To obtain the latest version and further information on the usage of Quanty in the .lua scripts, visit

Quanty4RIXS needs several files, which are stored in the repository directory as shown in Fig. 1[link]. This repository folder is called Quanty4RIXS and its path, on a Mac, should be the user's home directory [{\tt{/Users/\lt username \gt/Quanty}}]4RIXS/ or, on Windows, [{\tt{C\!\!:\!\!\backslash Quanty4RIXS\backslash}}]. The configuration file Quanty4RIXS/Resources/Quanty4RIXS.cfg in the repository stores the paths to the Quanty binary and all settings, and therefore the folder's permissions must be set to allow write access.

[Figure 1]
Figure 1
Quanty4RIXS repository folder.

If the repository folder or the Quanty binary is not found in the default path the program will ask on first startup for the paths, which can then be selected accordingly.

3. The RIXS approach in Quanty

In this section we describe the approach taken in the underlying program Quanty for the computation of RIXS spectra upon calling the CreateResonantSpectra() function. Quanty is an exact diagonalization program designed to take advantage of the sparse operators and wavefunctions present in many correlated electron problems.

Of relevance for Quanty4RIXS, Quanty calculates the RIXS intensity I for a given initial state, [\vert\Psi_{i}\rangle] as [I(\omega_{i},\omega,{\boldvarepsilon}_{i},{\boldvarepsilon}_{o})] = [F_{i}(\omega_{i},\omega,{\boldvarepsilon}_{i},{\boldvarepsilon}_{o})], where [\Psi_{i}] is the correlated many-body wavefunction, which is a linear combination over the various arrangements of electrons in the orbital, and [\omega] = [\omega_{i}-\omega_{o}] is the energy transfer between the incoming (i) and outgoing (o) photons with polarizations [{\boldvarepsilon}_{i}] and [{\boldvarepsilon}_{o}], respectively.

To calculate the RIXS intensity for a given temperature T one computes the total intensity as a weighted sum over the contributing states as

[I(\omega_i,\omega,{\boldvarepsilon}_i,{\boldvarepsilon}_o,T) = {{1}\over{Z}}\sum\limits_i \exp\left(-E_i\,/k_{\rm{B}}T\right)\, F_i\left(\omega_i,\omega,{\boldvarepsilon}_i,{\boldvarepsilon}_o\right), \eqno(1)]

where Fi are the RIXS intensities for a given state [\vert\Psi_{i}\rangle] with energy Ei, which is scaled according to the Boltzmann distribution using its energy Ei, and Z is the partition function. In the following, however, we describe only the case for T = 0 K.

With [\vert\Psi_{i}\rangle] denoting a particular initial state of the system with energy Ei determined by the Hamiltonian H, one can describe the RIXS intensity by

[F_i\left(\omega_i,\omega,{\boldvarepsilon}_i,{\boldvarepsilon}_o\right) = -{{1}\over{\pi}} {\rm{Im}}\, \langle\Psi_i\vert {R^{\,{\varepsilon}_i{\varepsilon}_o}_{\omega_i}}^\dagger \, G\left(\omega\right) \, {R^{\,{\varepsilon}_i{\varepsilon}_o}_{\omega_i}} \vert\Psi_i\rangle, \eqno(2)]


[G\left(\omega\right) = {{1}\over{\omega+E_{i}-H+{\rm{i}}\Gamma/2}} \eqno(3)]

is the RIXS Green's function with Γ as the final-state energy width due to the finite final-state lifetime. The effective RIXS operator [R^{\,{{\varepsilon}_{i}{\varepsilon}_{o}}}_{{\omega_{i}}}] is given by (Haverkort, 2010[Haverkort, M. W. (2010). Phys. Rev. Lett. 105, 167404.])

[R^{\,{{\varepsilon}_{i}{\varepsilon}_{o}}}_{{\omega_{i}}} = {T^{\,{{\varepsilon}_{o}}}}^{{\dagger}} \, G\left(\omega_{i}\right) \, T^{\,{{\varepsilon}_{i}}}, \eqno(4)]


[G\left(\omega_{i}\right) = {{1}\over{\omega_{i}+E_{i}-H+{\rm i}\Gamma_{i}/2}}\eqno(5)]

is the XAS Green's function with [\Gamma_{i}] as the RIXS intermediate state energy width due to the finite core hole lifetime. Hence, the sandwiched expression in equation (2)[link] translates to

[{R^{\,{\varepsilon}_i{\varepsilon}_o}_{\omega_i}}^\dagger \, G\left(\omega\right) \, {R^{\,{\varepsilon}_i{\varepsilon}_o}_{\omega_i}} = {\left[{T^{\,{\varepsilon}_o}}^{\dagger} \, G\left(\omega_i\right) \, T^{\,{\varepsilon}_i}\right]}^\dagger \, G\left(\omega\right) \, \left[{T^{\,{\varepsilon}_o}}^{\dagger} \, G\left(\omega_i\right) \, T^{\,{\varepsilon}_i}\right], \eqno(6)]

which can be explicitly rewritten as

[{R^{\,{\varepsilon}_i{\varepsilon}_o}_{\omega_i}}^\dagger \, G\left(\omega\right) \, {R^{\,{\varepsilon}_i{\varepsilon}_o}_{\omega_i}} = {{T^{\,{\varepsilon}_i}}^{\dagger} \, G^{\,\dagger}\left(\omega_i\right) \, T^{\,{\varepsilon}_o}} \, G\left(\omega\right) \, {T^{\,{\varepsilon}_o}}^{\dagger} \, G\left(\omega_i\right) \, T^{\,{\varepsilon}_i} \eqno(7)]

because [(ABC)^{{\dagger}}] = [(BC)^{{\dagger}}A^{{\dagger}}] = [C^{\,{\dagger}}B^{{\dagger}}A^{{\dagger}}].

This then describes the entire two-step RIXS process where a core hole is created by a transition operator [T^{{\,{\varepsilon}_{i}}}] and subsequently annihilated locally by [{T^{{\,{\varepsilon}_{o}}}}^{\dagger}] after the lifetime determined by the core hole width [\Gamma_{i}]. Depending on the type of RIXS studied, the absorption operator [T^{{\,{\varepsilon}_{i}}}] can describe, for example, a dipole [2p\,\rightarrow\,3d] or quadrupole [1s\,\rightarrow\,3d] transition. Similarly the emission operator [{T^{{\,{\varepsilon}_{o}}}}^{\dagger}] may induce a [3d\,\rightarrow\,2p] or a [2p\,\rightarrow\,1s] decay transition.

Quanty first calculates the initial state [\vert\Psi_{i}\rangle] using a Lanczos-based iterative diagonalization. The state [\vert\Psi_{i}\rangle] can be the ground state, or a low-energy state that is thermally populated (a block Lanczos algorithm is used to calculate a set of the lowest-energy eigenstates).

Next, Quanty calculates [T^{{\,{\varepsilon}_{i}}}\vert\Psi_{i}\rangle] and uses this as a starting wavefunction to diagonalize H in a small Krylov basis [usually dimension [{\cal O}\left(10^{2}\right)]]. Within this small Krylov basis, a quick inversion can be performed to obtain [G(\omega_{i})].

This enables the wavefunction to be computed, [G\left(\omega_{i}\right)\,T^{{\,{\varepsilon}_{i}}}\vert\Psi_{i}\rangle], and transformed back to the original (large) basis.

Next, Quanty computes [{T^{{\,{\varepsilon}_{o}}}}^{{\dagger}}\,G\left(\omega_{i}\right)\,T^{{\,{\varepsilon}_{i}}}\vert\Psi_{i}\rangle] to replace [R^{{\,{\varepsilon}_{i}{\varepsilon}_{o}}}_{{\omega_{i}}}\vert\Psi_{i}\rangle] in equation (2)[link] as a starting wavefunction to perform the final Lanczos-based diagonalization of H to obtain the RIXS spectral function for the state [\vert\Psi_{i}\rangle].

For a finite temperature T > 0 K or degenerate ground states, the process can be repeated for different initial states [\vert\Psi_{i}\rangle] and the results weighted and summed as given in equation (1)[link]. For this purpose the CreateResonantSpectra() function does accept also a list of initial states [\{\vert\Psi_{i}^{1}\rangle,\vert\Psi_{i}^{2}\rangle,\ldots\}] instead of just one initial state [\vert\Psi_{i}\rangle] as starting wavefunction. This means that it is repeating the procedure described above, calling the function internally for each of the different states in the list. The result is then a combined RIXS map as shown, for example, in Fig. 8.

4. Using Quanty4RIXS

The program can currently create Quanty input files for XAS, RIXS and RIXS–MCD calculations with circular polarized light. In other words, it creates a .lua script with all the required parameters and definitions which are then used as input for Quanty. The job can be executed on a local machine or, for more time-consuming jobs, the script can be saved and then copied to any other computer that has Quanty installed.

In the following we first give a short overview and some instructions on how the GUI can be used. The main panel of Quanty4RIXS as it looks after start-up is shown in Fig. 2[link]. Here, one can select the ion configuration and the type of the calculation. When the 3d transition metal and its ionization level is selected the three corresponding RIXS electron configurations for the ground state (GS), the intermediate state (IS) and the final state (FS) are displayed.

[Figure 2]
Figure 2
Quanty4RIXS main panel.

Currently 1s XAS and 1s 2p RIXS for hard X-rays, and 2p 3d RIXS and 2p XAS calculations for soft X-rays are implemented. Additionally the expectation values (Observables) and an energy-level diagram (ELDiagram), also called the Tanabe–Sugano diagram, can be calculated. The Options tick box can be used to adjust the number of microstates to be computed, counted from the state lowest in energy.

The values for the energy ranges and the step width used in the calculation can be chosen and saved via the settings menu (Menu [\rightarrow] Settings) as shown in Fig. 3[link]. Here it is advisable to start with a step width dE larger or equal to dE = 0.1 eV, because the finer the grid the more points of the spectrum have to be calculated. Hence, a finer grid will dramatically increase the calculation time and also the required memory. (We recommend 16 GB RAM or more.)

[Figure 3]
Figure 3
Quanty4RIXS settings menu.

The Multithreading option can be used to split the calculation into two parts. If activated, a separate .lua file is created for each circular polarization [left circular polarization (LCP) and right circular polarization (RCP)] which are then calculated in parallel. On multicore systems this significantly reduces the computation time. When disabled only a single .lua file is created. The option Auto Load refers to a procedure that automatically loads the result of a calculation into the plotting panel (cf. §4.6[link]).

Apart from the relevant descriptions of the electron configuration, the Hamiltonians and crystal field parameters, the script's header section contains all required atomic parameters (spin–orbit, Slater) for the selected 3d transition metal ion. The Settings panel also allows presets to be saved for the Slater and crystal field scaling parameters. The saved parameters are identified by the corresponding ion configuration.

The atomic, crystal field and broadening parameters are discussed in the following.

4.1. Atomic parameters

The atomic parameters for several 3d transitions metal ions are stored in the RCNparameter.txt file. The values in the RCN file, for the Slater coefficients for exchange G0cv, G1cv, G2cv, G3cv, and Coulomb interaction F 0cv, F 2cv, F 4cv, are the calculated Hartree–Fock (HF) values. The indices `cv' are a placeholder for the corresponding shells, e.g. 1s 3d for the 1s 2p RIXS intermediate state. The contents of the RCN file have been calculated in advance with the Cowan program which is a part of CTM4XAS (Stavitski & de Groot, 2010[Stavitski, E. & de Groot, F. M. F. (2010). Micron, 41, 687-694.]) and as described by Cowan (Cowan, 1981[Cowan, R. D. (1981). The Theory of Atomic Structure and Spectra. University of California Press.]) and Thole et al. (Thole & van der Laan, 1988[Thole, B. T. & van der Laan, G. (1988). Phys. Rev. B, 38, 3158-3171.]). In principle, other ions can also be implemented; however, this requires adding the relevant information to the RCNparameter.txt file and also some adjustments to the MATLAB® code.

The values can be scaled using the Atomic Parameter panel as shown in Fig. 4[link]. Based on empirical knowledge they are usually reduced to 80% of the HF value to match the atomic values derived in experiments (Stavitski & de Groot, 2010[Stavitski, E. & de Groot, F. M. F. (2010). Micron, 41, 687-694.]) (e.g. 1.0 in the GUI means 100% of the HF value; 0.8 means 80% HF empirically equal to 100% atomic value; thus a scaling of 0.64 set in the GUI corresponds to 64% HF = 80% atomic). The spin–orbit interaction ζ is not screened and thus a scaling of 1.0 corresponds to 100% of the atomic value (Stavitski & de Groot, 2010[Stavitski, E. & de Groot, F. M. F. (2010). Micron, 41, 687-694.]). Due to the fact that all calculations only consider local contributions explicitly, the reduction of the Slater integrals can also be used to approximate hybridization effects (e.g. charge-transfer) as described by de Groot. (1991[Groot, F. de & Kotani, A. (2008). Core Level Spectroscopy of Solids, in Advances in Condensed Matter Science. Boca Raton: CRC Press.]).

[Figure 4]
Figure 4
Atomic Parameter panel with values for the Slater coefficients (Fcv and Gcv) and spin–orbit interaction.

4.2. Crystal field parameter

The panel for the Crystal field parameter shown in Fig. 5[link] can be used to select a symmetry and set the corresponding crystal field parameters. The corresponding crystal field calculations are all performed with Quanty. Currently available symmetries are Oh, D4h, C4 and C3v. To be precise, since Oh and D4h are higher symmetry subsets of C4 symmetry, those three symmetries are all calculated in C4 and the reduction to higher symmetry is achieved by setting some parameters to zero. The crystal field parameter in Oh is 10Dq; in D4h and C4 symmetry additionally Ds and Dt are non-zero. The parameter [M\neq0] represents the magnetic exchange field (molecular magnetic field) implying C4 symmetry. (Note, the default is [{\bf{k}}\,||z||\,{\bf{M}}].) If not modified the crystal field values are identical in the ground, intermediate and final state; ticking the box below enables them to be changed individually. Note that the explicit calculation of charge transfer is not yet implemented, but as mentioned above it can be approximated by a reduction of the Slater integrals.

[Figure 5]
Figure 5
Crystal field parameter panel with symmetry and crystal field values.

The crystal field parameter panel also displays an approximated single-electron term scheme for the chosen crystal field parameters in C4 symmetry to illustrate the splittings of the 3d shell [the formulae can be found elsewhere (de Groot & Kotani, 2008[Groot, F. M. de (1991). PhD thesis, p. 84ff. University of Nijmegen, The Netherlands.])].

4.3. Broadening

In the Broadening panel shown in Fig. 6[link] the user can choose the broadening values in eV, given as full width at half-maximum (FWHM). The ground state has an infinite lifetime, thus no natural broadening is applicable. The given broadening values are, together with the other parameters, written to the header section of the .lua file. The experimental broadening in the current version is not used for the calculation; only the natural broadenings are applied to the spectra as parameters in the Green's function approach (cf. §3[link]). However, since all values are written to the script, when needed one can adjust the script to add an experimental broadening as a convolution between the natural spectrum and a Gaussian.

[Figure 6]
Figure 6
Broadening panel in Quanty4RIXS.

4.4. Creating a .lua script file

The creation of the .lua scripts for Quanty is based on the module-templates in the programs repository folder as shown in Fig. 1[link]. The subdirectory Quanty contains several module-templates as .lua files, each containing a specific section to be used to assemble the final script. In principle these files can be altered as needed; however, some parts of the final script are dynamically created by the program, so one has to ensure a consistent naming of all used variables. The Resources folder contains the atomic parameter file RCNparameter.txt, as discussed in §4.1[link], and the configuration file Quanty4RIXS.cfg for the program. Hence the repository folder is crucial for the creation of the scripts.

With GUI mode selected in the main panel, clicking the Run Quanty button opens a file browser window where the path and filename for the output files must be given (spaces should be avoided in the path). Once the folder is chosen, the internal function createLUA() is called which assembles the final .lua script. Some parts of the .lua script are created dynamically based on the selections made in the GUI, but most parts of the script are assembled from the sections defined in the module-templates located in the repository folder. These module-templates can be altered when needed, though advanced changes are likely to also require some adjustments to the MATLAB® code.

The resulting .lua script is then saved in the selected folder together with a [{\tt{\lt filename\gt\_para.mat}}] file, which holds a copy of the parameters as they are written to the .lua script. (Note: the _para.mat file is required for the plotting routines in the Plotting panel.)

The structure of the final .lua script is as follows:

(i) The header contains the ion information and the corresponding parameters, e.g. Slater, SOC, CF parameters, all for GS, IS, FS; and the path and filename used for the calculated maps (the latter is convenient when the .lua script is executed on an HPC computer).

(ii) Definitions of the XAS- and XES-transition operators, the Hamiltonians for the three states (GS, IS, FS) and polarizations; the Hamiltonians and the transition operators (TXAS, TXES) are hereby defining the entire two-step photon-in photon-out RIXS process.

(iii) Dynamic section performing the actual calculations of the spectra, ELDs or Observables. The Quanty function CreateResonantSpectra() is used here to calculate the RIXS spectra. The Green's function approach then yields the two-dimensional RIXS map implying that everything is a ground-state property.

Using the final confirmation window the .lua script is then used to start the calculation with Quanty. If cancelled, the files are just saved allowing the script to be transferred to another computer or changes to the script made.

4.5. Running a .lua script with Quanty

There are two ways to start a calculation with Quanty using Quanty4RIXS. Clicking the Run Quanty button then triggers either of the following two methods:

(1) GUI mode selected in the main panel creates the script and starts the calculation.

(2) LUA mode selected asks for any prepared .lua script to be executed with Quanty.

Method (1) was already mentioned in the previous section, where it directly starts the calculation based on the selections made in the GUI. Method (2) is meant as a simple click-and-run approach for any .lua script that has been created with the GUI before or elsewhere. In this case the Run Quanty button opens a directory window where the user can select a prepared .lua script for Quanty. This can be used to run a .lua file that was altered manually or to run an arbitrary .lua script for Quanty that was not created with the GUI. The selected file is then used as an input file for Quanty. (Note: this can cause the plotting procedure discussed in the following to no longer work.)

4.6. Plotting the results

Here we introduce the Plotting panel, which is shown in Fig. 7[link]. Owing to the complex file structure of the calculated RIXS maps when more than one microstate is involved, one has to split the resulting data for each microstate and sum them accordingly. This enables, for example, all microstates to be quickly reviewed and compared at once, and a normalized linear combination to be realized before considering a Boltzmann distribution to model a temperature dependency. To achieve this one can calculate and use the expectation values (Observables) to determine the scaling factors for each microstate [see equation (1)[link]].

[Figure 7]
Figure 7
Plotting panel in Quanty4RIXS.

Fig. 8[link] shows a raw RIXS map with ten microstates as it is calculated by Quanty. One can see that in the raw data each individual RIXS map, for each microstate, is merged into one large map showing all microstates at once (we call them here `Multimaps').

[Figure 8]
Figure 8
Example 1s 2p RIXS calculation with ten microstates.

The XAS projection onto the incident energy axis (bottom panel in Fig. 8[link]) directly reveals that not all microstates yield the same RIXS map. (Note: the values on the incident energy axis are for a Multimap, just indices and not energy.)

The plotting panel enables the user to quickly review the result of the calculation and each individual microstate without needing to write a complex plotting routine. For that purpose sliders were added. They can be used to choose how many microstates are used to join the maps (Join Maps). This will equally add all RIXS maps up to the given microstate. With Split Multimap selected, it can also be used to split the raw data and plot only one specific microstate. In spite of the various plots possible, all plots are rather rudimentary, because its main purpose it to quickly plot the calculated RIXS and RIXS–MCD maps for review.

An example of one individual 1s 2p RIXS map using the join function is shown in Fig. 9[link]. The RIXS map shown Fig. 9[link] is the total RIXS as a sum of the the LCP and RCP, where each is the sum [\sum_{{i}}\psi_{i}] over the lowest nine microstates [\psi_{i}] (with [i\in\{1,\ldots,9\}]) and therefore represents a possible variant of the 3T1g ground-state symmetry (3 × 3 = 9) of a Cr4+ ion.

[Figure 9]
Figure 9
Arbitrary example for a 1s 2p RIXS map showing the K pre-edge for a Cr4+ ion.

Furthermore, the magnetic circular dichroism (MCD) can also be calculated. Owing to symmetry considerations the calculations are performed in spherical coordinates for which the LCP and RCP can each be directly represented by a single quadrupole operator, each corresponding formally to one spherical harmonic operator Yl m(r),

[{\rm{MCD}}={\rm{LCP}}-{\rm{RCP}}\,\,\hat{=}\,\,{\rm{Y}}_{2}^{\,1}(r)-{\rm{Y}}_{2}^{\,-1}(r). \eqno(8)]

An arbitrary example of such a 1s 2p RIXS–MCD map together with the projections onto its axes is shown in Fig. 10[link]. The RIXS–MCD map shown corresponds in this example to only the first microstate [\vert\psi_1\rangle]. Subsequently, for an accurate modelling, a linear combination of all involved microstates is required. For MCD calculations under ambient conditions (T > 0 K) it is appropriate to use the Boltzmann distribution to produce a reasonable result [equation (1)[link]].

[Figure 10]
Figure 10
Example of a 1s 2p RIXS–MCD map of the K pre-edge for a Cr4+ ion.

Here one can use the Observables option to compute the expectation values of the Hamiltonian [\langle\,\widehat{{\rm{H}}}\,\rangle] to obtain the relative energy of each microstate, determining the Boltzmann coefficients. Using the Font Observables option one can calculate the quantum mechanical expectation values of any defined operator [\widehat{\rm{O}}] for each micro state [|\psi_i\rangle]:

[\langle\,\widehat{{\rm{O}}}\,\rangle = \langle\psi_i|\,\widehat{{\rm{O}}}\,|\psi_i\rangle. \eqno(9)]

Another example is the expectation values [\langle\,\widehat{S_{z}}\,\rangle] for which Fig. 11[link] shows a plot for the lowest ten microstates for the three RIXS steps (the ground, intermediate and final state; GS, IS, FS). Several observables are already implemented to be directly computed. They include, for example, [\langle\widehat{{{S}}_{z}}\rangle], [\langle\widehat{{{L}}_{z}}\rangle], [\langle\widehat{{{J}}_{z}}\rangle], [\langle\widehat{{{S}}^{\,2}}\rangle], [\sum_{i}\langle\,\widehat{{{l}}_{i}}\,\,\widehat{{{s}_{i}}}\,\rangle] and others. In principle, any operator that is defined in the script can be used to calculate its expectation value. When required, additional operators can be defined for this purpose.

[Figure 11]
Figure 11
Example plot of the expectation values (Observables) showing here the values of 〈Sz〉 for the lowest ten microstates for the three RIXS steps (GS, IS, FS).

5. Concluding remarks

We hope that the above descriptions are helpful for those who want to use the software. We want to explicitly point out that adding more or changing the existing .lua modules in the repository is possible as long as the variable names are used consistently. Simple changes can be implemented without needing to adjust the MATLAB code; however, more advanced changes such as, for example, adding other symmetries will most likely require changes to the Quanty4RIXS routines as well.

Particularly for RIXS–MCD spectra the results can dramatically change even for very small parameter changes. To get started we recommend to begin with the atomic case. From there one has to evaluate each parameter individually to approach the specific system under study. Here, additional information, for example from density functional theory calculations, can be advantageous to estimate good values.

The complete MATLAB source code for Quanty4RIXS, the repository folder and a folder with all dependency graphs (as PDF) illustrating the connection of all functions has been published at For full access, a guest account can be created (via contacting the authors).

The code has been thoroughly tested on Apple OS X 10.11 and in part also on Windows 7. In principle it should work on any operating system as long as the setup requirements described in §2[link] are met. We used and recommend OS X because it has in general shown a better performance and less memory consumption.

All sources are made available `as is' and it can be altered to the user's liking as long as a reference to the original author (Patric Zimmermann, Utrecht University, 2017) is given. For subsequent scientific work we appreciate citation of this paper.


We thank Myrtille Hunault (SOLEIL) for her support with the Quanty scripts. She has been very helpful with the implementation of the .lua scripts used by Quanty4RIXS.

Funding information

Funding for this research was provided by: European Research Council (Advanced Grant No. 340279 to Frank M. F. de Groot).


First citationCowan, R. D. (1981). The Theory of Atomic Structure and Spectra. University of California Press.  Google Scholar
First citationGroot, F. M. de (1991). PhD thesis, p. 84ff. University of Nijmegen, The Netherlands.  Google Scholar
First citationGroot, F. de & Kotani, A. (2008). Core Level Spectroscopy of Solids, in Advances in Condensed Matter Science. Boca Raton: CRC Press.  Google Scholar
First citationHaverkort, M. W. (2010). Phys. Rev. Lett. 105, 167404.  Web of Science CrossRef PubMed Google Scholar
First citationHaverkort, M. W. (2016). J. Phys. Conf. Ser. 712, 012001.  CrossRef Google Scholar
First citationHaverkort, M. W., Sangiovanni, G., Hansmann, P., Toschi, A., Lu, Y. & Macke, S. (2014). Europhys. Lett. 108, 57004.  CrossRef Google Scholar
First citationHaverkort, M. W., Zwierzycki, M. & Andersen, O. K. (2012). Phys. Rev. B, 85, 165113.  Web of Science CrossRef Google Scholar
First citationLu, Y., Höppner, M., Gunnarsson, O. & Haverkort, M. W. (2014). Phys. Rev. B, 90, 085102.  CrossRef Google Scholar
First citationStavitski, E. & de Groot, F. M. F. (2010). Micron, 41, 687–694.  CrossRef CAS Google Scholar
First citationThole, B. T. & van der Laan, G. (1988). Phys. Rev. B, 38, 3158–3171.  CrossRef CAS Web of Science Google Scholar

This is an open-access article distributed under the terms of the Creative Commons Attribution (CC-BY) Licence, which permits unrestricted use, distribution, and reproduction in any medium, provided the original authors and source are cited.

Journal logoJOURNAL OF
ISSN: 1600-5775
Follow J. Synchrotron Rad.
Sign up for e-alerts
Follow J. Synchrotron Rad. on Twitter
Follow us on facebook
Sign up for RSS feeds