Calculate many-body states of an impurity Anderson model and a various spectra, e.g. photoemission spectroscopy (PS), x-ray photoemission spectroscopy (XPS), x-ray absorption spectroscopy (XAS), non-resonant inelastic x-ray scattering (NIXS), and resonant inelastic x-ray scattering (RIXS), using the Lanczos algorithm.
Spectra of NiO. Simulated using 50 bath orbitals coupled to the Ni 3d orbitals.- Execute the bash-script
install_setup.sh
:
./install_setup.sh
This will create a Python virtual environment and install the required system and Python packages.
- Activate the virtual environment and set the PYTHONPATH:
source env.sh
- To run the unit-tests, type
pytest
- To check linting and static type checking, type
make check
- To perform a simulation, first create a directory somewhere on your computer.
Move to that directory and then execute one of the example scripts in the
scripts
folder. E.g. type:
path/to/folder/impurityModel/scripts/run_Ni_NiO_Xbath.sh
This will start a simulation with 10 bath states and one MPI rank. To have e.g. 20 bath states instead of 10, instead type:
path/to/folder/impurityModel/scripts/run_Ni_NiO_Xbath.sh 20
To have e.g. 20 bath states and 3 MPI ranks, instead type:
path/to/folder/impurityModel/scripts/run_Ni_NiO_Xbath.sh 20 3
These examples will read an non-interacting Hamiltonian from file.
A simpler non-interacting Hamiltonian can instead be constructed by crystal-field parameters. This is done for NiO by typing:
path/to/folder/impurityModel/scripts/run_Ni_NiO_CFparam.sh
Although using a crystal-field approach is a bigger approximation, it is convinient when doing fitting to experimental spectra.
But for more accurate simulations it is better to read in a non-interacting Hamiltonian from file, that has been constructed from e.g. DFT or DFT+DMFT simulations.
The non-interacting Hamiltonians read from file by the scripts run_Ni_NiO_Xbath.sh
and run_Ni_NiO_Xbath.sh
have been constructed using non-spin polarized DFT calculations.
- The bash-scripts in the
scripts
-folder act as templates and can easily be modified. For example, to set the temperature to 10 Kelvin inget_spectra.py
, add--T 10
as input when calling the python-script.
The input parameters to the simulation are saved in .npz
format.
Calculated spectra are saved to the file spectra.h5
.
Some small size spectra are also stored in .dat
and .bin
format, for easy and fast plotting with e.g. gnuplot.
For plotting all generated spectra (using matplotlib), type:
python -m impurityModel.plotScripts.plotSpectra
For only plotting the RIXS map, type:
python -m impurityModel.plotScripts.plotRIXS
Using Gnuplot, instead type:
path/to/folder/impurityModel/impurityModel/plotScripts/plotRIXS.plt
MPI is used. For finding the ground states and calculating the spectra (except for RIXS), parallelization is done over the product states in the many-body basis. For the RIXS simulations, parallelization is by default first done over product states of the core-hole excited system and then over the in-coming photon energies.
The memory goes primarly to storing the Hamiltonian in a basis of product states. This Hamiltonian is stored as a dictionary, with product states, |ps>, as dictionary-keys and the Hamiltonian acting of each product state, H|ps>, as dictionary-values. When several ranks are used, the information is distributed over the MPI ranks, such that one rank only stores some of all the product-state keys. This reduces memory usage for each MPI rank.
A sparse matrix format of the Hamiltonian is used when generating a spectrum. This sparse matrix variable is also distributed in memory over the MPI ranks. This is done to reduce memory usage per MPI rank.
A product state with electrons in spin-orbitals with indices e.g. 2 and 5 can be described by the tuple: (2,5). If the system has 7 spin-orbitals in total, the product state can also be described by the binary-string "0010010". The product state can also be translated into the base-2 integer 2^(7-1-2) + 2^(7-1-5) = 2^4 + 2^1 = 16+2 = 18. With many electrons the integer representation is a more memory efficient format. Bitarray is a class which also can be used to represent a product state. It is mutable which enables fast modifications (adding and removing electrons), and is used in the current version. To keep the memory usage down, an imutable bytes class is also used in the current version.
Type
pytest
and
pytest impurityModel/test/test_comparison_with_reference.py
to run all python unit tests in the repository.
The documentation of this package is found in the directory doc
.
To update the manual type:
make -s -C doc/sphinx clean
make -s -C doc/sphinx html
Open the generated doc/sphinx/generated_doc/html/index.html
in a web browser.
Call for contributions: The impurityModel project welcomes your expertise and enthusiasm!
Contributors:
- Johan Schött (@JohanSchott): Implemented many of the functionalities needed to solve the impurity problem.
- Johan Jönsson (@johanjoensson): Implementented the entire DMFT cycle in the fork https://github.com/johanjoensson/impurityModel. Also developed the related repo: https://github.com/johanjoensson/rspt2spectra
- Felix Sorgenfrei (@fesorg): First author in publication using the impurityModel repo. Has also made the related repo: https://github.com/fesorg/Tutorial-X-ray-from-RSPt
- Patrik Thunström (@patrikthunstrom): Involved in discussions about computational algorithms, reported bugs, and has provided theoretical knowledge and inspiration.
- Petter Säterskog (@PetterSaterskog): Written some of the initial key functionalities.
- Christian Häggström (@kalvdans): Has provided valuable reviews on PRs.
- Mébarek Alouani: Has provided theoretical knowledge and inspiration.
- Olle Eriksson: Has provided theoretical knowledge and inspiration.
- Igor Di Marco (@igordimarco): Has provided theoretical knowledge and inspiration.
Please note that the list and the contribution information are incomplete.
Theory of x-ray absorption spectroscopy for ferrites
Re-Dichalcogenides: Resolving Conflicts of TheirStructure–Property Relationship