Welcome to core-level spectroscopy calculation with opw2x package!
This page guides students to computation of core-level spectra of basic x-ray excitation processes (e.g. core-level XPS, XAS, and direct RIXS) in d and f electron systems using cluster/Anderson impurity model implemented in the opw2x package. The configuration-interaction-based exact diagonalization method is adopted to solve the impurity models. The Anderson model with core orbitals explicitly taken into account can be used for calculating core-level spectra on the valence bands simulated by the DFT+DMFT scheme. For advanced usage (e.g. inclusion of higher configurations, resonant (Auger) processes etc), see link [↪︎] (under construction).
Computational Steps (overview)

Script files (green) necessary at steps.1-3 described below are generated automatically by prep_xspec command, which reads user’s setup (target element, valence, x-ray processes etc). The users should rerun prep_xspec when the parameters in case.and files (which define e.g. configuration diagonal energies (charge-transfer energies, Coulomb (isotropic) interaction, core-hole potential see details below) are updated. execute_spec_case generated by prep_xspec is a complete script which executes the entire steps all together. For VSC (vienna scientific cluster) users, prep_xspec generates batch files (batchjob_**) which can be submitted to VSC4 with multi-nodes/cores parallelization. Users must specify the quantum number (mj-block) of the initial states (which are computed at step.1) on which x-ray excitations act. For a beginner, flag “-i” (i.e. “prep_xspec –i“) generates all input files in /Inputs/ (note. the flag overwrites all input files). Then just add solid-parameter values for the studied compound. For the Anderson impurity model calculation, one must decide how to treat the bath which the impurity site exchanges the electrons with. Besides simple band shapes (like semielipse, rectangular etc), users can input the bath (hybridization function in practice) obtained by ab-initio band calculations combined with dynamical mean-field theory (DMFT). The Anderson impurity model with DMFT can include the effect of correlated bands (d, f bands) in the core-level spectroscopy analyzes, see Refs
LDA+DMFT approach to core-level spectroscopy: Application to 3d transition-metal compounds
Atsushi Hariki, Takayuki Uozumi, and Jan Kuneš, Physical Review B 96. 045111 (2017) [Link]
Continuum Charge Excitations in High-Valence Transition-Metal Oxides Revealed by Resonant Inelastic X-ray Scattering
Atsushi Hariki, Mathias Winder, and Jan Kuneš, Physical Review Letters 121, 126403 (2018) [Link]
LDA+DMFT approach to resonant inelastic x-ray scattering in correlated materials
Atsushi Hariki, Mathias Winder, Takayuki Uozumi, and Jan Kuneš, Physical Review B 101, 115130 (2020) [Link]
Learn more about prep_xspec [↪︎]
generating script files for your target compounds.
Example of prep_xspec for Ni 2p XPS calculation of NiO
name=NiO # Material
atom=Ni # Atom
valance=2 # Formal valence
core=2p # 2p core
type=P # P : XPS / A : XAS / RE : RXES
solver=and # and : Anderson / clu : Cluster
pol_inp=0 # Input for polarization 0:Off / 1:On
pol=D # Polarization name. D: Depol (pi) / P: Pol (sigma)
flug_ham="" # Optional flags for hamil
flug_and="" # Optional flags for and
Step.1 Calculation of ground state (initial states in finite-temperature calculations)
First one computes the ground state |g> (and its energy Eg) on which the x-ray excitation (T) acts. To simulate finite temperatures, one may needs (a few) excited states with non-negligible Boltzmann weights at the simulated temperature. The computed eigen vectors (ground state and a few excited states) are stored in “EX_State.dat” file. This file may become huge (~ a few GB) when higher configurations (|dn>, |dn+1L>, |dn+2L2>, ….) are included in the simulation. Thus after the analysis, it is recommended to delete the EX_State.dat file (clean_opw2x will take care of it). The ground state calculation proceeds in the following two internal steps, ham.GS and and.GS (or clu.GS for the cluster model). If the users need the point-group symmetry which is nor present in the default choice in caseGS.ham file, the users can instead provide (i) any one-particle operators in case.ham (to simulate e.g. crystal field operators in the low symmetry) and (ii) any (local) unitary matrix in case.ush (to work with basis where e.g. off-diagonal elements of Hamiltonian elements are small and thus neglected), see details [↪︎]. The point group symmetry is used to reduce the Hamiltonian into the block structure, which accelerates the computation (sometimes dramatically) of the initial states and spectral intensities later. Thus it is recommend to find the point-group symmetry at the impurity site before the calculation.
Step1-1. Construction of reduced Hamiltonian matrix elements: run “ham.GS“
This step computes reduced Hamiltonian matrix elements based on two input files by users:
1. caseGS.ham [→ check file]
defines configurations to be included in the ground-state calculation and sets parameters for the intra-atomic interaction (Slater integrals, crystal field, spin-orbit coupling etc.)
2. caseGS.cha (optional) [→ check file]
defines observables to be computed/visualized for the initial states.
ham.GS executes (e.g. Ni2+ system): #====================================== cp Inputs/Ni2GS.ham fort.30 cp Inputs/Ni2GS.cha fort.33 cp Inputs/Ni2GS.ush fort.38 : case.ush is an optional file contains user-defined unitary matrix (skipped in default setup) hamil.dx : executable file (user must give a path to opw2x/lib in bash file) cp fort.50 ham.dat : ham.dat and cha.dat contain reduced matrix elements for Hamiltonian and observables (specified in caseGS.cha), respectively. cp fort.53 cha.dat rm fort* #======================================
a few advanced tips for Step1-1
(non-zero) matrix elements are represented in coupled basis constructed by direct product of active shells for a given interaction. Thus, the coupled basis representing the reduced matrix elements depends on the type of the interaction. The flag -cbt is an option to truncate Slater determinants in the shell-basis according to the user’s request (design) provided in “case.cbt” file [↪︎].
Step1-2. Diagonalization of the Hamiltonian: execute “and.GS“
this step computes initial states by diagonalizing the Hamiltonian based on an input file by the users:
1. caseGS.and (in Anderson model) / caseGS.clu (in cluster model) [→ check file]
defines configuration diagonal energies, which are often treated as adjustable parameters in fitting analysis of experimental core-level spectroscopy data. In the Anderson impurity model combined with the LDA+DMFT scheme, these values are fixed in the LDA+DMFT self-consistent calculation. Thus one just copies the values from your DMFT data. The code computes the eigen vectors of the Hamiltonian one by one from low- to high-energies. Though it depends on the temperature and eigen spectrum (which of course depends on your system), usually only a few excited states contribute to the thermal average. Therefore, in caseGS.and file, the users must specify the number of the excited states to be computed (in each symmetry block of the Hamiltonian) in the diagonalization. This number must be consulted with the simulated temperature and the multiplicity of the low-energy excited states. For the Anderson impurity model, here users decide how to describe the bath (simple shapes supported in the cod, or provide bath obtained by ab-initio calculations etc.)
and.GS executes (e.g. Ni2+ system): #====================================== cp Inputs/Ni2GS.ham fort.30 cp Inputs/Ni2GS.and fort.31 cp Inputs/Ni2GS.cha fort.33 cp Inputs/Upd.inp fort.35 : optional input for 4p-3d Coulomb interaction in e.g. K-edge XAS #--------------------------- cp ham.dat fort.50 cp cha.dat fort.53 cp Valence.dat fort.55 : Valence.dat/Conduction.dat contain discritized bath levels above/below Fermi energy for the Anderson impurity model, see [link] cp Conduction.dat fort.56 ander_VC.dx >> log_GS : executable file (log_GS stores the information (observables, energies) on the ground state) cp fort.83 EX_State.dat : EX_State.dat stores the eigen vectors of the selected initial states. #======================================
Where/which is my ground state?
The code reduces the full Hamiltonian into the block Hamiltonian, each of which is specified by total Mj=Lz+Sz (in practice 2Mj is used in the code to use integer values for that). Though the total Mj is a good quantum number in spherical symmetry, the crystal-filed operators mix different Mj values partially. The mixing rule depends on the point group symmetry at the impurity site, but Mj values still characterize the block structure. The code computes the ground state (and some excited states) in each block Hamiltonian (represented by 2Mj values, see figure below) separately. The lowest energy one is, of course, the true ground state of the system and is used in the calculation of spectral intensities. The users consider here whether to include other excited states at the simulated temperature.

log_GS file (written by and.GS), which shows a summary of your eigen spectrum ====> Summary of Eigen Spectrum Energy = -3.12759868 with 1 states in Mjs = 6 → my ground state is not degenerated and found in 2Mj=6 block ! Energy = -3.04710263 with 1 states in Mjs = 4 Energy = -2.96488580 with 1 states in Mjs = 2 Energy = -2.37900337 with 1 states in Mjs = 0 Energy = -2.35536008 with 1 states in Mjs = 4 Energy = -2.35442126 with 1 states in Mjs = 6
Step.2 Calculation of spectral intensities
In this step, the code computes spectral intensities for the x-ray excitations on the initial states obtained in the previous step. Here users provide two input files (case.ham, case.and) which specify final states (configurations, parameters) included in the spectral calculation. Additionally, the users can specify the geometry setting (x-ray polarization & angle vs samples) and resonant energies in case.res file. In practice, the code does not compute the eigen spectrum (eigen vectors, i.e. |f>), but computes its overlap with the ground state (i.e. <f|T|g>) efficiently using the Lanczos-based numerical method.
Step2-1. Construction of reduced Hamiltonian matrix elements for the final states: run “ham.case“
This step computes reduced Hamiltonian matrix elements based on an input files by users:
1. case.ham [→check file]
defines configurations for the (initial and) final states to be included and sets parameters for the intra-atomic interaction (Slater integrals, crystal field, spin-orbit interaction etc.)
ham.case executes (e.g. Ni 2p XPS for Ni2+ system): #====================================== cp Inputs/Ni22pP.ham fort.30 cp Inputs/Ni22pP.cha fort.33 : usually we are not interested in the character (observables) of the final states, thus this file is not provided by users except for special purposes cp Inputs/Ni22pP.ush fort.38 : case.ush is an optional file, contains user-defined unitary matrix (skipped in default setup) hamil.dx cp fort.50 ham.dat : ham.dat and cha.dat contain reduced matrix elements for Hamiltonian and observables (specified in case.cha), respectively. cp fort.53 cha.dat rm fort* #======================================
Step2-2. Compute spectral intensities with the final-state Hamiltonian: run “and.case”
This step computes the spectral intensities (based on Fermi’s golden rule for 1st order process or Kramers-Heisenberg formula for RIXS) on the initial states calculated at step.1 using Krylov subspace method (Lanczos or conjugate gradient method) based on an input file by users:
1. case_mj*_ex*.and (in Anderson model) / case.clu_mj*_ex* (in cluster model) [→ check file]
defines the configuration diagonal energies (and hybridization amplitudes with ligands in case of the cluster model) for (initial and) final states, which are usually treated as adjustable parameters in fitting analysis of experimental core-level spectroscopy data.
Important : users edit case.and file and prep_xspec generates case_mj*_ex*.and
case_mj*_ex*.and is the case.and file for the ex-th excited state (“1” is the ground state, “2” is the first excited state etc..) in the quantum number mj* (the step of the quantum number depends on the point group symmetry, see above). The initial states to included depend on the temperature (and possible degeneracies). Thus first the users check the energies of the low-energy states in the step.1 (see log_GS that contains energy information on the computed states), and then specify the states (mj, ex) to be included in the simulation in prep_xspec file. The prep_xspec reads the case.and file and generates (extends) it to case_mj*_ex*.and files for the selected initial states. Thus, the users NEVER touches the case_mj*_ex*.and files but only edit case.and file. When the user changed the case.and file, rerun prep_xspec file to update (overwrite) case_mj*_ex*.and files.
and.case executes (e.g. Ni 2p XPS for Ni2+ system): #====================================== cp Inputs/Ni22pP.ham fort.30 cp Inputs/Ni22pP_mj0_ex1.and fort.31 cp Inputs/Upd.inp fort.35 : optional input for 4p-3d Coulomb interaction in e.g. K-edge XAS #--------------------------- cp ham.dat fort.50 cp cha.dat fort.53 cp Valence.dat fort.55 : Valence.dat/Conduction.dat contain discritized bath levels above/below Fermi energy for the Anderson impurity model, see [link] cp Conduction.dat fort.56 cp EX_State.dat fort.83 : EX_State.dat stores the eigen vectors of the initial states calculated at step.1. ander_VC.dx >> log_and : log_and is log_file for special calculation #--------------------------- cat fort.70 >> temp #--------------------------- rm fort* #--------------------------- mv temp Ni22pP.SP : case.SP file contains the excitation energies and their spectral intensities
Step.3 Spectral convolution
The last step convolutes the spectral intensities (computed at step.2) to simulate spectral broadenings due to core-hole lifetime and/or experimental instrumental broadening. For the former (core-hole life time broadening), Lorentzian function (natural lifetime) is usually used for its broadening, while for the latter Gaussian function is used (of course, the code allows the users to combined the two, see below). Besides, the code sums up convoluted spectra for different initial states weighted with the Boltzmann factors for finite-temperature calculations (the temperature is give here by the users). The values of HWHM (half width at half maximum) for the Lorentzian and/or Gaussian functions, and the simulated temperature are given in the input file “case.cnv“. The convoluted spectrum (final result) is found in case.dat file.
example of case.cnv (Ni22pP.cnv) #====================================== cp Inputs/Ni22pP.cnv fort.20 !<< Ni22pP.cnv is the input file echo 4 > temp_cnv cat Ni22pP.SP >> temp_cnv cp temp_cnv fort.21 exconv.dx >> log_and #cat fort.24 >> fort.23 cp fort.23 Ni22pPN.dat !<< Ni22pPN.dat is the concluded spectrum cp fort.25 Ni22pPN_gnu2d.dat !<< case_gnu2d.dat is for 2D color plot of RIXS spectra using gnuplot rm fort* rm temp_cnv #=====================================
case.cnv (template)
========= Input for line spectrum convolution =========== mode (1:1st-order and Resonance,2:Normal process) 1 Temperature / unit (1:eV, 2:T[K]) 300 2 x1, x2, << enregy range [x1,x2] for the convolution -35.0 35.0 L(E) : gnmL, G(E) : gnmG, ndim << L : Lorentzian / G: Gaussian 0 0.40 1 0.50 600 << gnmL (gnmG) is HWHM value of L (G) Back Ground (for Total) << ndim is no.of energy discretization in the energy range above 0 0.0 Base-line separation (for Resonance mode) 0.0 0.05 Spectra to be convoluted (0:all, other:specific) 0 1 3 4 8 Multiplied factor (0:all, other:for selected above) 0 1.0 1.0 0.1 5.0 Inidividual_Shift (0/1) << for mode 1 0 ================================================================= % mode - 1 : usual convolution for 1st-order and Resonance Process % - 2 : convolution for Normal Process (given by kinetic or emitted % <== given for electron-kinetic or emitted photon energy % % The selected spectra are multipied by factors specified and their energy % is shifted by (Energy Shift for all) and by (Energy shift for individuals). % Base-line separation is defined as the ratio with respect to % the maximum intensity of the convoluted spectra.