All Projects → JohanSchott → impurityModel

JohanSchott / impurityModel

Licence: MIT license
Calculate many-body states of an impurity Anderson model and spectra (e.g. XPS, XAS, RIXS, NIXS)

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to impurityModel

bookr-mod-vita
A book reader for the Vita and Switch. Still a work in progress.
Stars: ✭ 51 (+240%)
Mutual labels:  xps
awesome-spectra
🌈 A collaborative list of awesome tools for spectroscopy. Also, check:
Stars: ✭ 47 (+213.33%)
Mutual labels:  spectra
Dioptas
Python based GUI-Program for integration and exploration of 2D x-ray diffraction images.
Stars: ✭ 44 (+193.33%)
Mutual labels:  x-ray
refnx
Neutron and X-ray reflectometry analysis in Python
Stars: ✭ 25 (+66.67%)
Mutual labels:  x-ray
ParadoxRs232toMqtt
esp8266, serial bus to mqtt for Paradox alarm systems
Stars: ✭ 66 (+340%)
Mutual labels:  spectra
Spectra.jl
Spectra.jl aims at helping treatment of spectral (Raman, Infrared, XAS, NMR) data under the Julia language
Stars: ✭ 18 (+20%)
Mutual labels:  spectra
XPS-17-9700-Ubuntu-Soundfix
A simple script to install the necessary firmware to fix sound output (dummy sound).
Stars: ✭ 19 (+26.67%)
Mutual labels:  xps
RSpectra
R Interface to the Spectra Library for Large Scale Eigenvalue and SVD Problems
Stars: ✭ 68 (+353.33%)
Mutual labels:  spectra
MetaMorpheus
Proteomics search software with integrated calibration, PTM discovery, bottom-up, top-down and LFQ capabilities
Stars: ✭ 59 (+293.33%)
Mutual labels:  spectra
DMFTwDFT
DMFTwDFT: An open-source code combining Dynamical Mean Field Theory with various Density Functional Theory packages
Stars: ✭ 39 (+160%)
Mutual labels:  many-body-physics
covid-19-image-repository
Anonymized dataset of COVID-19 cases with a focus on radiological imaging. This includes images (x-ray / ct) with extensive metadata, such as admission-, ICU-, laboratory-, and patient master-data.
Stars: ✭ 42 (+180%)
Mutual labels:  x-ray
Keras MedicalImgAI
No description or website provided.
Stars: ✭ 23 (+53.33%)
Mutual labels:  x-ray
DellXPS15-9560-OSX
Repository to run Sierra on the Dell XPS 15 9560 (2017)
Stars: ✭ 55 (+266.67%)
Mutual labels:  xps
Throttled
Workaround for Intel throttling issues in Linux.
Stars: ✭ 1,914 (+12660%)
Mutual labels:  xps
marburg
physics meets neural networks
Stars: ✭ 93 (+520%)
Mutual labels:  many-body-physics
GemBox.Document.Examples
Read, write, convert and print document files (DOCX, DOC, PDF, HTML, XPS, RTF, and TXT) in a simple and efficient way.
Stars: ✭ 53 (+253.33%)
Mutual labels:  xps
astrodash
Deep learning for the automated spectral classification of supernovae
Stars: ✭ 25 (+66.67%)
Mutual labels:  spectra
blender-xray
STALKER (aka xray-engine) import/export plugin for Blender 3D
Stars: ✭ 132 (+780%)
Mutual labels:  x-ray
XPS13-9300-hackintosh
opencore hackintosh xps 13 9300
Stars: ✭ 74 (+393.33%)
Mutual labels:  xps
TimeEvolvingMPO
A Python 3 package to efficiently compute non-Markovian open quantum systems.
Stars: ✭ 43 (+186.67%)
Mutual labels:  many-body-physics

Impurity model

CI Code style: black

Introduction

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.

Credits to Petter Saterskog for inspiration and for some of the key functionality.

Credits to Patrik Thunstrom for discussions about computational algorithms.

Photoemission (PS) X-ray photoemission (XPS) X-ray absorption spectroscopy (XAS) Non-resonant inelastic x-ray scattering (NIXS) Resonant inelastic x-ray scattering (RIXS)
Spectra of NiO. Simulated using 50 bath orbitals coupled to the Ni 3d orbitals.

Get started

  • 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. 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 create 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 in get_spectra.py, add --T 10 as input when calling the python-script.

Output files

Input parameters used are saved and stored in .npz format. 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

Optimization notes

Computational speed

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.

RAM memory usage

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.

Tests

Type

pytest

to perform the (unit) tests in the test-folder.

Documentation

The documentation of this package is found in the directory docs.

To update the manual, type:

make -s -C doc/sphinx clean
make -s -C doc/sphinx html

to generate a html-page.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].